var is = new chkVersion();
var goodLogon = false;
var _signonwindow;

function chkVersion()
{
	var isMac = false;
	var isMacIE5 = false;

	var n = navigator.appName;
	if (n=="Netscape")
		this.n = "ns"
	else
	{
		this.n = "x";
		if (n=="Microsoft Internet Explorer")
		{
			if (navigator.appVersion.indexOf("MSIE") != -1)
			{
				var startingAt = parseInt(navigator.appVersion.indexOf("MSIE"));
				this.n = navigator.appVersion.substring(startingAt, startingAt + 9);
				if (this.n.substring(0,8) == "MSIE 5.5")
					this.n = this.n.substring(0,8);
				else
				if (this.n.substring(0,6) == "MSIE 6")
					this.n = this.n.substring(0,6);
				
				isMac = (navigator.appVersion.indexOf('Mac') != -1);
				isMacIE5 = (isMac && (this.n.indexOf("MSIE 5.0") != -1));

			}
		}
	}

	this.v = parseInt(navigator.appVersion)
	this.vs = parseFloat(navigator.appVersion)
	this.ns = (this.n=="ns" && this.vs>=4.5)
	this.ie = (this.n=="MSIE 5.01" || this.n=="MSIE 5.5" || this.n=="MSIE 6" || isMacIE5)

	this.valid = (this.ns||this.ie)

}

//CMT Login

function url() {
//hidden = open('http://cmtau.org','NewWindow','top=0,left=0,width=1020,height=710,titlebar=no,status=no,resizable=yes,scrollbars=yes');

hidden = open('http://www.cmtau.org/','NewWindow','top=0,left=0,width=1020,height=710,titlebar=no,status=no,resizable=yes,scrollbars=yes');
//hidden = open('http://www.gs1au.org/services/cmt_offline.asp','NewWindow','top=0,left=0,width=1020,height=710,titlebar=no,status=no,resizable=yes,scrollbars=yes');

}


function GoToSignOn(comu)
{
	now = Date.parse(Date());
	if (is.valid)
	{
		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 - 12;
		var _height	= window.screen.height - 50;
		var _left	= 0;
		var _top	= 0;
		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://beta.gpcatalogue.com/html/gpSignonF.html?COMU=" + comu;
		_signonwindow.top.location.href = "https://www.gpcatalogue.com/html/gpSignonF.html?COMU=" + comu;
	}
	else
		alert('Your ' + navigator.appName + ' Version ' + navigator.appVersion + ' browser will not run EANnet.  You need to use either Netscape Navigator, version 4.5 or higher, or Microsoft Internet Explorer, version 5.01 or higher.');
}




function Lvl_jumpMenuWin(el,y,q) { //v1.1 4LevelWebs
var O=el.options[el.selectedIndex].value,ww,hh;if(y)el.selectedIndex=0;
var er=O.charAt(O.length),as=O.substring(O.length,er),a=as.split('~');
var tp=",top=",tr=",toolbar=",ts=",status=",ln=",location=",mb=",menubar=",ss=",scrollbars=",re=",resizable=",fs=",fullscreen=";
var sw=(screen.width),sh=(screen.height);
var u=a[0],n=a[1],WW=a[2],HH=a[3];
var t=(a[6]==0)?tr+0:tr+1,l=(a[7]==0)?ln+0:ln+1,s=(a[8]==0)?ts+0:ts+1,z=(a[13]==0)?fs+0:fs+1;
var m=(a[9]==0)?mb+0:mb+1;x=(a[10]==0)?ss+0:ss+1,r=(a[11]==0)?re+0:re+1,c=a[12];
if (a[12]==0){ww=(sw)}else{ww=(sw-WW)/2}
if (a[12]==0){hh=(sh)}else{hh=(sh-HH)/2}
var j=(c==1)?tp+hh:tp+a[5],k=(c==1||c==2)?",left="+ww:",left="+a[4];if(q==0)q='top';
var W=(a[2]==0)?0:",width="+WW,H=(a[3]==0)?0:",height="+HH,f=W+=H+=j+=k+=t+=l+=s+=m+=x+=r+=z;
if(u)if(a[14]==1){u=eval("parent.frames[\'"+q+"\'].location='"+u+"'")}else{window.open(u,n,f)}el.blur();
}

  <!--


