//if (document.getElementById && document.getElementsByTagName) {
//	if (window.addEventListener) window.addEventListener('load', checkPNGs, false);
//	else if (window.attachEvent) window.attachEvent('onload', checkPNGs);
//}
//
//function checkPNGs() {
//	var browser=navigator.appName;
//	var b_version=navigator.appVersion;
//	var browserNAME = "";
//	var browserVERSION = "";
//	var start = b_version.search(/\(/);
//	var b_info = b_version.substring(start+1);
//	var arr_b_info = b_info.split(';');
//	for(var i=0; i<arr_b_info.length; i++) {
//		if(arr_b_info[i].search(/MSIE/) >= 0) {
//			browserNAME = "MSIE";
//			browserVERSION=parseFloat(arr_b_info[i].replace('MSIE ', ''));
//			break;
//		}
//	}
//	
//	//var version=parseFloat(b_version);
//	if (browserNAME == "MSIE" && browserVERSION <= 6) {
//		imgs = document.getElementsByTagName('img');
//		for(var i=0; i<imgs.length; i++) {
//			if(imgs[i].src.search(/\.png/gi) >= 0) {
//				imgsrc = imgs[i].src;
//				imgs[i].src = imgsrc.replace(/\.png/, '.gif');
//				imgs[i].onerror = img_onError;
//			}
//		}
//	}
//}


function img_onError() { 
	this.src = this.src.replace(/\.gif/, '.png');
}

function showlayers(parentid, layer, indicator, replacement) {
	toggleparent = document.getElementById(parentid);
	for(var i=0; i<toggleparent.childNodes.length; i++) {
		if(toggleparent.childNodes[i].className && toggleparent.childNodes[i].className.search(/toggleitem/i) != -1) {
			if(toggleparent.childNodes[i].id == layer) {
				toggleparent.childNodes[i].style.display = "block";
				thisbtn = document.getElementById(layer + "btn");
				switch(indicator) {
                    case 'src':
                        thisbtn.src = thisbtn.src.replace(/_off./gi, '_on.');
                        break;
                    case 'display':
                        thisbtn.style.display = "none";
						
						if (replacement != "")
						{
							replacementbtn = document.getElementById(replacement + "btn");
							
							if ( thisbtn.className = 'mapbtn')
							{
								$(".hideMapBtn").css("display", "block");
								$(".hideMapBtn").css("height", "56px");
								$(".hideMapBtn").css("width", "auto");
								$(".hideMapBtn").css("top", "10px");
							}else{
								replacementbtn.style.display = "block";
							}
						}
                        break;
                    case 'class':
                        thisbtn.className = "on";
                        break;
                    default:
                        // No indicator required
                }
			} else {
				toggleparent.childNodes[i].style.display = "none";
				thisbtn = document.getElementById(toggleparent.childNodes[i].id + "btn");
				switch(indicator) {
                    case 'src':
                        thisbtn.src = thisbtn.src.replace(/_on./gi, '_off.');
                        break;
                    case 'display':
						if (replacement != "")
						{
							thisbtn.style.display = "none";
							originalbtn = document.getElementById(layer + "btn");
							originalbtn.style.display = "none";
							replacementbtn = document.getElementById(replacement + "btn");
							replacementbtn.style.display = "block";
						}
						else
						{
							thisbtn.style.display = "block";
						}
                        break;
                    case 'class':
                        thisbtn.className = "";
                        break;
                    default:
                        // No indicator required
                }
			}
		}
	}
	
	placesBtn = document.getElementById('placesbtn');
	if (placesBtn != null)
	{
		placesBtn.className = "";	
	}
	
	if (layer == 'map'){
		var usaElement = document.getElementById("usamap");
		if (usaElement != null){
			document.getElementById('usamap').style.display = "block";
		}
		initialize('canvas_map');
		
	}else {
		var usaElement = document.getElementById("usamap");
		if (usaElement != null){
			document.getElementById('usamap').style.display = "none";
		}
	}
}

