function checkSubscribeBox() {
	var emailValue = document.frmEMailSubscribe.fldEmail.value;
	if (emailValue = 'Enter e-mail') {
		document.frmEMailSubscribe.fldEmail.value = '';
	}
}

function print_mail_to_link(lhs, strName) {
		var rhs = "activestrategy.com";
		document.write("<A HREF=\"mailto");
		document.write(":" + lhs + "@");
		document.write(rhs + "\">" + strName + "<\/a>");
}

journey0 = new Image(345, 363);

journey1 = new Image(345, 363);
journey1.src="/images/Strategy_Circle_1.jpg";
journey2 = new Image(345, 363);
journey2.src="/images/Strategy_Circle_2.jpg";
journey3 = new Image(345, 363);
journey3.src="/images/Strategy_Circle_3.jpg";
journey4 = new Image(345, 363);
journey4.src="/images/Strategy_Circle_4.jpg";
journey5 = new Image(345, 363);
journey5.src="/images/Strategy_Circle_5.jpg";
journey6 = new Image(345, 363);
journey6.src="/images/Strategy_Circle_6.jpg";
journey7 = new Image(345, 363);
journey7.src="/images/Strategy_Circle_7.jpg";
journey8 = new Image(345, 363);
journey8.src="/images/Strategy_Circle_8.jpg";
journey9 = new Image(345, 363);
journey9.src="/images/Strategy_Circle_9.jpg";
journey10 = new Image(345, 363);
journey10.src="/images/Strategy_Circle_Epiph.jpg";

function swapCircleGraphicOn(srcImage) {
	if (document.getElementById('StrategyCircle')) {
		document.getElementById('StrategyCircle').src = srcImage;
	} else {
		document.getElementById('usrEvolutionRollover_StrategyCircle').src = srcImage;
	}
}

function swapCircleGraphicOff() {
	if (document.getElementById('StrategyCircle')) {
		document.getElementById('StrategyCircle').src = journey0.src;
	} else {
		document.getElementById('usrEvolutionRollover_StrategyCircle').src = journey0.src;
	}
}

var externWin;
function openPopupName(strName, strURL, intHeight, intWidth, intTop, intLeft, blnLocation, blnMenuBar, blnResizable, blnScrollbars, blnStatus, blnToolbar) {
	if(!externWin || externWin.closed){
		externWin = window.open(strURL, strName, "height=" + intHeight +  ",width=" + intWidth + ",top=" + intTop + ",left=" + intLeft + ",location=" + blnLocation + ",menubar=" + blnMenuBar + ",resizable=" + blnResizable + ",scrollbars=" + blnScrollbars + ",status=" + blnStatus + ",toolbar=" + blnToolbar);
	}
	else{
		externWin.location = strURL;
		externWin.focus();
	}
}

function checkDomain(fldFormField) {
	loadXMLProcessingDoc('/checkdomain.aspx?email=' + escape(fldFormField));
}

function loadXMLProcessingDoc(url) {

	// branch for native XMLHttpRequest object
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.onreadystatechange = confirmDomain;
		req.open("GET", url, true);
		req.send(null);
	// branch for IE/Windows ActiveX version
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.onreadystatechange = confirmDomain;
			req.open("GET", url, true);
			req.send();
		}
	}
}

function confirmDomain() {
	// only if req shows "complete"
	var thistagname;
	var thistagid;
	var inFromBox = false;
	var inToBox = false;
	
	if (req.readyState == 4) {
		// only if "OK"
		if (req.status == 200) {
			// ...processing statements go here...
			
			myResult = req.responseXML.documentElement;
			try {
				resultvalue = myResult.getElementsByTagName('result')[0].firstChild.data;
				
				switch (resultvalue) {
					case 'IsInCompetitiveDomain':
						document.getElementById("dvInValidEmail").style.display = "inline";
						document.getElementById("dvInValidEmail").innerHTML = "<br /><span style='color:red;'>We could not process your request with the information provided. If you would still like to contact us, please send your request via email to <a href='mailto:info@activestrategy.com'>info@activestrategy.com</a>. Be sure to include your name, title, company name, city, country, and phone number.</span><br />";
						break;
					case 'IsInPublicDomain':
						document.getElementById("dvInValidEmail").style.display = "inline";
						document.getElementById("dvInValidEmail").innerHTML = "<br /><span style='color:red;'>Sorry, our automated form can only accept work email addresses. If you must use a 'public' address (such as @hotmail.com, @aol.com, etc.), please email your request to <a href='mailto:info@activestrategy.com'>info@activestrategy.com</a>. Be sure to include your Name, Company Name, Job Title, City, Country, and Phone Number. We will be sure to respond promptly.</span><br />";
						break;
					case 'IsValid':
						doSubmit();
						break;
					default:
						//document.getElementById("dvForm").style.display = "none";
						var doc = document.frmRegister;
						if (doc.email.value != "") {
							alert('General problem with the email address.');
						} else {
							alert('Please enter your work email address.');
						}
						break;
				}
				
			} catch (e) {
				alert(e);
			}
		} else {
			alert('There was a problem retrieving the XML data:\n' + req.statusText);
		}
	}
}
