var starttime = new Date( )
var anhour = new Date( )
anhour.setTime(starttime.getTime( ) + 1000*60*60)
var aday = new Date( )
aday.setTime(starttime.getTime( ) + 1000*60*60*24)
var amonth = new Date( )
amonth.setTime(starttime.getTime( ) + 1000*60*60*24*31)
var ayear = new Date( )
ayear.setTime(starttime.getTime( ) + 1000*60*60*24*365)


function woodshop()
{ window.open("http://eduhosting.org/windpics/woodshop.html",'','location=yes, resizeable=yes, toolbar=yes, scrollbars=yes, height=500 width=400')
}


function gopass()
{  var ok=getCookie("classpass")
   if (!ok || (ok!="1954" && ok!="promo-03")) 
   {  var ok=prompt("Class Password?",'        ')
      ok=ok.toLowerCase()
      if (!ok || (ok!="1954" && ok!="promo-03"))
      {  nopass()
         location.replace("http://eduhosting.org/classes/rockler/index.html")
         return
      }
      setCookie("classpass",ok,ayear)
   }
   var myref=window.location.href
   if (myref.indexOf("class.html")<0 && myref.indexOf("router.html")<0)
   {  window.location="class.html"
   }
}

function setCookie(cookLbl, value, expire) 
{  document.cookie=cookLbl + "=" + escape(value) 
   + ((expire==null) ? "" : ("; expires=" + expire.toGMTString( )))
}

function getCookie(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))       
       }
   }
}

function gosee(pass)
{ if (pass.indexOf("rockler.com")>-1 && pass.indexOf("AFM18")<0)
  {  var gothere="http://www.rockler.com/index.cfm?sid=AFM18"
  }  else
  {  var gothere="http://"+pass
  }
  window.open(gothere)
}

var myref=window.location.href

if (myref.indexOf("class.html")>-1 || myref.indexOf("router.html")>-1)
{  gopass()
}


function gomount()
{ window.open("http://eduhosting.org/classes/windgens/wgs7.html",'','toolbar=no, location=no, resizeable=yes, scrollbars=yes, width=800 height=600')
}

function gocont()
{ window.open("contest.html",'','toolbar=no, location=no, resizeable=yes, scrollbars=yes, width=500 height=700')
}

function answer()
{ document.quiz.src="mid.gif"
}

function nopass()
{ window.open("nopass.html",'','toolbar=no, location=no, resizeable=yes, scrollbars=yes, width=750 height=600')
}