
function save_captcha(obj,arg)
{
_link=document.links;

for(i=0;i<_link.length;i++)
{
	if(_link[i].className=="captcha-image") {	
		if(_link[i]!=obj) {
			_link[i].childNodes[0].style.border='1px solid #f3f3f3';
		} else {
			_link[i].childNodes[0].style.border='1px solid #000';
		}
	}
}

document.getElementById("captcha_hid").value=arg;
}

function save_captcha_contholi(obj,arg)
{
_link=document.links;

for(i=0;i<_link.length;i++)
{
	if(_link[i].className=="captcha-image_contholi") {	
		if(_link[i]!=obj) {
			_link[i].childNodes[0].style.border='1px solid #f3f3f3';
		} else {
			_link[i].childNodes[0].style.border='1px solid #000';
		}
	}
}

document.getElementById("captcha_contholi_hid").value=arg;
}




function  quickformval(thisform)
{ 


	with (thisform)
	{					
			if (emptyvalidation(fname,"Woops! You forgot to fill your Name")==false) 
			{
				fname.focus();
				return false;
			}
			
			if(email.value=="email")email.value="";		
			if (emptyvalidation(email,"Woops! You forgot to fill your Email Address")==false) 
			{				
				email.focus();
				return false;
			}
			
			if(emailvalidation(email)==false)
			{
				alert("Woops! You have entered an invalid Email Address");
				email.select();
				email.focus();
				return false;
			}		
			
			if (emptyvalidation(phone,"Woops! You forgot to fill your Phone Number")==false) 
			{
				phone.select();
				phone.focus();
				return false;
			}			
			if (emptyvalidation(comments,"Woops! You forgot to fill your Comments")==false) 
			{				
				comments.focus();
				return false;
			}
			
			 if (emptyvalidation(captcha_hid,"The symbol you selected is incorrect. Please try again.")==false) 
			{
	 
				return false;
			}
			
									
			validateCaptcha('http://www.charlotteweddinghotels.com/holiday-inn/includes/verify_captcha.php');
		
		     return false;
			
		
	}

}


<!--Ajax for checking the captcha code ends here -->
var xmlHttp

//function runAjax2(field,argurl,argVal)
function validateCaptcha(argUrl)
{
	
argVal=document.quick_contact.captcha_hid.value;	
	
//document.getElementById("check_captcha").innerHTML=" Loading...";
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url=argUrl
url=url+"?captchaVal="+argVal
url=url+"&sid="+Math.random()
//if(field=='check_captchaquickholi')
xmlHttp.onreadystatechange=check_captchaquickholi;
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function check_captchaquickholi() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
	       // alert(xmlHttp.responseText);
			if(xmlHttp.responseText=="yes")
			{
			     document.quick_contact.submit();
			}
			else
			{
				
				 alert("Incorrect Answer.Please Select the Right Symbol.");
				 captcha_refreshquickholi()
				// document.getElementById("loadimagenew").innerHTML='<div class="contact_submit"><a href="#"   onclick="return quickformval(document.quick_contact)"></a> </div>';  

				
				return false;
			}
			
	} 
} 
 /*Captch code ends here... */
 

function captcha_refreshquickholi()
{
captcha_refresh('http://www.charlotteweddinghotels.com/holiday-inn/includes/captcha_code.php');
}

var xmlHttp11

