////////////////////////////////////////////////////////////////////////////////////
//
//    ATTENTION: If you see this, you're using a buggy browser. 
//    Please upgrade to NS 4.x or IE 4.x or better.
//
////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////
//  Gopal Ramasammy-Cook, 10 March 2001
////////////////////////////////////////////////////////////////////////////////////

function TextdoFadeIn(divtofade) { 
   if (divtofade.filters.alpha.opacity < 100) { 
      divtofade.filters.alpha.opacity=divtofade.filters.alpha.opacity+1
      setTimeout("TextdoFadeIn()", 50)
   } 
}


function getParameterValue(sName) {
   /* get last loc. of ? right: find first loc. of sName +2 retrieve value before next & */
     var sURL = new String(parent.bottomframe.location); 
     var iQMark= sURL.lastIndexOf('?'); 
     var iLensName=sName.length; //retrieve loc. of sName 
     var iStart = sURL.indexOf('?' + sName +'=') //limitation 1 
           if (iStart==-1) {  //not found at start
               iStart = sURL.indexOf('&' + sName +'=')//limitation 1 
               if (iStart==-1) {//not found at end 
                  return 0; //not found 
               } 
           } 
          iStart = iStart + iLensName + 2; 
          var iTemp= sURL.indexOf('&',iStart); //next pair start 
         if (iTemp ==-1) {//EOF 
               iTemp=sURL.length; 
         } 
         return sURL.slice(iStart,iTemp ) ; 
         sURL=null;//destroy String 
 } 
 

function loadMainAndStatusFrames(strMainURL, strStatusURL) { 
	loadMainFrame(strMainURL);
	loadStatusFrame(strStatusURL);
}

function loadMainFrame(strURL) { 
	parent.main.location.href = strURL;
}

function loadStatusFrame(strURL) { 
	parent.status.location.href = strURL;
}

function loadJSRunFrame(strURL) { 
	parent.jsrun.location.href = strURL;
}


//DHTML Window script- Copyright Dynamic Drive (http://www.dynamicdrive.com)
//For full source code, documentation, and terms of usage,
//Visit http://www.dynamicdrive.com/dynamicindex9/dhtmlwindow.htm

//var dragapproved=false
//var minrestore=0
//var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
  return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showMenuFrame(menu){
  url = "../content/menu-" + menu + ".html"
  if (!ie5&&!ns6)
    //window.open(url,"","width=600,height=320,scrollbars=1");
    showPopupWindow(url,"","width=600,height=320,scrollbars=1"); 
  else{
    document.getElementById("dwindow").style.display=''
    document.getElementById("dwindow").style.width="600px"
    document.getElementById("dwindow").style.height="320px"
    document.getElementById("dwindow").style.left="10px"
    document.getElementById("dwindow").style.zIndex="5"
    document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+260+"px" : iecompattest().scrollTop*1+260+"px"
    document.getElementById("cframe").src=url
  }
}

function closeit(){
  document.getElementById("dwindow").style.display="none"
}


/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var popupWin = null;
function showPopupWindow(mypage){
  if (popupWin != null) {
    popupWin.close();
  }
  myname='popup';
  w=400;
  h=400;
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
  popupWin = window.open(mypage,myname,settings);
}

function showPopupWindowLarge(mypage){
  if (popupWin != null) {
    popupWin.close();
  }
  myname='popup';
  w=750;
  h=500;
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';
  popupWin = window.open(mypage,myname,settings);
}


// Google Internal Site Search script II- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use

function Gsitesearch(curobj){
  var domainroot=curobj.domainroot[curobj.domainroot.selectedIndex].value;
  if (domainroot == "") {
    curobj.q.value=curobj.qfront.value;
  }
  else {
    curobj.q.value="site:"+domainroot+" "+curobj.qfront.value;
  }
}
