/* Used by editProfile.jsp
   Updated: Sep 8, 2007 RS
  */


				function selectCity() {
					clearAll();
					showDiv('show','_PROV');  // Province
					showDiv('show','_PC');  // postal code
					showDiv('show','_FINDCITY');    
					updateInputFld(1, 'addressTypeField');

					showInline('show','rural_streetNumber');
					showInline('show','rural_streetName');
					
				}
				function selectPO() {
					clearAll();
					showDiv('show','_PROV');  // Province
					showDiv('show','_PC');  // postal code
					showDiv('show','_POBOX');  // PO Box
					showDiv('show','_FINDCITY');    
					updateInputFld(2, 'addressTypeField');
					
					showInline('hide','rural_streetNumber');
					showInline('hide','rural_streetName');

				}
				function selectUS() {
					clearAll();
					showDiv('show','_US');    // US	
					showDiv('hide','_FINDCITY');    
					updateInputFld(3, 'addressTypeField');			

					showInline('show','rural_streetNumber');
					showInline('show','rural_streetName');
				}
				function switchAddressType() {
					document.getElementById('form0:simpleBox').style.display='none';
					document.getElementById('form0:cpcBox').style.display='block';
					updateInputFld(1, 'addressTypeField'); 
					document.getElementById('cpc_city_type').checked='checked';
				}
				
				function clearAll() {
					//	try {
							document.getElementById('form0:_PROV').style.display = 'none';
							document.getElementById('form0:_PC').style.display = 'none';
							document.getElementById('form0:_POBOX').style.display = 'none';
							document.getElementById('form0:_US').style.display = 'none';
					//	}
					//} catch(err) {}
					
				}

				function showInline(showhide, id) {

					var obj = (document.getElementById('form0:'+id))? (document.getElementById('form0:'+id)):(document.getElementById(id));
					if(showhide == 'show') {
						obj.style.display='inline';
					} else {
						obj.style.display='none';
					}
				}

				function showDiv(showhide, id) {

					var obj = (document.getElementById('form0:'+id))? (document.getElementById('form0:'+id)):(document.getElementById(id));
					if(showhide == 'show') {
						obj.style.display='block';
					} else {
						obj.style.display='none';
					}
				}
				
				function updateInputFld(valNum, id) {
					document.getElementById('form0:'+id).value = valNum;
				}










/**** Original crap */
function startup(blkTotal) {
	try {
		for(var i=1;i<parseInt(blkTotal)+1;i++) {
			document.getElementById('form0:block'+i).style.display = 'none';
		}
	} catch(err) {}
}

function showBlock(id,blId,blkTotal) {
	if(id == 1) {
		document.getElementById('form0:block'+blId).style.display='block';
	} else {
		document.getElementById('form0:block'+blId).style.display='none';
	}
}