function toggleRegionalSubSubNav (sectionid, navelementid, parentelementid)
{
	navparent = document.getElementById('subnav');
	for(var i=0; i<navparent.childNodes.length; i++)
	{
		if (navparent.childNodes[i].id == navelementid)
		{
			navparent.childNodes[i].className = "subitemon";
			document.getElementById(parentelementid).className = "on";
		}
		else
		{
			if (navparent.childNodes[i].id != parentelementid)
			{
				navparent.childNodes[i].className = "";	
			}
		}
	}
	
	toggleparent = document.getElementById('togglewrap');
	for(var i=0; i<toggleparent.childNodes.length; i++) 
	{
		if(toggleparent.childNodes[i].className && toggleparent.childNodes[i].className.search(/toggleitem/i) != -1) 
		{
			if(toggleparent.childNodes[i].id == sectionid) 
			{
				toggleparent.childNodes[i].style.display = "block";
			} 
			else 
			{
				toggleparent.childNodes[i].style.display = "none";
			}
		}
	}
}

function flowplayerTabs(parentid, layer, indicator) {
	toggleparent = document.getElementById(parentid);
	for(var i=0; i<toggleparent.childNodes.length; i++) {
		if(toggleparent.childNodes[i].className && toggleparent.childNodes[i].className.search(/toggleitem/i) != -1) {
			if(toggleparent.childNodes[i].id == layer) {
				if(toggleparent.childNodes[i].style.display != "block")
				{
					toggleparent.childNodes[i].style.display = "block";	
				}
				toggleparent.childNodes[i].style.visibility = "visible";
				toggleparent.childNodes[i].style.zIndex = "99";
				thisbtn = document.getElementById(layer + "btn");
				switch(indicator) {
                    case 'src':
                        thisbtn.src = thisbtn.src.replace(/_off./gi, '_on.');
                        break;
                    case 'display':
                        thisbtn.style.display = "none";
                        break;
                    case 'class':
                        thisbtn.className = "on";
                        break;
                    default:
                        // No indicator required
                }
			} else {
				if(toggleparent.childNodes[i].style.display != "block")
				{
					toggleparent.childNodes[i].style.display = "block";	
				}
				toggleparent.childNodes[i].style.visibility = "hidden";
				toggleparent.childNodes[i].style.zIndex = "0";
				thisbtn = document.getElementById(toggleparent.childNodes[i].id + "btn");
				switch(indicator) {
                    case 'src':
                        thisbtn.src = thisbtn.src.replace(/_on./gi, '_off.');
                        break;
                    case 'display':
                        thisbtn.style.display = "block";
                        break;
                    case 'class':
                        thisbtn.className = "";
                        break;
                    default:
                        // No indicator required
                }
			}
		}
	}
}

function showsinglelayer(layer) {
	if(document.getElementById(layer).style.display == 'block') {
		hidesinglelayer(layer);
	}	else {
		//$('#' + layer).fadeIn('slow');
		document.getElementById(layer).style.display = 'block';
	}
}

function hidesinglelayer(layer) {
	//$('#' + layer).fadeOut('slow');
	document.getElementById(layer).style.display = 'none';
}

function showAllAnswers(parentid) {
	$('#' + parentid + ' .link_white').each(function() {
		if($(this).hasClass("faqAlternate")) {
			$('#' + parentid + ' .toggleitem').each(function() {$(this).fadeIn('slow');});
			$(this).removeClass("faqAlternate");
		} else {
			$('#' + parentid + ' .toggleitem').each(function() {$(this).fadeOut('slow');});
			$(this).addClass("faqAlternate");
		}
	});
}

function pleasewait(layer) {
	bodytext = document.body;
	headerwrapperdiv = document.getElementById('headerwrapper');
	contentfooterdiv = document.getElementById('contentfooter');
	pageheight = headerwrapperdiv.scrollHeight + contentfooterdiv.scrollHeight;
	
	if(document.getElementById('overlay') == null) {
		overlaydiv = document.createElement("div");
		overlaydiv.setAttribute('id', 'overlay');
		
		alertdiv = document.createElement("div");
		alertdiv.setAttribute('id', 'alert');
		alertdiv.innerHTML = "<iframe id='alertiframe' frameborder='0'></iframe><div id='alertoveriframe'><div id='alerttext'></div></div>";
	}
	
	if(typeof(window.pageYOffset) == "undefined") {
		scrollpos = document.documentElement.scrollTop;
	} else {
		scrollpos = window.pageYOffset;
	}
	scrollpos = scrollpos - 100;

	overlaydiv.setAttribute('style', 'height:'+pageheight+'px');
	overlaydiv.style.cssText = 'height:'+pageheight+'px';
	alertdiv.setAttribute('style', 'margin-top:'+scrollpos+'px');
	alertdiv.style.cssText = 'margin-top:'+scrollpos+'px';
	
	bodytext.appendChild(overlaydiv); 
	bodytext.appendChild(alertdiv); 
	
	pleasewaiticondiv = document.getElementById('pleasewaiticon');
	pleasewaiticondiv.innerHTML = '<img src="images/ajax-loader.gif" border="0" alt="Please Wait" />';
	
	alerttextdiv = document.getElementById('alerttext');
	alerttextdiv.innerHTML = document.getElementById(layer).innerHTML;
	
}