function captcha_refresh(argUrl)
{
argVal=document.quick_contact.captcha_hid.value;

//document.getElementById("check_captcha1").innerHTML=" Loading...";

xmlHttp11=GetXmlHttpObject()
if (xmlHttp11==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url=argUrl
url=url+"?sid="+Math.random()
xmlHttp11.onreadystatechange=response_refresh;
xmlHttp11.open("GET",url,true)
xmlHttp11.send(null)
}

function response_refresh() 
{ 
	if (xmlHttp11.readyState==4 || xmlHttp11.readyState=="complete")
	{ 
				
			//alert (xmlHttp.responseText);
			document.getElementById("captcha_div").innerHTML=xmlHttp11.responseText;

	} 

}



function GetXmlHttpObject()
{ 
	var objXMLHttp=null
if (window.XMLHttpRequest)
{
	objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
	return objXMLHttp
}
function  wedding_date(thisform)
{ 

	with (thisform)
	{					
			if (emptyvalidation(wed_date,"Woops! You forgot to fill Wedding Date")==false) 
			{
				wed_date.focus();
				return false;
			}	
			if (emptyvalidation(name,"Woops! You forgot to fill your Name")==false) 
			{
				name.focus();
				return false;
			}			
			
			if (emptyvalidation(email,"Woops! You forgot to fill your Email Address")==false) 
			{				
				email.focus();
				return false;
			}
			
			if(emailvalidation(email)==false)
			{
				alert("Woops! You have entered an invalid Email Address");
				email.select();
				email.focus();
				return false;
			}		
			
			if (emptyvalidation(phone,"Woops! You forgot to fill your Phone Number")==false) 
			{
				phone.select();
				phone.focus();
				return false;
			}			
			if (emptyvalidation(comments,"Woops! You forgot to fill your Comments")==false) 
			{				
				comments.focus();
				return false;
			}
			
		thisform.submit();
	}
}


function Holiday(thisform)
{ 

	with (thisform)
	{					
			if (emptyvalidation(fnameHI,"Woops! You forgot to fill your Name")==false) 
			{
				fnameHI.focus();
				return false;
			}			
				
			if (emptyvalidation(emailHI,"Woops! You forgot to fill your Email Address")==false) 
			{				
				emailHI.focus();
				return false;
			}
			
			if(emailvalidation(emailHI)==false)
			{
				alert("Woops! You have entered an invalid Email Address");
				emailHI.select();
				emailHI.focus();
				return false;
			}		
			
			if (emptyvalidation(phoneHI,"Woops! You forgot to fill your Phone Number")==false) 
			{
				phoneHI.select();
				phoneHI.focus();
				return false;
			}			
			if (emptyvalidation(commentsHI,"Woops! You forgot to fill your Comments")==false) 
			{				
				commentsHI.focus();
				return false;
			}
			
			if (emptyvalidation(captcha_contholi_hid,"The symbol you selected is incorrect. Please try again.")==false) 
			{
	 
				return false;
			}
			
									
			validateCaptcha2('http://www.charlotteweddinghotels.com/holiday-inn/includes/verify_captcha_contholi.php');
		
		     return false;
		
	}
		

}
 /*Captch code starts here... */

<!--Ajax for checking the captcha code ends here -->
var xmlHttp2
function validateCaptcha2(argUrl)
{
	
argVal=document.holidayform.captcha_contholi_hid.value;	

xmlHttp2=GetXmlHttpObject()
if (xmlHttp2==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url=argUrl
url=url+"?captchaValHoli="+argVal
url=url+"&sid="+Math.random()
//alert(url);
//if(field=='check_captchaholi')
xmlHttp2.onreadystatechange=check_captcha_contholi;
xmlHttp2.open("GET",url,true)
xmlHttp2.send(null)
}
function check_captcha_contholi() 
{ 
	if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
	{ 
	        //alert(xmlHttp2.responseText);
			if(xmlHttp2.responseText=="yes")
			{
			     document.holidayform.submit();
			}
			else
			{
				
				 alert("Incorrect Answer.Please Select the Right Symbol.");
				 captcha_refreshhli()
				 
				//document.getElementById("loadimagenew_contholi").innerHTML='<a href="#" class="contact_submit1" onclick="return Holiday(document.holidayform)" style="float:right;">Submit</a>';  

				
				return false;
				
			}
			
	} 
} 

function captcha_refreshhli()
{
captcha_refresh_contholi('http://www.charlotteweddinghotels.com/holiday-inn/includes/captcha_code_contholi.php');
}

var xmlHttp12

function captcha_refresh_contholi(argUrl)
{
argVal=document.holidayform.captcha_contholi_hid.value;

//document.getElementById("check_captcha1").innerHTML=" Loading...";

xmlHttp12=GetXmlHttpObject()
if (xmlHttp12==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url=argUrl
url=url+"?sid="+Math.random()
xmlHttp12.onreadystatechange=response_refresh_contholi;
xmlHttp12.open("GET",url,true)
xmlHttp12.send(null)
}

function response_refresh_contholi() 
{ 
	if (xmlHttp12.readyState==4 || xmlHttp12.readyState=="complete")
	{ 
				
			//alert (xmlHttp.responseText);
			document.getElementById("captcha_div_contholi").innerHTML=xmlHttp12.responseText;

	} 

}



 /*Captch code ends here... */
 
function  gettingStarted(thisform)
{ 

	with (thisform)
	{					
			if (emptyvalidation(fname2,"Woops! You forgot to fill your Name")==false) 
			{
				fname2.focus();
				return false;
			}			
			if (emptyvalidation(phone2,"Woops! You forgot to fill your Phone Number")==false) 
			{
				phone2.select();
				phone2.focus();
				return false;
			}			
			if (emptyvalidation(email2,"Woops! You forgot to fill your Email Address")==false) 
			{				
				email2.focus();
				return false;
			}
			
			if(emailvalidation(email2)==false)
			{
				alert("Woops! You have entered an invalid Email Address");
				email2.select();
				email2.focus();
				return false;
			}		
			if (emptyvalidation(weddate,"Woops! You forgot to select your wedding date")==false) 
			{
				weddate.select();
				weddate.focus();
				return false;
			}	
			if (emptyvalidation(guest,"Woops! You forgot to fill number of guests")==false) 
			{
				guest.select();
				guest.focus();
				return false;
			}		
			if (emptyvalidation(comments2,"Woops! You forgot to fill your Comments")==false) 
			{				
				comments2.focus();
				return false;
			}
			
		thisform.submit();
	}
}
