   /*
       Common Help Procedures for Searches
   */
   function help()
   {
    if(shelp == '0')
		{
		 crossbrowser("div_hlp",  "");
		 shelp = '1';
		}
	else
		{
		 crossbrowser("div_hlp",  "none");
		 shelp = '0';
		 return;
	    }
	switch(document.frmpage.srch_srchtype.value)
	{
	  case 'condo':
  		 CondoHelp()
		 break;
	  case 'use':
	     TypeUseHelp()
	     break;	  
	  case 'subdivision':
	     SubDivHelp()
	     break;
	  case 'address':
	     AddressHelp()
	     break;
	  case 'street':
	     AddressHelp()
	     break;	     
	  case 'pcn':
		 PcnHelp()
		 break;
	  case 'owner':
	     OwnerHelp()
	     break;
	  case 'book':
	     BookHelp()
	     break;	
	  case 'tangible':
		 TangibleHelp()
		 break;	
	  case 'municipality':
	     MunicipalityHelp();
	     break;		 
	 }
   }
   
   function TangibleHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/tangiblehp.htm";
	   document.getElementById("ifrm_hlp").style.display = "";
   }   
   
   function OwnerHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/Ownerhp.htm";
	   document.getElementById("ifrm_hlp").style.display = "";
   }
 
   function TypeUseHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/typeusehp.htm";
	   document.getElementById("ifrm_hlp").style.display = "";
   }  
   
   function AddressHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/AddressHp.htm";	   
	   document.getElementById("ifrm_hlp").style.display = "";
   }
   
   function PcnHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/Pcnhp.htm";
	   document.getElementById("ifrm_hlp").style.display = "";
   }
   
   function BookHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/Bookhp.htm";
	   document.getElementById("ifrm_hlp").style.display = "";
   }
   
   function CondoHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/condohp.htm";
	   document.getElementById("ifrm_hlp").style.display = ""; 
   }
   
   function MunicipalityHelp()	{
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/municipalityhp.htm";
	   document.getElementById("ifrm_hlp").style.display = ""; 
   }
      	   
   function SubDivHelp()
   {
       crossbrowser("div_hlp",  "");
	   document.getElementById("ifrm_hlp").src = "../../html/Subdivhp.htm";
	   document.getElementById("ifrm_hlp").style.display = ""; 
   }
   
   function go_Sales()
	 {
     var kc = window.event.keyCode;
     if(kc == 13 )
       {
         var stemp = false;
         stemp = do_validate();
         if(stemp == true)
			{
			document.frmpage.srch_sHiddenCity.value = document.frmpage.srch_tl_city.value;
			//document.frmpage.srch_sSubdiv.value = '';
			document.location =  '../SALES/subdivision.aspx?styp=' + document.frmpage.srch_typmod.value + '&sdiv=' + document.frmpage.srch_sSubdiv.value + '&sdivnam=' + document.frmpage.srch_sSubdivName.value  + '&city=' + document.frmpage.srch_tl_city.value + '&zip=' + document.frmpage.srch_txtzip.value + '&method=subdivision' + '&cidx=' + document.frmpage.srch_txtzip.value;	  
			}
	   }
	 }
	 
	 
   function go_UseCodes()
	 {
	 if (do_validate())
	 {
     var kc = window.event.keyCode;
     if(kc == 13 )
       {
		 document.frmpage.srch_sHiddenCity.value = document.frmpage.srch_tl_city.value;         
         document.frmpage.srch_hdnuse.value = '';
		 document.location =  '../SALES/usecode.aspx?styp=' + document.frmpage.srch_typmod.value + '&use=' + document.frmpage.srch_hdnuse.value + '&usnam=' + document.frmpage.srch_txtUse.value  + '&city=' + document.frmpage.srch_tl_city.value + '&zip=' + document.frmpage.srch_txtzip.value + '&method=use' + '&cidx=' + document.frmpage.srch_txtzip.value;	  
	   }
	  }  
	 }

   function go_Condominiums()
	 {
     var kc = window.event.keyCode;
     if(kc == 13 )
       {
		 if (do_validate())
		 {
		 document.frmpage.srch_sHiddenCity.value = document.frmpage.srch_tl_city.value;       
         document.frmpage.srch_sCondoNo.value = '';
		 document.location =  '../SALES/condocomplex.aspx?styp=' + document.frmpage.srch_typmod.value + '&condo=' + document.frmpage.srch_sCondo.value + '&condoname=' + document.frmpage.srch_sCondo.value  + '&city=' + document.frmpage.srch_tl_city.value + '&zip=' + document.frmpage.srch_txtzip.value + '&method=condo' + '&cidx=' + document.frmpage.srch_txtzip.value;	  
		 }
	   }
	 }	   
  
   /*
       Common Key Stroke function for Searches
   */
   function entNGo()
     {
     var kc = window.event.keyCode;
     if(kc == 13)
       {
       var sok = true;
	   var mybutton = document.getElementById('srch_btnsearch');
       //sok = do_validate();
       //if(errors == 0)
       //  {
			mybutton.value = "clicked"
			mybutton.focus();
			frmpage.submit();
		// }
       }
     }
     
   
   /*
       Common Key Stroke function for Condo Searches
   */     
   function entSrchCondo(action)
     {
     var kc = window.event.keyCode;
     var objStatus;
	 var condono = ''; 
	 var mybutton = '';  
     objStatus = "dialogLeft:125px;dialogTop:230px;dialogHeight:335px;dialogWidth:418px;center:no;resizable:no;status:no";
     if(kc == 13 )
       {
	    mywindow = window.showModalDialog("../sales/by_condo.aspx?condo=" + document.frmpage.srch_sCondo.value, null,objStatus); 
	    mybutton = document.getElementById('srch_btnsearch');
	    if(mywindow > '')
		  {
	        condono = mywindow.split(',')
			document.frmpage.srch_sCondo.value = condono[1].toString();
			document.frmpage.srch_sCondoNo.value = condono[0].toString();
			if (action != 'sales')
			  {
			    var sok = do_validate()
				if(sok == true)
				  {
				    mybutton.value = "clicked"
				    mybutton.focus();
				    document.frmpage.submit();
				  }
			  }			
		  } else 
			{
		      mywindow = '';
			  document.frmpage.srch_sCondo.value = mywindow;
			  document.frmpage.srch_sCondoNo.value = mywindow;
		    }
     } else if (action == "clicked")
       {
       	mywindow = window.showModalDialog("../sales/by_condo.aspx?condo=" + document.frmpage.srch_sCondo.value,null,objStatus); 
	    if (!(mywindow))
	      {
	      	document.frmpage.srch_sCondo.value = mywindow; 
	        mywindow = "";
	      }
	    else
	      {
	        condono = mywindow.split(',')    
			document.frmpage.srch_sCondo.value = condono[1].toString();
			document.frmpage.srch_sCondoNo.value = condono[0].toString();
       }
     }
   }
   
   /*
       Common Key Stroke function for SubDiv Searches
   */       
   function entSrchSubdiv(action)
     {
     var kc = window.event.keyCode;
     var objStatus;
     objStatus = "dialogLeft:125px;dialogTop:230px;dialogHeight:356px;dialogWidth:550px;center:no;resizable:no;status:no";
     
     if(kc == 13 )
       {
		document.frmpage.srch_sSubdiv.value
	    mywindow = window.showModalDialog("../sales/by_subdiv.aspx?subdiv=" + document.frmpage.srch_sSubdivName.value, null,objStatus); 
	    var mybutton = document.getElementById('srch_btnsearch');
	    if (mywindow > '' && 
	        mywindow != 'undefined')
		  {	  
	        var subDiv = '';
	        subDiv = mywindow.split(',')
			document.frmpage.srch_sSubdivName.value = subDiv[1].toString();
			document.frmpage.srch_sSubdiv.value = subDiv[0].toString();
			if (action != 'sales')
			  {
			    var sok = do_validate()
				if(sok == true)
				 {	
					mybutton.focus();
					mybutton.value = "clicked";
				 }
			  } else {
			  		   document.frmpage.srch_tl_fmamt.focus();
			  		 }
	      } else
	        {
			 document.frmpage.srch_sSubdivName.value = subDiv;
			 document.frmpage.srch_sSubdiv.value = '';
			 document.frmpage.srch_sSubdivName.focus();	
	        }
          }
   }
   
   
   /*
       Common Key Stroke function for Type Use Searches
   */ 
   function entSrchUse(action)
     {
     var kc = window.event.keyCode;
     var objStatus;
     objStatus = "dialogLeft:150px;dialogTop:236px;dialogHeight:335px;dialogWidth:417px;center:no;resizable:no;status:no";
          
     if(kc == 13 )
       {
	    var mybutton = document.getElementById('srch_btnsearch');
	    mywindow = window.showModalDialog("../sales/by_useCode.aspx?fuse=" + document.frmpage.srch_txtUse.value, null,objStatus); 
	    if (mywindow > '')
		  {	  
			var use_code = mywindow.split(',')
			document.frmpage.srch_txtUse.value = use_code[1];
			document.frmpage.srch_hdnuse.value = use_code[0];      
			if (action != 'sales')
			  {
			    var sok = do_validate()
				if(sok == true)
				  {	
					mybutton.value = "clicked"
					mybutton.focus();
					document.frmpage.submit();
				  }
			  }				  
		  } else
		    {
			  document.frmpage.srch_txtUse.value = '';
			  document.frmpage.srch_hdnuse.value = ''; 		     
		    }
       } else if (action == "clicked")
		{
		   mywindow = window.showModalDialog("../sales/by_useCode.aspx?fuse=" + document.frmpage.srch_txtUse.value, null,objStatus); 
	       if (mywindow > '')
			{
			  var use_code = mywindow.split(',')
			  document.frmpage.srch_txtUse.value = use_code[1];
			  document.frmpage.srch_hdnuse.value = use_code[0];
			} else
			  {
				document.frmpage.srch_txtUse.value = '';
				document.frmpage.srch_hdnuse.value = '';
			  }	
		}
     }
                
   
   function TabNext(obj,event,len,next_field) {
	if (event == "down") {
		field_length=obj.value.length;
	}
	else if (event == "up") {
		if (obj.value.length != field_length) {
			field_length=obj.value.length;
			if (field_length == len) {
				next_field.focus();
			}
		}
   }
 }
