function showpopup(url)
{
      var newwindow;
	newwindow=window.open(url,'name','height=260,width=370,left=300,top=300,resizable=no,dependable=yes');
	if (window.focus) {newwindow.focus()}
}

function showpopupat(url, windowleft, windowtop, windowheight, windowwidth)
{
      var newwindow;
      var wleft=parseFloat(windowleft);
      var wtop=parseFloat(windowtop);
      var wheight=parseFloat(windowheight);
      var wwidth=parseFloat(windowwidth);
	newwindow=window.open(url,'name','height='+wheight+',width='+wwidth+',left='+wleft+',top='+wtop+',scrollbars=yes,resizable=no,dependable=yes');
	if (window.focus) {newwindow.focus()}
}

function resizeImageMap() {
   var resize_ratio=parseFloat("1024")/screen.width;
   var coord_elements = document.getElementsByTagName("area"); 

   for(var i=0; i<coord_elements.length; i++) {
      coord_vals = coord_elements[i].coords.split(','); 
      for(var j=0; j<coord_vals.length; j++) {
         coord_vals[j] = parseFloat(coord_vals[j]) /resize_ratio;
      }
      var new_coord_vals= coord_vals.join(',');
      coord_elements[i].coords=new_coord_vals;
   }
}

function setPageCSS(pagename) {
//   resizeImageMap();
   filename="http://www.internright.com/styles/1024/" + pagename + ".css"
   var fileref=document.createElement("link")
   fileref.setAttribute("rel", "stylesheet")
   fileref.setAttribute("type", "text/css")
   fileref.setAttribute("href", filename)
   document.getElementsByTagName("head")[0].appendChild(fileref)
/*
   if ((screen.width>=1024)) { 
      filename="http://www.tutorbuddy.com/styles/1024/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else { 
      filename="http://www.tutorbuddy.com/styles/800/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   }
   if ((screen.width>=2560)) {
      filename="http://www.tutorbuddy.com/styles/2560/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=2304)) { 
      filename="http://www.tutorbuddy.com/styles/2304/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=2048)) { 
      filename="http://www.tutorbuddy.com/styles/2048/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=1920)) { 
      filename="http://www.tutorbuddy.com/styles/1920/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=1600)) { 
      filename="http://www.tutorbuddy.com/styles/1600/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=1440)) { 
      filename="http://www.tutorbuddy.com/styles/1440/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=1360)) { 
      filename="http://www.tutorbuddy.com/styles/1360/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=1280)) { 
      filename="http://www.tutorbuddy.com/styles/1280/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=1152)) { 
      filename="http://www.tutorbuddy.com/styles/1152/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=1024)) { 
      filename="http://www.tutorbuddy.com/styles/1024/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=960)) { 
      filename="http://www.tutorbuddy.com/styles/960/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=800)) { 
      filename="http://www.tutorbuddy.com/styles/800/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=640)) { 
      filename="http://www.tutorbuddy.com/styles/640/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   } 
   else if ((screen.width>=320)) { 
      filename="http://www.tutorbuddy.com/styles/320/" + pagename + ".css"
      var fileref=document.createElement("link")
      fileref.setAttribute("rel", "stylesheet")
      fileref.setAttribute("type", "text/css")
      fileref.setAttribute("href", filename)
      document.getElementsByTagName("head")[0].appendChild(fileref)
   }
*/
};

      function BrowserCheck() {
         var b = navigator.appName;
         if (b == "Netscape") this.b = "NS";
         else if (b == "Microsoft Internet Explorer") this.b = "IE";
         else this.b = b;
         this.v = parseInt(navigator.appVersion);
         this.NS = (this.b == "NS" && this.v>=4);
         this.NS4 = (this.b == "NS" && this.v == 4);
         this.NS5 = (this.b == "NS" && this.v == 5);
         this.IE = (this.b == "IE" && this.v>=4);
         this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
         this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
         if (this.IE5 || this.NS5) this.VER5 = true;
         if (this.IE4 || this.NS4) this.VER4 = true;
         this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
         this.min = (this.NS||this.IE);
      }

      function hideAlert(){
         alertBox.visibility = "hidden";
      }

      function makeAlert(aTitle,aMessage) {
      document.all.alertLayer.innerHTML = "<table border=0 width=100% height=100%>" +
      "<tr height=5><td colspan=4 class=alertTitle>" + "&nbsp;&nbsp;" + aTitle + "</td></tr>" +
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td width=20 align=left></td><td align=left class=alertMessage>" + aMessage + "<BR></td><td width=5></td></tr>" + 
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td colspan=2 align=center><input type=button value='OK' onClick='hideAlert()' class=okButton><BR></td><td width=5></td></tr>" +
      "<tr height=5><td width=5></td></tr></table>";
      thisText = aMessage.length;
      if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

      aWidth = (thisText * 5) + 80;
      aHeight = 120;
         if (aWidth < 150){ aWidth = 200; }
         if (aWidth > 350){ aWidth = 450; }
         if (thisText > 60){ aHeight = 150; }
         if (thisText > 120){ aHeight = 170; }
         if (thisText > 180){ aHeight = 200; }
         if (thisText > 240){ aHeight = 220; }
         if (thisText > 300){ aHeight = 240; }
         if (thisText > 360){ aHeight = 270; }
         if (thisText > 420){ aHeight = 290; }
         if (thisText > 490){ aHeight = 310; }
         if (thisText > 550){ aHeight = 340; }
         if (thisText > 610){ aHeight = 370; }
         
         alertBox.width = aWidth;
         alertBox.height = aHeight;
         alertBox.left = (document.body.clientWidth - aWidth)/2;
         alertBox.top = (document.body.clientHeight - aHeight)/2;
         
         alertBox.visibility = "visible";
      }

      function hideAlert400(){
         alertBox400.visibility = "hidden";
      }

      function makeAlert400(aTitle,aMessage) {
      document.all.alertLayer400.innerHTML = "<table border=0 width=100% height=100%>" +
      "<tr height=5><td colspan=4 class=alertTitle>" + "&nbsp;&nbsp;" + aTitle + "</td></tr>" +
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td width=20 align=left></td><td align=left class=alertMessage>" + aMessage + "<BR></td><td width=5></td></tr>" + 
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td colspan=2 align=center><input type=button value='OK' onClick='hideAlert400()' class=okButton><BR></td><td width=5></td></tr>" +
      "<tr height=5><td width=5></td></tr></table>";
      thisText = aMessage.length;
      if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

      aWidth = (thisText * 5) + 80;
      aHeight = 120;
         if (aWidth < 150){ aWidth = 200; }
         if (aWidth > 350){ aWidth = 450; }
         if (thisText > 60){ aHeight = 150; }
         if (thisText > 120){ aHeight = 170; }
         if (thisText > 180){ aHeight = 200; }
         if (thisText > 240){ aHeight = 220; }
         if (thisText > 300){ aHeight = 240; }
         if (thisText > 360){ aHeight = 270; }
         if (thisText > 420){ aHeight = 290; }
         if (thisText > 490){ aHeight = 310; }
         if (thisText > 550){ aHeight = 340; }
         if (thisText > 610){ aHeight = 370; }
         
         alertBox400.width = aWidth;
         alertBox400.height = aHeight;
         
         alertBox400.visibility = "visible";
      }

      function hideAlert600(){
         alertBox600.visibility = "hidden";
      }

      function makeAlert600(aTitle,aMessage) {
      document.all.alertLayer600.innerHTML = "<table border=0 width=100% height=100%>" +
      "<tr height=5><td colspan=4 class=alertTitle>" + "&nbsp;&nbsp;" + aTitle + "</td></tr>" +
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td width=20 align=left></td><td align=left class=alertMessage>" + aMessage + "<BR></td><td width=5></td></tr>" + 
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td colspan=2 align=center><input type=button value='OK' onClick='hideAlert600()' class=okButton><BR></td><td width=5></td></tr>" +
      "<tr height=5><td width=5></td></tr></table>";
      thisText = aMessage.length;
      if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

      aWidth = (thisText * 5) + 80;
      aHeight = 120;
         if (aWidth < 150){ aWidth = 200; }
         if (aWidth > 350){ aWidth = 450; }
         if (thisText > 60){ aHeight = 150; }
         if (thisText > 120){ aHeight = 170; }
         if (thisText > 180){ aHeight = 200; }
         if (thisText > 240){ aHeight = 220; }
         if (thisText > 300){ aHeight = 240; }
         if (thisText > 360){ aHeight = 270; }
         if (thisText > 420){ aHeight = 290; }
         if (thisText > 490){ aHeight = 310; }
         if (thisText > 550){ aHeight = 340; }
         if (thisText > 610){ aHeight = 370; }
         
         alertBox600.width = aWidth;
         alertBox600.height = aHeight;
         
         alertBox600.visibility = "visible";
      }

      function hideAlert800(){
         alertBox800.visibility = "hidden";
      }

      function makeAlert800(aTitle,aMessage) {
      document.all.alertLayer800.innerHTML = "<table border=0 width=100% height=100%>" +
      "<tr height=5><td colspan=4 class=alertTitle>" + "&nbsp;&nbsp;" + aTitle + "</td></tr>" +
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td width=20 align=left></td><td align=left class=alertMessage>" + aMessage + "<BR></td><td width=5></td></tr>" + 
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td colspan=2 align=center><input type=button value='OK' onClick='hideAlert800()' class=okButton><BR></td><td width=5></td></tr>" +
      "<tr height=5><td width=5></td></tr></table>";
      thisText = aMessage.length;
      if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

      aWidth = (thisText * 5) + 80;
      aHeight = 120;
         if (aWidth < 150){ aWidth = 200; }
         if (aWidth > 350){ aWidth = 450; }
         if (thisText > 60){ aHeight = 150; }
         if (thisText > 120){ aHeight = 170; }
         if (thisText > 180){ aHeight = 200; }
         if (thisText > 240){ aHeight = 220; }
         if (thisText > 300){ aHeight = 240; }
         if (thisText > 360){ aHeight = 270; }
         if (thisText > 420){ aHeight = 290; }
         if (thisText > 490){ aHeight = 310; }
         if (thisText > 550){ aHeight = 340; }
         if (thisText > 610){ aHeight = 370; }
         
         alertBox800.width = aWidth;
         alertBox800.height = aHeight;
         
         alertBox800.visibility = "visible";
      }

      function hideAlert1000(){
         alertBox1000.visibility = "hidden";
      }

      function makeAlert1000(aTitle,aMessage) {
      document.all.alertLayer1000.innerHTML = "<table border=0 width=100% height=100%>" +
      "<tr height=5><td colspan=4 class=alertTitle>" + "&nbsp;&nbsp;" + aTitle + "</td></tr>" +
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td width=20 align=left></td><td align=left class=alertMessage>" + aMessage + "<BR></td><td width=5></td></tr>" + 
      "<tr height=5><td width=5></td></tr>" +
      "<tr><td width=5></td><td colspan=2 align=center><input type=button value='OK' onClick='hideAlert1000()' class=okButton><BR></td><td width=5></td></tr>" +
      "<tr height=5><td width=5></td></tr></table>";
      thisText = aMessage.length;
      if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

      aWidth = (thisText * 5) + 80;
      aHeight = 120;
         if (aWidth < 150){ aWidth = 200; }
         if (aWidth > 350){ aWidth = 450; }
         if (thisText > 60){ aHeight = 150; }
         if (thisText > 120){ aHeight = 170; }
         if (thisText > 180){ aHeight = 200; }
         if (thisText > 240){ aHeight = 220; }
         if (thisText > 300){ aHeight = 240; }
         if (thisText > 360){ aHeight = 270; }
         if (thisText > 420){ aHeight = 290; }
         if (thisText > 490){ aHeight = 310; }
         if (thisText > 550){ aHeight = 340; }
         if (thisText > 610){ aHeight = 370; }
         
         alertBox1000.width = aWidth;
         alertBox1000.height = aHeight;
         
         alertBox1000.visibility = "visible";
      }



