function validation(frmenquiry)
		{
			
			if(frmenquiry.name.value=="")
			{
			alert("Person Name is Required");
			frmenquiry.name.focus();
			return false;
			}

			if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frmenquiry.email.value)))
			{
			alert("Valid Email Address! Required")
			frmenquiry.email.focus();
			return false;
			}
			
			

			if(document.frmenquiry.phone.value == "")
			{
			alert("Phone Number is Required")
			document.frmenquiry.phone.focus();
			return false;
			}
			
 
			if (document.frmenquiry.country.value == "" )
        	{
             alert("Country is Required")
			 frmenquiry.country.focus();
			 return false;
        	}
			
			 if (frmenquiry.typesofhotel.selectedIndex < 1 )
        	{
             alert("Select your Hotel")
			 frmenquiry.typesofhotel.focus();
			 return false;
        	}
			if(document.frmenquiry.monthoftravel.value== "")
			{
			alert("Travel Month is Required ");
			frmenquiry.monthoftravel.focus();
			return false;
			}	
			if(frmenquiry.durationofvisit.value=="")
			{
			alert("Duration of Visit is Required");
			frmenquiry.durationofvisit.focus();
			return false;
			}	
			
			if(document.frmenquiry.people.value == "")
			{
			alert("No. of People is Required ");
			frmenquiry.people.focus();
			return false;
			}

        
			if(document.frmenquiry.budgetperday.value == "")
			{
			alert("Budget Per Day is Required ");
			frmenquiry.budgetperday.focus();
			return false;
			}			

			

 var captcha_txt = document.getElementsByName("captchacode");
        var captcha_txt_len = captcha_txt.length;
        if(captcha_txt_len == 1)
           {
              if (document.frmenquiry.captchacode.value.length == 0)  
			  		{
                       alert ("Kindly enter the code as appearing in the Image.");
                       document.frmenquiry.captchacode.focus();
                       return false;
                     }
            }
                newCookie = document.frmenquiry.txtname.value;
                newCookie +="|"+document.frmenquiry.txtemail.value;
				newCookie +="|"+document.frmenquiry.txtphone.value;
                setCookie("newImeshID",newCookie);
                return true;
        }
        
        function get()
        {
                var captcha_txt = document.getElementsByName("captchacode");
                var captcha_txt_len = captcha_txt.length;
                
        
        
                if( (cookie = getCookie("newImeshID")) > "")
                {
                        Values = cookie.split("|");
                        if (Values.length >= 7)
                        {
                                if (document.frmenquiry.txtname.value.length == 0) document.frmenquiry.txtname.value = Values[0];
                                if (document.frmenquiry.txtemail.value.length == 0)    document.frmenquiry.txtemail.value = Values[1];
                                if (document.frmenquiry.txtphone.value.length == 0) document.frmenquiry.txtphone.value = Values[2];
                        }
                }
                return true;
        }
        
        function setCookie(name, value)
        {
                if (value.length > 0)
                document.cookie = name + "=" + escape(value)+ ";"+"expires=" + expires.toGMTString()+";"
        }
        
        function getCookie(Name) 
        {
                var search = Name + "="
                if (document.cookie.length > 0) 
                { 
                        offset = document.cookie.indexOf(search)
                        if (offset != -1) 
                        { // if cookie exists
                                offset += search.length // set index of beginning of value
                                end = document.cookie.indexOf(";", offset) // set index of end of cookie value
                                if (end == -1) end = document.cookie.length
                                return unescape(document.cookie.substring(offset, end))
                        }
                }
        return "";
        }
        

       	var is_input = document.URL.indexOf('?');
        var pcode = '';
        var pname = '';

        if (is_input != -1)
        {
                addr_str = document.URL.substring(is_input+1, document.URL.length);
                strarr = addr_str.split("&");
		pname = unescape((strarr[0].split("="))[1]);
		pname = pname.replace(/\+/g," ");
		if(strarr[1])
		{
			pcode_name = unescape((strarr[1].split("="))[0]);
			pcode_value = unescape((strarr[1].split("="))[1]);
		}
		else
		{
			pcode_name = '';
			pcode_value = '';
		}
        }

/*----For Description Text Status----*/

var fieldlimiter={

defaultoutput: "<b>[int]</b> characters remaining in your input limit.", //default message that gets output to statusid element

uncheckedkeycodes: /(8)|(13)|(16)|(17)|(18)/, //keycodes that are not checked, even when limit has been reached. See http://www.javascriptkit.com/jsref/eventkeyboardmouse.shtml for avail keycodes

limitinput:function(e, config){
	var e=window.event || e
	var thefield=config.thefield
	var keyunicode=e.charCode || e.keyCode
	if (!this.uncheckedkeycodes.test(keyunicode)){
		if (thefield.value.length>=config.maxlength){
			if (e.preventDefault)
				e.preventDefault()
			return false
		}
	}
},

showlimit:function(config){
	var thefield=config.thefield
	var statusids=config.statusids
	var charsleft=config.maxlength-thefield.value.length
	if (charsleft<0) //if user has exceeded input limit (possible if cut and paste text into field)
		thefield.value=thefield.value.substring(0, config.maxlength) //trim input
	for (var i=0; i<statusids.length; i++){
		var statusdiv=document.getElementById(statusids[i])
		if (statusdiv) //if status DIV defined
			statusdiv.innerHTML=this.defaultoutput.replace("[int]", Math.max(0, charsleft))
	}
	config.onkeypress.call(thefield, config.maxlength, thefield.value.length)
},

cleanup:function(config){
	for (var prop in config){
		config[prop]=null
	}
},


addEvent:function(targetarr, functionref, tasktype){
	if (targetarr.length>0){
		var target=targetarr.shift()
		if (target.addEventListener)
			target.addEventListener(tasktype, functionref, false)
		else if (target.attachEvent)
			target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)})
		this.addEvent(targetarr, functionref, tasktype)
	}
},

setup:function(config){
	if (config.thefield){ //if form field exists
		config.onkeypress=config.onkeypress || function(){}
		config.thefield.value=config.thefield.value
		this.showlimit(config)
		this.addEvent([window], function(e){fieldlimiter.showlimit(config)}, "load")
		this.addEvent([window], function(e){fieldlimiter.cleanup(config)}, "unload")		
		this.addEvent([config.thefield], function(e){return fieldlimiter.limitinput(e, config)}, "keypress")
		this.addEvent([config.thefield], function(){fieldlimiter.showlimit(config)}, "keyup")
	}
}

}


