
function toggle()
{
    var listElementStyle=document.getElementById('tr1').style;	
    var listElementStyle2=document.getElementById('tr2').style;	    
    //var listElementStyle4=document.getElementById('tr4').style;	
    //var listElementStyle5=document.getElementById('tr5').style;	
    //var listElementStyle6=document.getElementById('tr6').style;	
    //var listElementStyle7=document.getElementById('tr7').style;		
	
    if (listElementStyle.display=="none"){
      listElementStyle.display="block";
	  listElementStyle2.display="none";      
     // listElementStyle4.display="block";
     // listElementStyle5.display="block";
     // listElementStyle6.display="block";
     // listElementStyle7.display="block";
      
    }else{
      listElementStyle.display="none";
	  listElementStyle2.display="block";      
     // listElementStyle4.display="none";
     // listElementStyle5.display="none";
     // listElementStyle6.display="none";
     // listElementStyle7.display="none";
	  }
	
 }
//
function doSubmit()
{
document.frmPS.action="search.asp";
document.frmPS.submit();
}
//
function IsNumeric()
{  
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
    
	if (document.frmPS.txtMinSQ.value>100 || document.frmPS.txtMinSQ.value<0)
	{
	     alert("Value cant be greater than 100 or less than 0");
		 document.frmPS.txtMinSQ.focus();
		 return false;
		
	}
	
	if (document.frmPS.txtMinSQ.value=="")
	{
	     alert("Fields are Empty");
		 document.frmPS.txtMinSQ.focus();
		 return false;
	}
	
   for (i = 0; i < document.frmPS.txtMinSQ.value.length && IsNumber == true; i++) 
      { 
      Char = document.frmPS.txtMinSQ.value.charAt(i);
      if (ValidChars.indexOf(Char) == -1) 
         {		
          alert("Numeric values are allowed only");
		 document.frmPS.txtMinSQ.focus();
		 return false;
         }
      }
   
   	if (document.frmPS.txtMaxSQ.value>100 || document.frmPS.txtMaxSQ.value<0)
	{
	     alert("Value cant be greater than 100 or less than 0");
		 document.frmPS.txtMaxSQ.focus();
		 return false;
	}
	
	if (document.frmPS.txtMaxSQ.value=="")
	{
	     alert("Fields are Empty");
		 document.frmPS.txtMaxSQ.focus();
		 return false;
	}
   
    for (j = 0; j < document.frmPS.txtMaxSQ.value.length && IsNumber == true; j++) 
      { 
      Char = document.frmPS.txtMaxSQ.value.charAt(j);
      if (ValidChars.indexOf(Char) == -1) 
         {		
          alert("Numeric values are allowed only");
		 document.frmPS.txtMaxSQ.focus();		  
		 return false;
         }
      }   
   
    if (document.frmPS.txtMinOff.value>100 || document.frmPS.txtMinOff.value<0)
	{
	     alert("Value cant be greater than 100 or less than 0");
		 document.frmPS.txtMinOff.focus();
		 return false;
	}
	
	if (document.frmPS.txtMinOff.value=="")
	{
	     alert("Fields are Empty");
		 document.frmPS.txtMinOff.focus();
		 return false;
	}
   
    for (k = 0; k < document.frmPS.txtMinOff.value.length && IsNumber == true; k++) 
      { 
      Char = document.frmPS.txtMinOff.value.charAt(k);
      if (ValidChars.indexOf(Char) == -1) 
         {		
          alert("Numeric values are allowed only");
  		 document.frmPS.txtMinOff.focus();
		 return false;
         }
      }
	  
	 if (document.frmPS.txtMaxOff.value>100 || document.frmPS.txtMaxOff.value<0)
	{
	     alert("Value cant be greater than 100 or less than 0");
		 document.frmPS.txtMaxOff.focus();
		 return false;
		 
	}
	
	if (document.frmPS.txtMaxOff.value=="")
	{
	     alert("Fields are Empty");
		 document.frmPS.txtMaxOff.focus();
		 return false;
	} 
   
    for (m = 0; m < document.frmPS.txtMaxOff.value.length && IsNumber == true; m++) 
      { 
      Char = document.frmPS.txtMaxOff.value.charAt(m);
      if (ValidChars.indexOf(Char) == -1) 
         {		
          alert("Numeric values are allowed only");
  		 document.frmPS.txtMaxOff.focus();
		 return false;
         }
      }
   }
