<!--
	// This Code is property of comtech solutions.
// This function creates a container for information retrieval by the Guido Program.
	var ClientInfo = new CreateInfo(0);
	function CreateInfo(CID){
		this.CID = CID;
	}
	
// This function creates a new window for logging into the requested site.
	var GuidoWind = null
	function GuidoNew(NextPlus,AddNew,Account){
		ChkNextPlus = ""
		if (NextPlus!=null){ChkNextPlus=NextPlus}
		var TheDomain = ExtractDomain(document.domain)
		TheUrl = "http://guidonet.com/scripts/GuidoLogin.asp?CID="+ClientInfo.CID+"&NEXT="+TheDomain+"&NPLUS="+ChkNextPlus+"&NDOM="+document.domain+"&NLOC="+escape(AddNew)+"&ACCT="+Account
		if (GuidoWind != null){
			GuidoWind.close()
			GuidoWind = null
		}
		GuidoWind = window.open(TheUrl,"Login","scrollbars=auto,resizable=yes,top=100,left=200,HEIGHT=250,WIDTH=400")	
	}
// This function creates a new window for logging into the requested site.
	var GuidoWindDone = null
	function GuidoDone(){
		TheUrl = "http://guidonet.com/scripts/GuidoDone.asp"
		if (GuidoWindDone != null){
			GuidoWindDone.close()
			GuidoWindDone = null
		}
		GuidoWindDone = window.open(TheUrl,"Logout","resizable=yes,top=100,left=200,HEIGHT=250,WIDTH=400")	
	}

// This function creates a new window for logging into the requested site.
	var GuidoWindCreate = null
	function GuidoCreate(NextPlus,AddNew,Account,Affiliate){
		TheRefID = ""
		NewSearch = unescape(window.location.search.substring(1,window.location.search.length))
		j=0
		k=0
		for (i=0; i<NewSearch.length; i++){
			if (NewSearch.charAt(i)=="="){k=i+1}
			if (NewSearch.charAt(i)=="&"){
				if (k!=i){
					FieldName = (NewSearch.substring(j,k-1))
					FieldValue = (NewSearch.substring(k,i))
					FieldName = FieldName.toUpperCase()
					if (FieldName == "REFID"){
						TheRefID = FieldValue
					}
				}
				j=i+1
			}
		}
		if (i == NewSearch.length && k>0){
			if (k!=i){
				FieldName = (NewSearch.substring(j,k-1))
				FieldValue = (NewSearch.substring(k,i))
				FieldName = FieldName.toUpperCase()
				if (FieldName == "REFID"){
					TheRefID = FieldValue
				}
			}
			j=i+1
		}
		ChkNextPlus = ""
		ShowAffiliate = ""
		if (NextPlus!=null){ChkNextPlus=NextPlus}
		if (Affiliate!=null){ShowAffiliate=Affiliate}
		var TheDomain = ExtractDomain(document.domain)
		TheUrl = "http://guidonet.com/scripts/CreateGuido.asp?CID="+ClientInfo.CID+"&AFF="+ShowAffiliate+"&REFID="+TheRefID+"&NEXT="+TheDomain+"&NPLUS="+ChkNextPlus+"&NDOM="+document.domain+"&NLOC="+escape(AddNew)+"&ACCT="+Account
		if (GuidoWindCreate != null){
			GuidoWindCreate.close()
			GuidoWindCreate = null
		}
		GuidoWindCreate = window.open(TheUrl,"Login","scrollbars=auto,resizable=yes,top=0,left=0,HEIGHT=440,WIDTH=700")	
	}

// This function writes out the name value pairs for information stored in an array.	
	function SavePairs(GuidoArray){
		for (i=0; i<GuidoArray.length; i=i+2){
			document.cookie = "GUIDO"+GuidoArray[i].toUpperCase()+"="+GuidoArray[i+1]+"; path=/"
		}	
	}
	
// This function gets the value for the field indicated with label.
	function GetValue(label)  {
		label = "GUIDO"+label.toUpperCase()
		var labelLen = label.length
		var cLen = document.cookie.length
		var i=0
		while( i < cLen ) {
			var j = i + labelLen
			if( document.cookie.substring(i,j) == label )   {
				var cEnd = document.cookie.indexOf(";",j)
				if( cEnd == -1 )  { cEnd = document.cookie.length }
				return unescape(document.cookie.substring(j+1,cEnd)) }
			i++  }
		return "" }
	
// This function gets all of the field names of those fields that have been saved.
	function GetLabels()  {
		var t = new Array()
		var cLen = document.cookie.length
		var u = 0
		var i=0
		while( i < cLen ) {
			var k = document.cookie.indexOf("GUIDO",i)
			var j = document.cookie.indexOf("=",k)
			if( k == -1 ){k = document.cookie.length}
			if (!( j==-1 || k>j)){
				t[u]=unescape(document.cookie.substring(k+5,j))
			}
			i=k+1;
			u++;
		}
		return t 
	}
		
// This function will fill the specified field with the specified value.  It is used by the function FillForm.
	function FillField(FieldName,FieldValue){
		if (FieldValue==null){FieldValue=""}
		x = ((document.forms[0].item(FieldName)) ? (document.forms[0].item(FieldName).value = FieldValue) : 0)
	}
	
// This function is used to autofill a form with the stored information.
	function FillForm(){
		var LabelsArray = new Array();
		LabelsArray = GetLabels()
		for (i=0; i<LabelsArray.length; i++){
			FillField(LabelsArray[i],GetValue(LabelsArray[i]))
		}	
	}
	
// This function extracts the domain without the www or any other prefix.
	function ExtractDomain(NewDomain){
		x = NewDomain.indexOf(".")
		y = NewDomain.lastIndexOf(".")
		if (x==y){ 
			return NewDomain;
		} else {
			return NewDomain.substring(NewDomain.lastIndexOf(".",y-1)+1,NewDomain.length);
		}
	}
	
// This function creates a new window for logging into the requested site.
	var GUpdateWind = null
	function GuidoUpdate(NewAccount){
		ChkAccountNr = "-1"
		ChkNextPlus = ""
		if (NewAccount!=null){ChkAccountNr=NewAccount}
		TheUrl = "http://guidonet.com/scripts/GuidoUpdate.asp?CID="+ClientInfo.CID+"&AN="+ChkAccountNr
		if (GUpdateWind != null){
			GUpdateWind.close()
			GUpdateWind = null
		}
		GUpdateWind = window.open(TheUrl,"Update","resizable=yes,top=100,left=200,HEIGHT=250,WIDTH=400")		
	}
	
//-->