function hidepleasewait()
{
	try {
		hidesinglelayer('overlay');
		hidesinglelayer('alert');
	} catch(err) {
		
	}
}

function hidelightbox(){
	removeElement('overlay');
	removeElement('alert');
}

function removeElement(id) {
	document.getElementById(id).parentNode.removeChild(document.getElementById(id));
}

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}

function preloadSlides(div) {
	var imgsrcarray = document.getElementById(div).getElementsByTagName('img');
	var imgarray = new Array();
	for(i = 0;i < imgsrcarray.length;++ i){
		imgarray[i] = new Image();
		imgarray[i].src = imgsrcarray[i].src;
		imgarray[i].alt = imgsrcarray[i].alt;
	}
	return imgarray;
}


function popupvideo(src,width,height) {
	
	src = src.replace('&amp;', '%26');
	src = src.replace('&', '%26');
	var changeinnerhtml = true;
	var closeheight = 29;

	htmlwidth = width;
	htmlheight = closeheight + height;
	htmlmargintop = htmlheight;
	htmlmarginleft = '-'+eval(htmlwidth/2);
	alttext = '';
	htmltext = "<a href='"+src+"' id='player' title='"+alttext+"' style='padding:0px;'></a>";

	bodytext = document.body; //document.documentElement?
	
	//get overall height of page
	headerwrapperdiv = document.getElementById('headerwrapper');
	contentfooterdiv = document.getElementById('contentfooter');
	pageheight = headerwrapperdiv.scrollHeight + contentfooterdiv.scrollHeight;
	
	// has this already been instantiated
	if(document.getElementById('overlay') == null) {
		//blue background
		overlaydiv = document.createElement("div");
		overlaydiv.setAttribute('id', 'overlay');
		overlaydiv.setAttribute('style', 'height:'+pageheight+'px');
		overlaydiv.onclick = function(){hidelightbox();return false;};
		overlaydiv.style.cssText = 'height:'+pageheight+'px';
		
		//box that shows the content
		alertdiv = document.createElement("div");
		alertdiv.setAttribute('id', 'alert');
				
		//append the new layers to the DOM
		bodytext.appendChild(overlaydiv); 
		bodytext.appendChild(alertdiv);
	}

	//has the user scrolled? if yes then change the position of the box
	if(typeof(window.pageYOffset) == "undefined") {
		scrollpos = document.documentElement.scrollTop;
	} else {
		scrollpos = window.pageYOffset;
	}
	scrollpos = scrollpos - eval(htmlheight/2);

	//Position the new layers
	alertdiv1 = document.getElementById('alert');
	alertdiv1.style.height = htmlheight+'px';
	alertdiv1.style.width = htmlwidth+'px';
	alertdiv1.style.margin = scrollpos+'px 0px 0px '+htmlmarginleft+'px';

	//create the html
	alertdiv.innerHTML = '<iframe id="alertiframe" frameborder="0" width="'+htmlwidth+'" height="'+htmlheight+'"></iframe><div id="alertoveriframe"><div id="alerttext"></div><div id="closebar"><a href="javascript:hidelightbox();"><img src="../../images/lightbox/lightbox-btn-close.gif"></a></div></div>';

	alertoveriframediv = document.getElementById('alertoveriframe');
	alertoveriframediv.style.width = htmlwidth+"px";
	alertoveriframediv.style.height = height+"px";
	
	alerttextdiv = document.getElementById('alerttext');
	alerttextdiv.innerHTML = htmltext;
	
	// trigger flowplayer
	var player1 = flowplayer("player", {src: "../../images/flash/flowplayer-3.1.5.swf", wmode: 'opaque'}).ipad();
	document.getElementById('player').style.height = height + "px";
	document.getElementById('player').style.width = width + "px";
	document.getElementById('player').style.position = "absolute";
	document.getElementById('player').style.top = "0px";
	document.getElementById('player').style.left = "0px";
	player1.play();

}

