///////////////////////////////////////////////
//                 toggler!                  //
///////////////////////////////////////////////

function toggler(objRef, state) {
	objRef.style.backgroundColor = (1 == state) ? '#ffffff' : '#ffffff';
	return;
}

///////////////////////////////////////////////
//                   jump!                   //
///////////////////////////////////////////////

function jump(elmThis) {
    if (document.getElementById)
    {
        var sUrl = elmThis.value;

        if (sUrl != "")
        {
            document.location.href = sUrl;
        }
    }
}

///////////////////////////////////////////////
//                  gopopup!                  //
///////////////////////////////////////////////

function getpopup( theURL, winName, features ) {
	winHandle = window.open( theURL, winName, features );
}

///////////////////////////////////////////////
//                FlashVideo!                //
///////////////////////////////////////////////

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.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}

///////////////////////////////////////////////
//              ActiveX Control              //
///////////////////////////////////////////////

var bo_ns_id = 0;

function startIeFix(){
	if(isIE()){
		document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
	}
}

function endIeFix(){
	if(isIE()){
		document.write('</div>');
		var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
		var theCode = theObject.innerHTML;
		theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
		document.write(theCode);
	}
}

function isIE(){
	// only for Win IE 6+
	// But not in Windows 98, Me, NT 4.0, 2000
	var strBrwsr= navigator.userAgent.toLowerCase();
	if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0) {
		if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6) {
			return false;
		}
		if(strBrwsr.indexOf("win98") > -1 ||
			strBrwsr.indexOf("win 9x 4.90") > -1 ||
			strBrwsr.indexOf("winnt4.0") > -1 ||
			strBrwsr.indexOf("windows nt 5.0") > -1) {
			return false;
		}
		return true;
	}else {
		return false;
	}
}

