/* javascripts.js */

/////////////////
// open popup window for images
/////////////////

function openWindow(theURL,winName,myWidth,myHeight,isCenter) { //v3.0
  var features="";
  if(window.screen)if(isCenter)if(isCenter=="true"){
	var myLeft = (screen.width-myWidth)/2;
	var myTop = (screen.height-myHeight)/2;
	features+=(features!='')?',':'';
	features+=',scrollbars=no,resizable=no';
	features+=',left='+myLeft+',top='+myTop;
  }
  var winName = "Image";
  
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

////////////////////////
//show/hide a layer with display:none;
///////////////////////
function toggle( targetId ){
  if (document.getElementById){
    target = document.getElementById( targetId );
     if (target.style.display == "none"){
      target.style.display = "";
     } else {
      target.style.display = "none";
     }
   }
}

/////////////////////
// CHECK FOR EXTERNAL LINKS
////////////////////
function externalLinks() {
        if (!document.getElementsByTagName) return;
        var anchors = document.getElementsByTagName("a");
        for (var i=0; i<anchors.length; i++) {
                var anchor = anchors[i];
                if (anchor.getAttribute("href") &&
                anchor.getAttribute("rel") == "external")
                anchor.target = "_blank";
        }
}
window.onload = externalLinks;
