// JavaScript Document
function skey_valid(){
  var a=document.skey.pkeyword.value
      //a=a.trim
  var b=a.length
  if (b<3){
    alert("Please input atleast 3 alphabets")
    document.skey.pkeyword.focus()
    return false
  }else{
    return true
  }
}

function con_check(){  
		
		 if(!validate_text(document.con_ff.fname,1,"Please enter your First Name")){
			 return false;
		 }
		 
		 if(!validate_text(document.con_ff.lname,1,"Please enter your Last Name")){
			 return false;
		 }
		 
		 if(!validate_text(document.con_ff.address,1,"Please enter your Address")){
			 return false;
		 }
		 
		 if(!validate_text(document.con_ff.city,1,"Please enter your City")){
			 return false;
		 }
		 
		 if(!validate_text(document.con_ff.state,1,"Please enter your State")){
			 return false;
		 }
		 
		 if(!validate_text(document.con_ff.zip,1,"Please enter your Zip")){
			 return false;
		 }
		 
		 if(!validate_text(document.con_ff.day_phone,1,"Please enter your Daytime Phone Number")){
			 return false;
		 }
		 
		if(!validate_email(document.con_ff.email,1,"Please enter your Email")){
			 return false;
		} 
		 
		if(!validate_text(document.con_ff.req_time,1,"Please enter Requested Time")){
			 return false;
		}
		 
		if(!validate_text(document.con_ff.message,1,"Please enter your Comments/Questions")){
			 return false;
		} 
		 
		if(!validate_text(document.con_ff.captchacode,1,"Please enter your Confirmation Code")){
			 return false;
		}  
  
     return true;  
}

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

var liveReqp = "";
var print_dt = "";
var chng = "";

function getdata(aa,tb,fld,folpth) {			
	chng = fld;
	
	if (window.XMLHttpRequest) {
		liveReqp = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		liveReqp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	var sURL = folpth + "includes/get_cat.asp?id="+aa+"&tbl="+tb;
	liveReqp.onreadystatechange = receivercode;
	liveReqp.open("GET", sURL);		
	liveReqp.send(null);
}

function receivercode(){
   if (liveReqp.readyState == 4) {
          
       var nummd =  document.getElementById(chng).length;	   
	   while(nummd > 1) {
		   nummd--;
		   document.getElementById(chng).options[nummd] = null;
	   }				    
	    
		var str=liveReqp.responseText;		
		var str_sr=str.split("#");
		var str_ln=str_sr.length
	
	    for (var k=0;k<str_ln-1;k++){
			 var second_sr=str_sr[k].split("/!");
			 document.getElementById(chng).options[k+1] = new Option(second_sr[0], second_sr[1]);
	    }
	}
 }
 
function expand(s, aclink, acclass){
  var td = s;
  var d = td.getElementsByTagName("div").item(0);
  if (d){
  td.className = "menuHover";
  d.className = "menuHover";
  }
  //alert(acclass);
  document.getElementById(aclink).className = acclass;
}

function collapse(s, aclink, acclass){
  var td = s;
  var d = td.getElementsByTagName("div").item(0);
  if (d){
  td.className = "menuNormal";
  d.className = "menuNormal";
  }
  document.getElementById(aclink).className = acclass;
}