function loadFlash() {

	if(mode.toLowerCase() == "on") { //we are on the secure server
		var serve = "https";
	} else {
		var serve = "http";
	}
	if(typeof flashVars == 'undefined') {
		flashVars = ""
	}
	if(typeof cssclass == 'undefined') {
		cssclass = "";
	}
	
	var oeTags = 
	'<object id="'+movie+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" class="'+cssclass+'" codebase='+serve+'"://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="'+movie+'" align="middle">'
	+ '<param name="allowScriptAccess" value="sameDomain" />'
	+ '<param name="movie" value="'+pathToMovie+''+movie+'.swf'+mvParams+'" />'
	+ '<param name="quality" value="high" />'
	+ '<param name="wmode" value="'+wmode+'" />'
	+ '<param name="bgcolor" value="'+bgcolor+'" />'
	+ '<param name="flashvars" value="'+flashVars+'">'
	+ '<embed src="'+pathToMovie+''+movie+'.swf'+mvParams+'" quality="high" wmode="transparent" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+movie+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashVars+'" />'
	+ '<\/object>';
	
	if (blnFlash)
	{
	document.write(oeTags); // embed the flash movie
	}
	else
	{
		if(typeof hidelayer !== 'undefined') {
				document.getElementById(hidelayer).style.display = "none";
		} else if (typeof nonmovie !== 'undefined' || typeof nonmovielink !== 'undefined' || typeof nonmoviealt !== 'undefined' || typeof pathToNonMovie !== 'undefined') {
			if (typeof noMap !== 'undefined' && noMap !== "") {
				document.write('<img src="'+pathToNonMovie+''+nonmovie+'" alt="'+nonmoviealt+'" usemap="'+noMap+'" />');
			} else if(nonmovie !== '') {
				document.write('<img src="'+pathToNonMovie+''+nonmovie+'" alt="'+nonmoviealt+'" />');
			}
		}
	}

}

// Show and/or hide tabbed articles

function toggleArticleTab(selectedID, tabID)
{
	var i = 0, keepGoing = 1;
	
	while (keepGoing == 1)
	{
		var toTestId = "tabbedArticle" + i;
		
		if (document.getElementById(toTestId))
		{
			if (document.getElementById(toTestId).className == "boxmain")
			{
				document.getElementById(toTestId).className = "boxmain hiddenArticle";
			}
		}
		else
		{
			keepGoing = 0;	
		}
		
		i = i + 1;
	}
	
	keepGoing = 1;
	i = 0;
	
	while (keepGoing == 1)
	{
		var toTestId = "articleTab" + i;
		
		if (document.getElementById(toTestId))
		{
			if (document.getElementById(toTestId).className == "selectedArticleTab")
			{
				document.getElementById(toTestId).className = "unselectedArticleTab";
			}
		}
		else
		{
			keepGoing = 0;	
		}
		
		i = i + 1;
	}
	
	document.getElementById(selectedID).className = "boxmain";
	document.getElementById(tabID).className = "selectedArticleTab";
}

function showShortIcons()
{
	document.getElementById("fullIcons").className = "hiddenContainer";
	document.getElementById("shortIcons").className = "";
}

function showFullIcons()
{
	document.getElementById("shortIcons").className = "hiddenContainer";
	document.getElementById("fullIcons").className = "";
}

function triggerReSearch(fieldID)
{
	var searchURL = "search.html?q=" + escape(document.getElementById(fieldID).value);
	window.location = searchURL;
}

function showPlacesSubNav()
{
	if (document.getElementById("sightseeingbtn"))
	{
		document.getElementById("sightseeingbtn").className = "";
	}
	if (document.getElementById("attractionsbtn"))
	{
		document.getElementById("attractionsbtn").className = "";
	}
	if (document.getElementById("diningoutbtn"))
	{
		document.getElementById("diningoutbtn").className = "";
	}
}

