// 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.name,1,"Please enter your Name")){
			 return false;
		 }
		 
		if(!validate_email(document.con_ff.email,1,"Please enter your Email")){
			 return false;
		 } 
		 
		if(!validate_text(document.con_ff.phone,1,"Please enter your Phone Number")){
			 return false;
		 }
		 
		if(!validate_text(document.con_ff.mess,1,"Please enter your Message")){
			 return false;
		 }  
  
     return true;  
}

function log_check(){
	if(!validate_text(document.log_ff.t2,1,"Please enter Password")){
	  return false;
    }
	
	return true;
}

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 frontopenclose(ifire){
 dvn = "frontoption"+ifire;
 dvimg = "catimg"+ifire; 
 if (document.getElementById(dvn).style.visibility == "visible"){  
   Hide_MQ(dvn);
   document.images[dvimg].src = "images/plus.jpg";   
 }else{   
   Show_MQ(dvn);     
   document.images[dvimg].src = "images/minus.jpg";   
 } 
}
