// Supportacus
var oWinSRSMain = null;

function openWin( windowURL, windowName, windowFeatures ) { 
		oWinSRSMain = window.open( windowURL, windowName, windowFeatures ) ; 
		return oWinSRSMain
} 

function openImgWindow(url) {
		   popupWin = window.open(url, 'remote', 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes, dependent,left=0,top=0')
}

function srMainPage(tnPageTyp) {
	
	var lnHeight = screen.availHeight - 50
	var lnWidth  = screen.availWidth - 10

	var WinStr = "height=" + lnHeight + ",innerHeight=" + lnHeight;
		WinStr += ",width=" + lnWidth + ",innerWidth=" + lnWidth;
				
	if (screen && screen.availHeight) {

		var ah = screen.availHeight - 50;
		var aw = screen.availWidth - 10;

		var xc = (aw - lnWidth) / 2;
		var yc = (ah - lnHeight) / 2;
	} else {
		var xc = 700;
		var yc = 500;
	}

	WinStr += ",left=" + xc + ",screenX=" + xc;
	WinStr += ",top=" + yc + ",screenY=" + yc;
	WinStr+=',toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1,maximize=1'

	var lcUUID = "";
	
	if (document.frmForm && document.frmForm.hidEntityUUID) {
		lcUUID = document.frmForm.hidEntityUUID.value;
	}

	if (tnPageTyp && tnPageTyp == 2) {
		var lcSRMSLogin = "supportacus_emailpswd.cfm"+lcUUID;
	} else {
		var lcSRMSLogin = "app/sr_login_do.cfm"+lcUUID;
	}

	if (oWinSRSMain && oWinSRSMain.open && !oWinSRSMain.closed)
	{
		oWinSRSMain.focus();
	} else {
		var loWin = openWin(lcSRMSLogin, "winSupportacus", WinStr);
		loWin.focus();
	}
}

function doSubmit(tcCode) {
	if (typeof tcCode != 'undefined') {
		var oFrm = document.getElementById('idFrm')
		if (_CF_checkfrmForm(oFrm)) {
			var lcCode = document.getElementById('hidIDNum').value;
			var lcCodeIn = document.getElementById('hidCodeIn').value;
			if (lcCode.substr(0,4) != lcCodeIn) {
				alert('The numbers you entered do not match the Image numbers!')
			} else {
				oFrm.action = "signup_submit.cfm";
				oFrm.submit();
			}
		}
	}
}


function doSubmitContact(tcCode) {
	if (typeof tcCode != 'undefined') {
		var oFrm = document.getElementById('idFrm')
		if (_CF_checkfrmForm(oFrm)) {
			var lcCode = document.getElementById('hidIDNum').value;
			var lcCodeIn = document.getElementById('hidCodeIn').value;
			if (lcCode.substr(0,4) != lcCodeIn) {
				alert('The numbers you entered do not match the Image numbers!')
			} else {
				oFrm.action = "contact_submit.cfm";
				oFrm.submit();
			}
		}
	}
}

function doSubmitLiveDemo(tcCode) {
	if (typeof tcCode != 'undefined') {
		var oFrm = document.getElementById('idFrm')
		if (_CF_checkfrmForm(oFrm)) {
			var lcCode = document.getElementById('hidIDNum').value;
			var lcCodeIn = document.getElementById('hidCodeIn').value;
			if (lcCode.substr(0,4) != lcCodeIn) {
				alert('The numbers you entered do not match the Image numbers!')
			} else {
				oFrm.action = "live_demo_submit.cfm";
				oFrm.submit();
			}
		}
	}
}

//-----------------------------------------------------------------------------------------------------
function check_len(txtObj,tnLen)
{
	if (txtObj.value.length > tnLen) {
		alert("Line to long, Max "+tnLen+" Characters!  Current Length: "+txtObj.value.length)
		txtObj.focus()
		return false
	} else {
		return true
	}
}
//-----------------------------------------------------------------------------------------------------
