// JavaScript Document -- main.js


// accessible popup window

var newWin = null; 
function popUp(strURL, strType, strHeight, strWidth) { 
 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 var strOptions=""; 
 if (strType=="console") 
   strOptions="resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixedscroll") 
   strOptions="status,scrollbars,screenX=300,left=300,screenY=200,top=50,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="scrollbars,"+ 
     "resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="print_access")
   strOptions="scrollbars,menubar,status,resizable,height="+strHeight+",width="+strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus(); 
}

// bookmark function

function Bookmark(){
 if(window.external){
  window.external.AddFavorite(location.href,document.title);
 }else{
  alert("PC users:\n\tClick 'Ctrl + D' to add this page to your bookmarks.\n\tOpera users: 'Ctrl + T'\n\nMacintosh users: \n\tClick 'Apple + D' to add this page to your bookmarks.\n\tOpera users: 'Apple + T'");
 }
} 

var hst_toggle;
function toggleDiv( id ){
 var o = document.getElementById( id );
 if( o ){
  if( hst_toggle && o != hst_toggle ){
   hst_toggle.style.display = 'none';
  }
  o.style.display = ( o.style.display == 'block' ) ? 'none' : 'block';
  hst_toggle = o;
 }
}

var hst_toggle_plus;
function toggleDivPlus( id, img ){
 var o = document.getElementById( id );
 var plus = document.getElementById( img );
 if( o ){
  if( hst_toggle_plus && o != hst_toggle_plus ){
   hst_toggle_plus.style.display = 'none';
  }
  if( o.style.display == 'block' ){
   o.style.display = 'none';
   plus.setAttribute( 'src', plus.getAttribute( 'src' ).replace( 'minus','plus' ) );   
   plus.setAttribute( 'alt', 'expand' );
  }else{
   o.style.display = 'block';
   plus.setAttribute( 'src', plus.getAttribute( 'src' ).replace( 'plus','minus' ) );   
   plus.setAttribute( 'alt', 'collapse' );
  }
  hst_toggle_plus = o;
 }
}
