//http://www.citigatehudson.com

if(document.getElementById){
	gvArrImages = new Array();
	gvArrImages['menu01_off'] = "images/subnav/exec_dash_off.gif"

	gvArrImages[1] = "images/subnav/specialists_on.gif"
	gvArrImages[2] = "images/subnav/services_off.gif"
	gvArrImages[3] = "images/subnav/services_on.gif"
	gvArrImages[4] = "images/subnav/market_research_off.gif"
	gvArrImages[5] = "images/subnav/market_research_on.gif"

	gvArrImages[6] = "images/subsubnav/partnerships_off.gif"
	gvArrImages[7] = "images/subsubnav/partnerships_on.gif"
	gvArrImages[8] = "images/subsubnav/core_off.gif"
	gvArrImages[9] = "images/subsubnav/core_on.gif"
	gvArrImages[10] = "images/subsubnav/products_off.gif"
	gvArrImages[11] = "images/subsubnav/products_on.gif"
	gvArrImages[12] = "images/subsubnav/integrated_on.gif"
	gvArrImages[13] = "images/subsubnav/integrated_on.gif"

	gvArrImages[14] = "images/menuitems/retail_off.gif"
	gvArrImages[15] = "images/menuitems/retail_on.gif"
	gvArrImages[16] = "images/menuitems/tourism_off.gif"
	gvArrImages[17] = "images/menuitems/tourism_on.gif"
	gvArrImages[18] = "images/menuitems/public_off.gif"
	gvArrImages[19] = "images/menuitems/public_on.gif"

	im = new Array();
	for (var i = 0; i < gvArrImages.length; i++)
	{
		im[i] = new Image();
		im[i].src = gvArrImages[i];
		//alert(gvArrImages[i]);
	}
}//else{'Not W3C dom compatible');}


var gvStrImageRoot = '../images/subnav/';


function toggle(pcObjAnchor, pcStrImageID)
{
	lvObjImage = document.getElementById(pcStrImageID);
	lvStrImageSrc = lvObjImage.src;
	lvStrImageTest = pcStrImageID+'_off.gif';
	//alert('Search is '+lvStrImageTest);
	//alert('Img src is '+lvObjImage.src);
	if(pcObjAnchor.href != location.href){
		//If the current link is not to this page then do the mouseover
		if (lvStrImageSrc.indexOf(lvStrImageTest) != -1 )
		{
			lvObjImage.src = gvStrImageRoot+pcStrImageID+'_on.gif';
			//alert(gvStrImageRoot+pcStrImageID+'_on.gif');
		}else{
			lvObjImage.src = gvStrImageRoot+pcStrImageID+'_off.gif';
			//alert(gvStrImageRoot+pcStrImageID+'_off.gif');
		}
	}//Else the link is already highlighted because we are on this page
	
	return true;
}


function printText(x){
	printWindow=window.open("../printwindow.htm")
	printWindow.document.open()
	
	printWindow.document.writeln("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">")
	printWindow.document.writeln("<html lang=\"en\">")
	printWindow.document.writeln("<head>")
	printWindow.document.writeln("<title>nxpage</title>")
	printWindow.document.writeln("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />")
	printWindow.document.writeln("<link rel=\"stylesheet\" href=\"../styles_tnp_IE.css\" />")
	printWindow.document.writeln("</head>")
	printWindow.document.writeln("<body style=\"margin:10px;\">")
	
	printWindow.document.writeln("<div align= right>")
	printWindow.document.writeln(new Date())
	printWindow.document.writeln("<br><a href=\"javascript:window.close()\">Close Window</a>")
	printWindow.document.writeln("</div>")
	//printWindow.document.writeln(document.all["CHLogo"].innerHTML)
	printWindow.document.writeln("<br><h1>")  
	printWindow.document.writeln(x)
	printWindow.document.writeln("<hr></h1>")
	printWindow.document.writeln(document.all["printableContent"].innerHTML)
	
	printWindow.document.writeln("</body>")
	printWindow.document.writeln("</html>")
	printWindow.document.close()
	printWindow.print()
}



function isEmail(e){
	var x;
	x = new String(e.value);
	if ((x.indexOf("@") == -1) || (x.indexOf(".") == -1))
		return false;
	else
		return true;
}

function checkfields1() {
	var x, checkVal;
	checkVal = document.forms[0].firstname;
	if (checkVal.value == ""){
		alert("You have not entered your First Name.");
		checkVal.focus();
		return false;
	}
	
	checkVal = document.forms[0].surname;
	if (checkVal.value == ""){
		alert("You have not entered your Last Name.");
		checkVal.focus();
		return false;
	}
	
	checkVal = document.forms[0].phone;
	if (checkVal.value == ""){
		alert("You have not entered your phone number.");
		checkVal.focus();
		return false;
	}
	
	checkVal = document.forms[0].email;
	if (checkVal.value == ""){
		alert("You have not entered your Email Address.");
		checkVal.focus();
		return false;
	}

	checkVal = document.forms[0].email;
	if (!isEmail(checkVal)){
		alert("You have not entered a valid Email Address.");
		checkVal.focus();
		return false;
	}

	checkVal = document.forms[0].position;
	if (checkVal.value == "none"){
		alert("Please select a position you are interested in.");
		checkVal.focus();
		return false;
	}

	alert("Thank you for your inquiry. One of our representatives will contact you shortly.");
	return true;
}

function checkfields2() {
	var x, checkVal;
	checkVal = document.forms[0].firstname;
	if (checkVal.value == ""){
		alert("You have not entered your First Name.");
		checkVal.focus();
		return false;
	}
	
	checkVal = document.forms[0].surname;
	if (checkVal.value == ""){
		alert("You have not entered your Last Name.");
		checkVal.focus();
		return false;
	}
	
	checkVal = document.forms[0].company;
	if (checkVal.value == ""){
		alert("You have not entered the Name of your Company.");
		checkVal.focus();
		return false;
	}
	
	checkVal = document.forms[0].email;
	if (checkVal.value == ""){
		alert("You have not entered your Email Address.");
		checkVal.focus();
		return false;
	}

	checkVal = document.forms[0].email;
	if (!isEmail(checkVal)){
		alert("You have not entered a valid Email Address.");
		checkVal.focus();
		return false;
	}

	alert("Thank you for your inquiry. One of our representatives will contact you shortly.");
	return true;
}