function hidePlacesSubNav()
{
	if (document.getElementById("sightseeingbtn"))
	{
		document.getElementById("sightseeingbtn").className = "hiddenContainer";
	}
	if (document.getElementById("attractionsbtn"))
	{
		document.getElementById("attractionsbtn").className = "hiddenContainer";
	}
	if (document.getElementById("diningoutbtn"))
	{
		document.getElementById("diningoutbtn").className = "hiddenContainer";
	}
	
	if (!(document.getElementById("sightseeingbtn")) && !(document.getElementById("attractionsbtn")) && !(document.getElementById("diningoutbtn")))
	{
		document.getElementById("placesbtn").className = "hiddenContainer";
	}
}

function setRatingWidth(customerrating)
{
	var calculatedWidth = 0;
	
	if (customerrating.indexOf(".") != -1)
	{
		var custRatingSplit = customerrating.split('.');
		
		calculatedWidth = custRatingSplit[0] * 28;
		calculatedWidth = calculatedWidth + (custRatingSplit[1] * 2);
		calculatedWidth = calculatedWidth + 4;
	}
	else
	{
		calculatedWidth = customerrating * 28;
	}
	
	var calculatedMargin = 141 - calculatedWidth;
	
	document.getElementById("ratingFiller").style.width = calculatedWidth + "px";
	document.getElementById("ratingFiller").style.marginRight = calculatedMargin + "px";
}

/*Javascript functions for the EMail newsletter signup on the Home page and  overlay - 6 Dec 11 VA */

function popupForm(titleText, descrText, successText, duplicateText, failedText, urlText, urlLinkText) {
	bodytext = document.body;
	// has this already been instantiated
	if(document.getElementById('overlay') == null) {
		//blue background
		overlaydiv = document.createElement("div");
		overlaydiv.setAttribute('id', 'overlaySignUp');
		overlaydiv.setAttribute('class', 'overlaySignUp');
	    //append the new layers to the DOM
	    bodytext.appendChild(overlaydiv); 
	 }
	//create the html
	var htmlDiv = '<div id="continueblock" class="continueBlock" style="display: block;">';
	var htmlDiv = '<div id="continueblock" class="continueBlock" style="display: block;">';
	htmlDiv += '<div class="closebar"><a href="javascript:hideOverlayForm();"><img src="'+ ('https:' == document.location.protocol ? '../' : '/') + 'images/headers/kc_close_butn.gif" alt="Close signup" /></a></div>';
	htmlDiv += '<h1>'+ titleText +'</h1>'
	htmlDiv += '<div id="signupText" class="wrapPg"><p>' + descrText 
	htmlDiv += '  <a href="'+urlText+'">'+urlLinkText+'</a>';
	htmlDiv += '</p></div>'
	htmlDiv += '<div class="signUpForm"><input type="text" id="txtEmail" class="txtSignUp" /><a href="javascript:parseSignUp(\''+successText+'\',\''+duplicateText+'\',\''+failedText+'\');"><img src="'+ ('https:' == document.location.protocol ? '../' : '/') + 'images/headers/kc_signup_butn.png" alt="Sign up to newsletter" id="btnSubmit" class="imgMail" /></a></div></div>';
	overlaydiv.innerHTML = htmlDiv;
	
	

}
        
        
function hideOverlayForm(){
	$('#continueblock').empty();            
    $('#overlaySignUp').empty();
    $('#continueblock').remove();            
    $('#overlaySignUp').remove();
}

function parseSignUp(successText, duplicateText, failedText){
	var email = '';
    email = $("#txtEmail").val();
    var theMessage = ""; 
    if (!IsValidEmail(email)){
    	alert("Invalid email address, please try again");
    } else{
		var siteStructure = '';
        siteStructure = getValidPartOfURL();
	    $("#txtEmail").remove(); 
        $("#btnSubmit").remove(); 
		 var jsonURLTop = "https://www.secure-hb.com/keycamp-"+siteStructure+"/forms/WebSignUp.ashx?var="+email+"&callback=?";
		 //var jsonURLTop = "https://staging-secure/keycamp-"+siteStructure+"/forms/WebSignUp.ashx?var="+email+"&callback=?";
		 $.getJSON(jsonURLTop,function(data){
         	theData = data.returns.toString();
            if (theData == '1'){ messageLabel = duplicateText; }
		    if (theData == '0'){ messageLabel = successText; }
		    if (theData == '2'){ messageLabel = failedText; }                     
            $("#signupText").html("<p>"+messageLabel+"</p>");            
	 	});
    }

}
function parseSignUpHome(successText, duplicateText, failedText){
	var emailHome = '';
    emailHome = $("#txtEmailHome").val();
    if (!IsValidEmail(emailHome)){
    	alert("Invalid email address, please try again");
    } else{
		var siteStructure = '';
        siteStructure = getValidPartOfURL();

	    $("#txtEmailHome").remove(); 
        $("#btnSubmitHome").remove(); 
		// var jsonURL = "https://staging-secure/keycamp-"+siteStructure+"/forms/WebSignUp.ashx?var="+emailHome+"&callback=?";
		 var jsonURL = "https://www.secure-hb.com/keycamp-"+siteStructure+"/forms/WebSignUp.ashx?var="+emailHome+"&callback=?";
		 $.getJSON(jsonURL,function(dataHome){
         	theHomeData = dataHome.returns.toString();
            if (theHomeData == '1'){ messageLabelHome = duplicateText; }
            if (theHomeData == '0'){ messageLabelHome = successText; }
            if (theHomeData == '2'){ messageLabelHome = failedText; }
			document.getElementById('signupTextHome').style.width = "60%";
            $("#signupTextHome").html("<p>"+messageLabelHome+"</p>");       
	 	});

    }
}
function getValidPartOfURL()
{
	var isSecure =  ('https:' == document.location.protocol ?  'y' : 'n' );
	var theDomain = document.location.protocol + '//' + window.location.hostname;
	var url = new String(theDomain);
	var lnth = url.length - 2;
	var siteStructure = '';
	var theprefix = '';
	if ( isSecure == 'y' ){
		//lnth = 		
		url = new String(window.location.pathname);
		var positionIdentifier = url.indexOf("-",0);
		theprefix = url.substring(positionIdentifier + 1, positionIdentifier +3);
		
	}else {
		theprefix = url.substring(lnth);
	}
		switch (theprefix) {
        	case 'ie':
            	siteStructure = 'ie';
                break;
 	       default: 
    	   siteStructure = 'uk';
       }   
	return siteStructure
	/*var theDomain = 'http://' + window.location.hostname;
    var siteStructure = '';
	var theprefix = '';
	var url = new String(theDomain);
	var lnth = url.length - 2;
	theprefix = url.substring(lnth);
		switch (theprefix) {
        	case 'ie':
            	siteStructure = 'ie';
                break;
 	       default: 
    	   siteStructure = 'uk';
       }   
	return siteStructure*/
}
function IsValidEmail(email)
{
 	var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
    return filter.test(email);
}


function SetTheOnClickValidators(theMessage, description,success, duplicate, failed, urlText, urlLinkText){
	
	 $('#emailHeadFunction').attr('href', "javascript:popupForm('"+theMessage+"','"+description+"','"+success+"','"+duplicate+"','"+failed+"','"+urlText+"','"+urlLinkText+"');" );
	/* $('#emailHeadFunction').attr('onClick', "javascript:popupForm('"+theMessage+"','"+description+"','"+success+"','"+duplicate+"','"+failed+"','"+urlText+"','"+urlLinkText+"');return false;" );*/
	 $('#emailHeadFunction').attr('onKeyPress', "javascript:popupForm('"+theMessage+"','"+description+"','"+success+"','"+duplicate+"','"+failed+"','"+urlText+"','"+urlLinkText+"');return false;" );
	 $('#emailHeadFunction').attr('class', "email" );
	 $('#emailHeadFunction').click(function() {
		popupForm(theMessage, description, success, duplicate, failed, urlText, urlLinkText);
		return false;
	});

}/* End Email newsletter sign up */


function showSignup() {
	if($('a#emailHeadFunction').length && $('.showSignup').length) {
		$('.showSignup').click(function(){
			$('a#emailHeadFunction').trigger('click');
			$('html, body').animate({scrollTop:0}, 'fast');
		});	
	}
}

$(document).ready(function() {

	showSignup();

});
