
// This will load the site survey
function popUnderSurvey()
{
	var cookiesX = document.cookie;
	var locationX = cookiesX.indexOf("popupShown=yes");
	var ExpireDateX = new Date ();

	ExpireDateX.setTime(ExpireDateX.getTime() + (28 * 24 * 3600 * 1000)); // 28 days * 24 hrs/day * 3600 sec/hr * 1000 millsec/sec

	if (locationX == -1)
	{
	  document.cookie = "popupShown=yes; expires=" + ExpireDateX.toGMTString() + "; " + document.cookie;
	  window.open('/ge-interlogix/survey/site_feedback.html','','');
	  window.focus();
	}
}

function setFieldValue(fieldRef, str) {
	// clears field when user clicks in, 
	// and resets to default str when user clicks out 
	// with no value in the field.
	obj = eval(fieldRef);
	if (obj.value == str) {
		obj.value = "";
	}
	else if (obj.value == "") {
		obj.value = str;
	}
}

function isItOnlink(form) {
if(typeof top.onlink == "undefined")
	document.frmSearch.submit();
else if(confirm('Your selections will be lost. Do you want to continue?'))
	form.submit();
else return false;
}


var serName = "http://elitenet.geindustrial.com";
				var cwcSSL = "https://www.geindustrial.com";
				if(window.location.hostname.indexOf("-test.geindustrial.com") >= 0) {
					serName = "http://elitenet-test.geindustrial.com";
					cwcSSL = "https://www-test.geindustrial.com";
				} else if(window.location.hostname.indexOf(".geindustrial.com") >= 0) {
					serName = "http://elitenet.geindustrial.com";
					cwcSSL = "https://www.geindustrial.com";
				} else if(window.location.hostname.indexOf(".indsys.ge.com") >= 0) {
					serName =  "http://teamsite-elitenet-review.indsys.ge.com";
					cwcSSL = "https://teamsite-cwc-review.indsys.ge.com";
				}
				

var s;

function getCookie(Name) {
var search = Name + "=";
if (document.cookie.length > 0) {
	offset = document.cookie.indexOf(search);
	if (offset != -1) {
		offset += search.length;
		end = document.cookie.indexOf(";", offset);
		if (end == -1) end = document.cookie.length;
		return unescape(document.cookie.substring(offset, end));
	}
}
}

function openPage(url,override){
if (typeof(HM_Array1)!='undefined' && !override) return;
if(typeof top.onlink == "undefined")
	parent.document.location.href=url;
else if(confirm('Your selections will be lost. Do you want to continue?')) 	parent.document.location.href=url;
}

function openRegisterPage(url,override){
if (typeof(HM_Array1)!='undefined' && !override) return;
if(typeof top.onlink == "undefined") {
	parent.document.location.href=url+"##reference$$"+window.location.href;
	}
else if(confirm('Your selections will be lost. Do you want to continue?')) 	{
	parent.document.location.href=url+"##reference$$"+window.location.href;
	}
}