﻿// JScript File
function NewWindow(mypage, myname, w, h, scroll) {
    try {
		win.close ();
	}
	catch(err) {
		
	}
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function noteswindow()
{
	window.open("","popup","width=470,height=540,left=0,top=90,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,copyhistory=0,")
}




function toggleLayer( whichLayer ){  
    var elem, vis;  
    if( document.getElementById ) // this is the way the standards work    
        elem = document.getElementById( whichLayer );  
    else if( document.all ) // this is the way old msie versions work      
        elem = document.all[whichLayer];  
    else if( document.layers ) // this is the way nn4 works    
        elem = document.layers[whichLayer];  
    vis = elem.style;  // if the style.display value is blank we try to figure it out here  
    if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)    
        vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  
    vis.display = (vis.display==''||vis.display=='block')?'none':'block';
    
    
    if( document.getElementById ) // this is the way the standards work    
        elem = document.getElementById("dyn_line");  
    else if( document.all ) // this is the way old msie versions work      
        elem = document.all["dyn_line"];  
    else if( document.layers ) // this is the way nn4 works    
        elem = document.layers["dyn_line"];  
        
    elem.getAttributeNode("class").value = (elem.getAttributeNode("class").value == "expand")?"minus" : "expand";
            
}







//the funtion hasClass and stripe is used to format tables

  // this function is needed to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#F2F8FF";
    var oddColor = arguments[2] ? arguments[2] : "#DEEAF7";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

        // avoid rows that have a class attribute
        // or backgroundColor style
        if (! hasClass(trs[i]) &&
            ! trs[i].style.backgroundColor) {
 		  
          // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");
        
          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {
        
            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
            if (! hasClass(mytd) &&
                ! mytd.style.backgroundColor) {
        
              mytd.style.backgroundColor =
                even ? evenColor : oddColor;
            }
          }
        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }

function stripeAlt(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
    
    // the flag we'll use to determine if we should alternate colours
    // on a particular row.
    var stripeFlag = false;
    
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#F2F8FF";
    var oddColor = arguments[2] ? arguments[2] : "#DEEAF7";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {
        
        // avoid rows that have a class attribute or backgroundColor style
        // unless that class is call "no_stripe"
        if (! hasClass(trs[i]) &&
            ! trs[i].style.backgroundColor) {
 		  
          // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");
        
          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {
        
            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
            if (! hasClass(mytd) &&
                ! mytd.style.backgroundColor) {
        
              mytd.style.backgroundColor =
                even ? evenColor : oddColor;
            }
          }
        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }
