   //---validate forms
   function enqchk(){
	   
	 if (document.enq.name.value==""){ 
       alert("Please enter your Name");
       document.enq.name.focus();
       return false;
     }
	 if (document.enq.country.value==""){ 
       alert("Please enter Country");
       document.enq.country.focus();
       return false;
     }
	 if (document.enq.email.value==""){ 
       alert("Please enter your Email Address");
       document.enq.email.focus();
       return false;
     }else{
           var email=document.enq.email.value;
	       var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	        if (!filter.test(email)) {
             alert("Please enter Valid Email Address");
             document.enq.email.focus();
	         return false;
            }
      }
          
      if (document.enq.email.value != document.enq.chkemail.value){
      
        for (i=0;i<=500;i++){
         var vrfyemail = prompt("Please verify your email. \n\r>> "+email+" <<", "");       
        
            if (vrfyemail == email){
	          document.enq.chkemail.value=vrfyemail;  
	          break;  
	        } 
	            if (!vrfyemail){
                  document.enq.email.focus();
	              return false;
	              break;
		        }
       }
      }
     
	 if (document.enq.enquiry.value==""){ 
       alert("Please enter your Enquiry");
       document.enq.enquiry.focus();
       return false;
     }
	 if (document.enq.verify.value==""){ 
       alert("Please enter Verify Code!");
       document.enq.verify.focus();
       return false;
     }
     
	 if (document.enq.verify.value<1000){ 
       alert("Invalid Verify Code!");
       document.enq.verify.focus();
       return false;
     }
     
	 if (document.enq.verify.value!=document.enq.bverify.value){ 
       alert("Please enter matching Verify Code !");
       document.enq.verify.focus();
       return false;
     }     
     
   }

   //---validate online pay form
   function paychk(){	                                    
	   
	 if (document.payonline.pay_id.value==""){ 
       alert("Please enter Transaction ID!");
       document.payonline.pay_id.focus();
       return false;
     }

	 if (document.payonline.pay_email.value==""){ 
       alert("Please enter Reference Pay Email Address!");
       document.payonline.pay_email.focus();
       return false;
     }
     
   }
   	
                       
//--- Row Hide function.
function expandmore(tbodyid,dis) {
  document.getElementById(tbodyid).style.display = dis;
}   

//-- auto sug
function serchk(){
	var sch_key=document.serh.htl_search_xml.value;
	 if (sch_key=="" || sch_key=="Search by Name"){ 
       alert("Please enter Search term!");
       document.serh.htl_search_xml.focus();
       return false;
     }
     
	 if (sch_key.length < 4){ 
       alert("Minimum 4 characters required to search!");
       document.serh.htl_search_xml.focus();
       return false;
     }
}

//----- Expand and Collapse start
function caption(action,elemt){
	var long_caption = document.getElementById('long_'+elemt);
	var short_caption = document.getElementById('short_'+elemt);
	var more = document.getElementById('more_'+elemt);
	if(action=="show"){
		more.style.display = 'none';
		setOpacity(long_caption, 0);
		long_caption.style.display = '';
		fadeIn('long_'+elemt,0)
	}
	if(action=="hide"){
		fadeOut('long_'+elemt,100, 'more_'+elemt);
	}
}
//---
function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}
//-----
function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 15;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 80);
		}
	}
}
//----
function fadeOut(objId, opacity, img_id) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity >= 0) {
			setOpacity(obj, opacity);
			opacity -= 15;
			window.setTimeout("fadeOut('"+objId+"',"+opacity+", '"+img_id+"')", 80);
		}else{
			obj.style.display = 'none';
			document.getElementById(img_id).style.display = '';
		}
	}
}
//----- end Expand and Collapse


//----- Input Field Colour Change 
var gsavedOrigColor = "";

function activeInput(obj) {
	gsavedOrigColor = obj.style.backgroundColor;
	obj.style.backgroundColor="#E9F1F8";
	obj.style.border="1px solid #0396D7";
}

function inactiveInput(obj) {
	obj.style.border="1px solid #ccc";
	obj.style.backgroundColor=gsavedOrigColor;
}
//----- END Input Field Colour Change 
