function addToFavorites() { 
  var pageName = "American Scientific"; 
  if (window.external.AddFavorite(window.location.href)){
    alert("Added to Favorites"); 
  } else { 
    alert("Sorry! Your browser doesn't support this function."); 
  }
}
function breakout_of_frame()
{
  // see http://www.thesitewizard.com/archive/framebreak.shtml
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}
function imgMenu(imgName,swapType) {
  document[imgName].src = "images/buttons/"+imgName+swapType+".gif";
}


function changeVisibility(onoff,menuname){
  if (onoff==1){
    document.getElementById(menuname).style.visibility="hidden";
  }
  if (onoff==0){
    document.getElementById(menuname).style.visibility="visible";
  }
}

function getImgSize(id){
	var pic = document.getElementById(id);
	var h = pic.offsetHeight;
	var w = pic.offsetWidth;
  	return [h, w];
}

function openPictureWindow(id) { 
      var hwArray= getImgSize(id);
	var imageHeight=hwArray[0];
	var imageWidth=hwArray[1];
      var imgSrc=document.getElementById(id).src;
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left=100, top=100");
	newWindow.document.open();
	newWindow.document.write('<html><title>American Scientific</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src=\"'+imgSrc+'\" width='+imageWidth+' height='+imageHeight+'>');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function openPictureWindow2(imgSrc) { 
  	newWindow = window.open("","newWindow","width= 400,height=400,scrollbars=yes,left=100, top=100");
	newWindow.document.open();
	newWindow.document.write('<html><title>American Scientific</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src=\"'+imgSrc+'\">');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}
