var is = new chkVersion();
var goodLogon = false;
var _signonwindow;

function chkVersion()
{
	var isIE7=false;
	var isIE=false;
	var n = navigator.appName
	if (n=="Netscape")
		this.n = "ns"
	else
	{
		this.n = "x";
		if (n=="Microsoft Internet Explorer")
		{
			isIE=true;
			if (navigator.appVersion.indexOf("MSIE") != -1)
			{
				var startingAt = parseInt(navigator.appVersion.indexOf("MSIE"));
				this.n = parseFloat(navigator.appVersion.substring(startingAt+4, startingAt +8));
			}
		}
	}
	this.v = parseInt(navigator.appVersion)
	this.vs = parseFloat(navigator.appVersion)
	this.ns = (this.n=="ns" && this.vs<4.9 && this.vs>=4.5 )
	this.ie = (this.n>5)
	if(this.n>=7 && isIE){
		this.isIE7=true;
	}
	this.valid = (this.ns||this.ie)
}
//----------------------------------------------------------------------
function GoToSignOn(comu)
{
    now = Date.parse(Date());
	if (is.valid)
	{
		if(is.isIE7 && comu == 2){
			alert("You are using the Internet Explorer 7 (IE7) browser.  This Browser is only approved for EANnet use when used on Windows XP.  We will not accept support calls nor fix exceptions related to IE 7 on platforms other than Windows XP.");
		}

		if(is.isIE7 && comu == 1){
			alert("You are using the Internet Explorer 7 (IE7) browser.  This Browser is only approved for use on Windows XP.  We will not accept support calls nor fix exceptions related to IE 7 on platforms other than Windows XP.");
		}

		if(is.isIE7 && comu != 1 && comu != 2){
			alert("You are using the Internet Explorer 7 (IE7) browser.  This Browser is only approved for use on Windows XP.  We will not accept support calls nor fix exceptions related to IE 7 on platforms other than Windows XP.");
		}
		if (window.screen.width < 1024 || window.screen.height < 768)
		{
			contents = 'Your PC is configured with a screen resolution of ' + window.screen.width + ' X ' + window.screen.height + '.  For best results, you should be using a miniumum resolution of 1024 X 768.  Do you want to continue with Sign On anyway?';
			if (!(confirm(contents)))
				return;
		}
		var _width	= (window.screen.width	<= 800) ? window.screen.width - 16	: window.screen.width	* 0.95;
		var _height	= (window.screen.height	<= 600) ? window.screen.height - 62	: window.screen.height	* 0.90;
		var _left	= (window.screen.width	/ 2) -	((_width	+ 10) / 2)
		var _top	= (window.screen.height	/ 2) -	((_height	+ 58) / 2)
		var _sizeable = 1;
		if (is.ns)
			_sizeable = 0;
		var _options = 'dependent=0,directories=0,hotkeys=0,toolbar=0,status=1,menubar=0,scrollbars=1,resizable=' + _sizeable + ',width=' + _width + ',height=' + _height + ',top=' + _top + ',left=' + _left;
		contents = 'Are you sure you want to sign-on again?  If you have left your old application window signed on it will be signed off if you continue.';

		if ( _signonwindow && !_signonwindow.closed ) {
			if (!(confirm(contents))) {
				return
			}
		}
		_signonwindow	= window.open('','GPCWindow',_options)

		goodLogon = true;
		_signonwindow.top.location.href = "https://www.gpcatalogue.com/html/gpSignonF.html?COMU=" + comu;
	}
	else
		alert('Your browser will not run Global Product Catalogue.  Please see "Important Browser Information" on the GPC Home Page, where you can download a compliant browser version.');
}
