var thestatus = new Array(14);
thestatus[0] = "TEEX : courses, reservations, online courses";
thestatus[1] = "TEEX : curriculum, software, other materials";
thestatus[2] = "TEEX : other, mcttc, nerrtc, osha, tmac, usar";
thestatus[3] = "TEEX : technology transfer & assistance, research";
thestatus[4] = "TEEX : news releases, articles, publications";
thestatus[5] = "TEEX : information, directory, hr, facilities";
thestatus[6] = "TEEX : Search the site";
thestatus[7] = "TEEX : Help";
thestatus[8] = "TEEX : Information about the site";
thestatus[9] = "TEEX : Send us your comments";
thestatus[10] = "TEEX : Copyright information";
thestatus[11] = "TEEX : Go to the TEEX Homepage";
thestatus[12] = "TEEX : Division Information";
thestatus[13] = "TEEX : Course catalog, online courses, custom training";
thestatus[14] = "TEEX : Online Store";

window.defaultStatus="TEEX : The Texas Engineering Extension Service";

function main_over(thediv) {
	parent.window.status = thestatus[thediv];
}

function main_out(thediv) {
}

function sub_over(thelink) {
	parent.window.status = thestatus[thelink];
}



function openRegister() {
	w=800;
	h=540;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  popupWin = window.open('https://teexweb.tamu.edu/olr.asp', 'OLR', 'status=yes,menubar=no,toolbar=no,location=no,scrollbars,width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition)
  popupWin.focus();
}

function openProducts() {
	w=800;
	h=540;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  popupWin = window.open('http://teexweb.tamu.edu/TEEXStore/stores/1/index.aspx?SID=1&', 'TEEXStore', 'status=yes,menubar=no,toolbar=yes,resizable=yes,location=no,scrollbars,width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition)
  popupWin.focus();
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}
