var myref=window.location.href
var myrefl=myref.toLowerCase()
var private=""

if (myrefl.indexOf("auth")>-1)
{  var ok=prompt("AuthCode",'')
   if (ok!="3141")
   {  location.replace("http://goldpactpower.com")
   }
}

if (myrefl.indexOf("?cnmi")>-1)
{  window.open("http://goldpactpower.com/cnmievents.doc")
}



function setCookiemain(cookLbl, value, expire) 
{  document.cookie=cookLbl + "=" + escape(value)
   + ((expire==null) ? "" : ("; expires=" + expire.toGMTString( )))
}

function ckbio()
{ alert("Invalid authorization code.\n\nPlease call (415) 374-6674 to obtain an authorization code to view Team Member Contact Information.")
}

function getCookiemain(cookLbl) 
{  var search=cookLbl + "="
   if (document.cookie.length>0)
   {  offset=document.cookie.indexOf(search)
      if (offset!=-1) 
      {  offset +=search.length
         end=document.cookie.indexOf(";",offset)
         if (end==-1)
            end=document.cookie.length
            return unescape(document.cookie.substring(offset, end))       
       }
   }
}

var today=new Date()
var anhour = new Date( )
anhour.setTime(today.getTime( ) + 1000*60*60)
var aday = new Date( )
aday.setTime(today.getTime( ) + 1000*60*60*24)

 var auth1=today.getHours()
 var auth2=today.getMinutes()
 var auth3=today.getSeconds()
 var auth4=1*(auth1+auth2+auth3)
 
 setCookiemain("lastauth",auth4,aday)

var menufont="1"

var parta="<td nowrap bgcolor=\"#314263\"><center><b><a href=\"http://goldpactpower.com/"
var partb=".html\">"

var mybody="<table width=100%><tr><td background=\"gpphead.jpg\"><img src=\"spacer.gif\" width=1200 height=1><br><img src=\"spacer.gif\" width=1 height=140>"
var mybody="<table background=\"gppsmall.jpg\" width=100%><tr><td><img src=\"spacer.gif\" width=250 height=110></td><td><img src=\"spacer.gif\" width=550 height=80><br>"
var menufont="0"
allmenu=new Array(
"home.Home Page",
"signin.My Account"
)
var tabletop="<table width=100%><tr><td align=right><table cellpadding=3 bordercolor=white border=1><tr>"

if (myrefl.indexOf("goldpact.com")>-1 || myrefl.indexOf("earnamil")>-1 || myrefl.indexOf("gpre")>-1 || myrefl.indexOf("btubank")>-1 || myrefl.indexOf("btuworld")>-1 || myrefl.indexOf("gppbl")>-1 || myrefl.indexOf("btuworldbank")>-1 || myrefl.indexOf("nwgande")>-1 || myrefl.indexOf("kwhx")>-1 || myrefl.indexOf("hoffman")>-1 || myrefl.indexOf("gwt")>-1  || myrefl.indexOf("lawyerstd")>-1 )
{  var mybody="<table width=100%><tr><td background=\"http://goldpact.com/pics/gpre.bmp\"><img src=\"spacer.gif\" width=1200 height=1><br><img src=\"spacer.gif\" width=1 height=140>"
   if (myrefl.indexOf("hoffman")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://hoffmancleantech.com/mytop.jpg\"><img src=\"spacer.gif\" width=650 height=1><br><img src=\"spacer.gif\" width=1 height=130>"
   }
   if (myrefl.indexOf("kwhx")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://kwhexchange.com/kwhtop.jpg\"><img src=\"spacer.gif\" width=650 height=1><br><img src=\"spacer.gif\" width=1 height=55>"
   }
   if (myrefl.indexOf("gwt")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://globalwindturbine.com/gwstop.jpg\"><img src=\"spacer.gif\" width=650 height=1><br><img src=\"spacer.gif\" width=1 height=150>"
   }
   if (myrefl.indexOf("lawyerstd")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://lawyerstd.com/pics/ltdtop.jpg\"><img src=\"spacer.gif\" width=650 height=1><br><img src=\"spacer.gif\" width=1 height=100>"
   }
   if (myrefl.indexOf("btubank")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://btubank.com/mytop.jpg\"><img src=\"spacer.gif\" width=1100 height=1><br><img src=\"spacer.gif\" width=1 height=100>"
   }
   if (myrefl.indexOf("btuworld")>-1 || myrefl.indexOf("gppbl")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://btubank.com/mywtop.jpg\"><img src=\"spacer.gif\" width=1100 height=1><br><img src=\"spacer.gif\" width=1 height=100>"
   }
   if (myrefl.indexOf("btuworldbank")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://btubank.com/mywtop.jpg\"><img src=\"spacer.gif\" width=1100 height=1><br><img src=\"spacer.gif\" width=1 height=100>"
   }
   if (myrefl.indexOf("nwgande")>-1)
   {  var mybody="<table width=100%><tr><td background=\"http://newworldgasandelectric.com/pics/longtop.jpg\"><img src=\"spacer.gif\" width=1100 height=1><br><img src=\"spacer.gif\" width=1 height=110>"
   }
}  else
{  
   mybody+=tabletop
   var dd=today.getDate()
   var mm=today.getMonth()
   var yy=today.getYear()
   var hh=today.getHours()
      

   var partc="<font face=\"verdana, arial, helvetica\" size=\""
   partc+=menufont
   partc+="\" color=\"#FFFFFF\" class=\"thtcolor\">"
   var partd="</a></td>"
   
   for (i=0; i<allmenu.length; i++)
   {   var anitem=allmenu[i]
       isplit=anitem.split(".")
       var lside=isplit[0]
       var rside=isplit[1]
       mybody+=parta
       mybody+=lside
       mybody+=partb
       mybody+=partc
       mybody+=rside
       mybody+=partd
   }
   mybody+="</tr></table></td></tr></table></td></tr></table>"
}


function gosee(pass)
{ window.open(pass)
}

function authit()
{ var today=new Date()
  var mm=today.getMonth()
  mm++
  var mmc=mm.toString()
  if (mmc.length<2)
  {  mmc="0"+mmc
  }
  var dd=today.getDate()
  var ddc=dd.toString()
  if (ddc.length<2)
  {  ddc="0"+ddc
  }
  var mmdd=""+ddc+""+mmc
  var tcode=document.topform.authcode.value
  var gothere="http://eduhosting.org/windpics/book/book1.html?"+mmdd
  if (tcode==mmdd)
  {  popsee(gothere)

  }
}
function popsee(pass)
{ window.open(pass,'','scrollbars=yes, toolbar=no, location=no, resizeable=yes, height=700 width=1050, top=1 left=1')
}

function authcalc(pass)
{ var gothere=document.midform.calcauth.value
  gothere+=pass
  gothere="http://goldpactpower.com/"+gothere+".html"
  popsee(gothere)
}
function ckauth()
{  var authbio=document.bio.tryauth.value
   authbio=authbio.toLowerCase()
   if (authbio=="privatebios")
   {  window.open("http://goldpactpower.com/gppteam.doc")
      alert("Authorization accepted.\n\nYou were granted a confidential authorization code.\n\nA window will open with a confidential MS WORD document relating to Gold Pact Power Team BIOS.\n\nThis document is private and confidential.\n\nTo prevent brain-trust piracy, we do not share our complete Team bio information publically.\n\nDO NOT DISTRIBUTE THIS CONFIDENTIAL DOCUMENT.")
   }
}