function ccc8(form) {

  factor = 3;

  sum = 0;
  
  if (form.numero.value.length!=7){

	alert("Please enter 7 digits in the Item Reference box")

	form.cc.value = ""

      form.chiffre.value = "";

   }
   
   else{

  for (index = form.numero.value.length; index > 0; --index) {

    sum = sum + form.numero.value.substring (index-1, index) * factor;

    factor = 4 - factor;

  }



   cc = ((1000 - sum) % 10);

   form.chiffre.value = "000000" + form.numero.value + cc;

   result = form.chiffre.value;

   form.cc.value = cc

  

}
}


function ccc12(form) {

  factor = 3;

  sum = 0;
  
   if (form.numero.value.length!=11){

	alert("Please enter 11 digits in the Item Reference box")

	form.cc.value = ""

      form.chiffre.value = "";

   }
   
   else{

  for (index = form.numero.value.length; index > 0; --index) {

    sum = sum + form.numero.value.substring (index-1, index) * factor;

    factor = 4 - factor;

  }



   cc = ((1000 - sum) % 10);

   form.chiffre.value = "00" + form.numero.value + cc;

   result = form.chiffre.value;

   form.cc.value = cc

 

}
}

function ccc13(form) {

  factor = 3;

  sum = 0;
  
   if (form.numero.value.length!=12){

	alert("Please enter 12 digits in the Item Reference box")

	form.cc.value = ""

      form.chiffre.value = "";

   }
   
   else{

  for (index = form.numero.value.length; index > 0; --index) {

    sum = sum + form.numero.value.substring (index-1, index) * factor;

    factor = 4 - factor;

  }



   cc = ((1000 - sum) % 10);

   form.chiffre.value = "0" + form.numero.value + cc;

   result = form.chiffre.value;

   form.cc.value = cc;

  

}
}





function ccc14(form) {

  factor = 3;

  sum = 0;

  
  if (form.numero.value.length!=13){

	alert("Please enter 13 digits in the Item Reference box")

	form.cc.value = ""

      form.chiffre.value = "";

   }
   
   else{
  
  for (index = form.numero.value.length; index > 0; --index) {

    sum = sum + form.numero.value.substring (index-1, index) * factor;

    factor = 4 - factor;

  }

   cc = ((1000 - sum) % 10);

   form.chiffre.value = form.numero.value + cc;

   result = form.chiffre.value;

   form.cc.value = cc

  

}
}



function ccc18(form) {

  factor = 3;

  sum = 0;

 if (form.numero.value.length!=17){

	alert("Please enter 17 digits in the Item Reference box")

	form.cc.value = "";

   }
   
   else{
 
  for (index = form.numero.value.length; index > 0; --index) {

    sum = sum + form.numero.value.substring (index-1, index) * factor;

    factor = 4 - factor;

  }

   cc = ((1000 - sum) % 10);

   form.cc.value = cc

  

}
}

<!--  -->

function SuperSpeakWindow(theURL,theTerm) {
  var URL = theURL + "?term=" + theTerm;
  window.open(URL,'speak','scrollbars=yes,width=500,height=470,resizable,titlebar,status');
  document.MM_returnValue = false;
}


<!-- Glossary Hover Overs
function on(obj){obj.style.backgroundColor='FE3E14';} 			function off(obj){obj.style.backgroundColor='#091351';}
function on_g(obj){obj.style.backgroundColor='94bd60';} 		function off_g(obj){obj.style.backgroundColor='#79AC38';}
function on_blue_lt(obj){obj.style.backgroundColor='#E9F1F5';} 	function off_blue_lt(obj){obj.style.backgroundColor='#F8F8F3';}
function on_blue_dk(obj){obj.style.backgroundColor='#D3E3EB';} 	function off_blue_dk(obj){obj.style.backgroundColor='#F8F8F3';}
function on_orange(obj){obj.style.backgroundColor='#EDC385';} 	function off_orange(obj){obj.style.backgroundColor='#E8B466';}


<!-- EANnet Register Page Script
function Reg_enable() {
	
	if ((usergpform.radio2.checked )||(usergpform.radio3.checked))
		{		
		if (usergpform.agree.checked )
			{		
			//alert ("Hello");	
			usergpform.btnSubmit.disabled = false;
			}
		else 		
			{		
			usergpform.btnSubmit.disabled = true;
			}
	}
}
