/*
 * default.js
 *
 * contains scripting for continentalline.org
 *
 * history:
 *    22 feb 05: file created - sjr
 *    11 mar 05: file updated - sjr
 *
 */

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
  if (myWidth < 750) {
    //window.alert('Width less than 750');
    document.getElementById("rightnav").style.display ="none";
    //document.getElementById("strapline").style.display ="none";
  }
     
}

var openQuestion = "";     // open question number (if any)

function showQuestion( ID ) {
   if( openQuestion == "" ) {
      document.getElementById( "qa" + ID ).style.background = "transparent";
      document.getElementById(  "a" + ID ).style.display = "block";
      openQuestion = ID;
      return;
   }

   if( openQuestion == ID ) {
      if( document.getElementById( "a" + ID ).style.display == "block" ) {
         document.getElementById( "a" + ID ).style.display = "none";
         document.getElementById( "qa" + ID ).style.background = "transparent";
         openQustion = "";
      } else {
         document.getElementById( "a" + ID ).style.display = "block";
         document.getElementById( "qa" + ID ).style.background = "transparent";
         openQustion = ID;
      }
      return;
   }

   document.getElementById( "qa" + openQuestion ).style.background = "transparent";
   document.getElementById( "a" + openQuestion ).style.display = "none";

   document.getElementById( "a" + ID ).style.display = "block";
   document.getElementById( "qa" + ID ).style.background = "transparent";

   openQuestion = ID;

}


function popUp( strURL, strType, strHeight, strWidth ) {
   var strOptions = "";
   if( strType == "console" ) { strOptions = "resizable,scrollbars,height="+strHeight+",width="+strWidth; }
   if( strType == "fixed" ) {   strOptions = "status,height="+strHeight+",width="+strWidth; }
   if( strType == "elastic" ) { strOptions = "toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth; }
   window.open( strURL, 'newWin', strOptions );
}