
function processit()
{
makeout()
openwin()
}

function makein()
{
 mystring=unescape(document.cookie)
 first=locateme("*u1")
 second=locateme("*u2")
 third=locateme("*u3")
 fourth=locateme("*u4")
 fifth=locateme("*u5")
 sixth=locateme("*u6")
 seventh=locateme("*u7")
 firsttime=locateme("*p1")
 fname=locateme("*n1")
 lname=locateme("*n2")
 aone=locateme("*a1")
 atwo=locateme("*a2")
 city=locateme("*a3")
 state=locateme("*a4")
 zip=locateme("*a5")
 elmail=locateme("*a6")
 visits=locateme("*z1")
 if(visits=="NaN"||visits=="us"||visits==""||visits=="null") 
  {visits=1}
 visits=visits + 1
 if(first.length > 2) 
 {
 processit() 
  }
 else 
 {
 getset()
 }
}

function getset()
{
 window.open("setup.html","setup")
}

function locateme(findthis)
{
 itstart=mystring.indexOf(findthis,0)+3
 itend=mystring.indexOf("*",itstart)
 if (itstart ==0) {itend=0}
 return mystring.substring(itstart,itend)
}


function makeout()
{
 NameOfCookie="use4"
 delCookie(NameOfCookie)
 if (fname.length < 1) 
 {fname = "Visitor"}
 var outline="*u1"+first+"*u2"+second+"*u3"+third+"*u4"+fourth+"*u5"+fifth+"*u6"+sixth+"*u7"+seventh
 outline += "*p1"+firsttime
 outline += "*n1"+fname+"*n2"+lname+"*a1"+aone+"*a2"+atwo+"*a3"+city+"*a4"+state+"*a5"+zip+"*a6"+elmail
 outline += "*z1"+visits+"*"
 setCookie(NameOfCookie,outline,366)
}

function openwin()
{
var scrhigh=250
var scrwide=595
var scroffh=0
var scroffv=0
if (parseInt(navigator.appVersion)>=4 && screen.width > 750)  
 {
 scrhigh=400
 scrwide=700
 scroffh=30
 scroffv=45
 }
if (fifth.length < 5)
{
 scroffh=0
 scroffv=0
}
if (eval(firsttime) < 1)
 {firsttime = 1}
if (seventh.length > 4)
 {launchit(seventh,eval(firsttime)*6,"Use4 will launch "+seventh+" in "+eval(firsttime)*6+" seconds.",scrwide,scrhigh,0,0)}
if (sixth.length > 4)
 {launchit(sixth,eval(firsttime)*5,"Use4 will launch "+sixth+" in "+eval(firsttime)*5+" seconds.",scrwide,scrhigh,10,15)}
if (fifth.length > 4)
 {launchit(fifth,eval(firsttime)*4,"Use4 will launch "+fifth+" in "+eval(firsttime)*4+" seconds.",scrwide,scrhigh,20,30)}
if (fourth.length > 4)
 {launchit(fourth,eval(firsttime)*3,"Use4 will launch "+fourth+" in "+eval(firsttime)*3+" seconds.",scrwide,scrhigh,scroffh,scroffv)}
if (third.length > 4)
 {launchit(third,eval(firsttime)*2,"Use4 will launch "+third+" in "+eval(firsttime)*2+" seconds.",scrwide,scrhigh,scroffh+10,scroffv+15)}
if (second.length > 4)
 {launchit(second,eval(firsttime),"Use4 will launch "+second+" in "+eval(firsttime)+" seconds.",scrwide,scrhigh,scroffh+20,scroffv+30)}
if (first.length > 4)
 {launchit(first,0,"Stand by. Use4 is loading your top page now.",scrwide,scrhigh,scroffh+30,scroffv+45)}
}
 
function launchit(urlname,pauseval,wintitle,xsize,ysize,xpos,ypos)
{
 var temp="<"+"/"+"script>";
 var utemp="'location.href=urlval'";
 var wtemp="width="+xsize+",height="+ysize+",status=yes,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes";
 thewin=open("",pauseval,wtemp);
 thewin.document.open();
 thewin.document.write("<html><head><title>"+wintitle);
 thewin.document.write("</title></head><body>");
 thewin.document.write("<center><h1>"+wintitle);
 thewin.document.write("</h1></center>");
 thewin.document.write("<script>");
 thewin.document.write("window.onerror=null;")
 thewin.document.write("var urlval='"+urlname+"';")
 thewin.document.write("setTimeout(" + utemp +","+pauseval*1000+");" )
 thewin.document.write("self.moveTo("+xpos+","+ypos+");")
 thewin.document.write(temp+"</body></html>");   
 thewin.document.close();  
}

function getCookie(NameOfCookie)
{ if (document.cookie.length > 0) 
{ begin = document.cookie.indexOf(NameOfCookie+"="); 
if (begin != -1) 
{ begin += NameOfCookie.length+1; 
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); } 
}
return null; 
}

function setCookie(NameOfCookie, value, expiredays) 
{ var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) + 
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

function delCookie(NameOfCookie) 
{ if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
 
