 function validate_email(address) {
        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
            if(reg.test(address) == false) {
            return false;
        }
        return true;
    }

	function ajax_Request() {

		$.ajaxSetup({cache:false})
		
		var ajax_Request_URL = "http://flights.delightfultours.com/Backoffice/EmailSignUp.aspx?q=" + document.getElementById("email_signup_txt").value + "&wlid=5793";

		//MSIE need XDomainRequest.
		if ($.browser.msie && window.XDomainRequest) {
            // Use Microsoft XDR
            var xdr = new XDomainRequest();
            xdr.open("get", ajax_Request_URL);
            xdr.onload = function() {
            };
            xdr.send();
        }
		else
		{
		$.ajax({
			  url: ajax_Request_URL,
			  context: document.body,
			  type: "GET",	
			  success: function(){
					alert('Thanks');
			  }
			});
		}
	}

	function verifyEmailSignUp()
	{
		var emailSignuptxt = document.getElementById("email_signup_txt");
		
		if(trim(emailSignuptxt.value) == '')
        {
            return ShowValidationError('Please Email ID.', emailSignuptxt)
        }
		else if(validate_email(emailSignuptxt.value))
		{
			ajax_Request();
			$("Div#signUpBox").hide();
			$("Div#signUpBoxThanks").show();
		}

	}

if (window['urlPath'] != undefined)
{
//document.write(" <div style=\"margin: 0px 0px 10px 50px;\"  class=\"hideClass\"/>");
//document.write(" <img alt=\"\" src=\"" + urlPath + "images/ads/footer-ad1.jpg\" />");
//document.write("                 <img alt=\"\" src=\"" + urlPath + "images/ads/IT-Banner.png\" />");
//document.write("                 <br />");
//document.write("                 <img alt=\"\" src=\"" + urlPath + "images/ads/footer-ad3.jpg\" />");
//document.write(" </div>");

document.write(" <div id=\"signUpBox\" style=\"width:216px;height:88px;background:url('" + urlPath + "images/ads/box_ad.jpg');float:left;font-size:12px;\">");
document.write(" 					<div style=\"width:216px;height:20px;padding-top:3px;text-align:center;\"><b style=\"color:#05436a\">Sign up for FREE Newsletters</b>");
document.write(" 					</div>");
document.write(" 					<div style=\"width:216px;height:20px;text-align:center;\">Get sale fare alerts & exclusive deals");
document.write(" 					</div>");
document.write(" 					<div style=\"width:150px;text-align:center;float:left;padding-left:15px;\">");
document.write(" 						<input type=\"text\" id=\"email_signup_txt\" style=\"height:24px;width:140px;\"/ > ");
document.write(" 					</div>");
document.write(" 					<div>");
document.write(" 						<input type=\"button\" id=\"email_signup_btn\" value=\"\" onclick=\"javascript:verifyEmailSignUp();\" style=\"background: white url(" + urlPath + "images/buttons/go.jpg) no-repeat top;width: 45px;height: 30px;color:white;border:0px;cursor:pointer;\"/>");
document.write(" 					</div>");
document.write(" 				</div>");
document.write(" <div id=\"signUpBoxThanks\" style=\"display:none;width:216px;height:88px;background:url('" + urlPath + "images/ads/box_ad.jpg');float:left;font-size:12px;\">");
document.write(" 					<div style=\"width:210px;height:20px;padding-top:10px;text-align:center;\"><b  style=\"color:#f0952b \">Congratulations!</b><b style=\"color:#05436a\"> You have successfully signed up to receive exclusive deals with huge savings  directly in your inbox! </b>");
document.write(" 					</div>");
document.write(" 				</div>");
document.write(" 				<div style=\"width:216px;height:88px;background:url(\'" + urlPath + "images/ads/box_ad.jpg\');float:left;font-size:12px;\">");
document.write(" 					<div style=\"width:216px;height:20px;padding-top:3px;text-align:center;\"><b style=\"color:#05436a\">Can't find the perfect flight?</b>");
document.write(" 					</div>");
document.write(" 					<div style=\"width:216px;height:20px;text-align:center;\">Let us find it for you!");
document.write(" 					</div>");
document.write(" 					<div style=\"width:216px;text-align:center;float:left;\">");
document.write(" 						<a href=\"" + urlPath + "RequestQuote.html\"><img src=\"" + urlPath + "images/buttons/request.jpg\" style=\"padding-top:2px;\"/></a>");
document.write(" 					</div>");
document.write(" 				</div>");
document.write(" 				<div style=\"width:295px;height:88px;background:url('" + urlPath + "images/ads/IT-Banner.jpg');float:left;margin-left:10px\">");
document.write(" 				</div>");
document.write(" 				 <div class=\"clr\">");
document.write(" 	            </div>");
document.write("                 <br />");
	if(!(window.location.toString().indexOf('mode=ticket')>0))
	{
		OA_show(713);
	}
}
