// Lisa, use the shortname versions of these functions (below), then we'll phase these old ones out

function popupWindow(theURL) {
window.open(theURL,'popup','scrollbars=yes,resizable=yes,width=550,height=450')
}
function popupGlossary(theURL) {
window.open(theURL,'popup','scrollbars=yes,resizable=yes,width=250,height=250')
}
function popupVisual(theURL) {
window.open(theURL,'popup','scrollbars=yes,resizable=yes,width=800,height=600')
}
function popupLab(theURL) {
var labWin = window.open(theURL,'popup','scrollbars=yes,resizable=yes,width=900,height=800')
labWin.focus();
}
function popupFootnotes(theURL) {
window.open(theURL,'popup','scrollbars=yes,resizable=yes,width=350,height=250')

}

function P7_swapClass(){ //v1.4 by PVII
 var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;
 if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
  for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
  if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
  }else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}
}

function P7_writeStyles(op,a){ //v1.5 by PVII
if(op==0||document.getElementById){var tS="<sty"+"le type=\"text/css\">";
tS+=a+"<"+"/sty"+"le>";document.write(tS);document.close();}
}
P7_writeStyles(1,'.closed ul{ display:none;}.open ul{ display:block;}');
P7_writeStyles(1,'.closed ol{ display:none;}.open ol{ display:block;}');

//// shortname only version of popup functions - suggested by Don Jan '07

function glossary(invariant) {
    var theURL = "/courses/envsci/glossary/definition.php?invariant=" + invariant;
    var glossaryWin = window.open(theURL,'glossary','scrollbars=yes,resizable=yes,width=250,height=250')
	glossaryWin.focus();
}
function gloss(invariant) {
    var theURL = "/courses/envsci/glossary/definition.php?invariant=" + invariant;
    var glossWin = window.open(theURL,'gloss','scrollbars=yes,resizable=yes,width=250,height=250')
	glossWin.focus();
}
function visual(shortName) {
    var theURL = "/courses/envsci/visual/visual.php?shortname=" + shortName;
    var visualWin = window.open(theURL,'visual','scrollbars=yes,resizable=yes,width=800,height=600')
	visualWin.focus();
}
function vis(shortName) {
    var theURL = "/courses/envsci/visual/visual.php?shortname=" + shortName;
    var visWin = window.open(theURL,'vis','scrollbars=yes,resizable=yes,width=800,height=600')
	visWin.focus();
}
function scientist(shortName) {
    var theURL = "/courses/envsci/scientist/scientist.php?shortname=" + shortName;
    var scientistWin = window.open(theURL,'scientist','scrollbars=yes,resizable=yes,width=800,height=600')
	scientistWin.focus();
}
function sci(shortName) {
    var theURL = "/courses/envsci/scientist/scientist.php?shortname=" + shortName;
    var sciWin = window.open(theURL,'sci','scrollbars=yes,resizable=yes,width=800,height=600')
	sciWin.focus();
}
function footnote(shortName, unitNum) {
    var theURL = "/courses/envsci/footnote/unit" + unitNum + ".html#" + shortName;
    footnoteWin = window.open(theURL,'footnote','scrollbars=yes,resizable=yes,width=350,height=300')
	footnoteWin.focus();
}
function beyond(unitNum) {
    var theURL = "/courses/envsci/beyond/bhp" + unitNum + ".html";
    var beyondWin = window.open(theURL,'beyond','scrollbars=yes,resizable=yes,width=800,height=600')
	beyondWin.focus();
}
function video(unitNum) {
    var theURL = "/courses/envsci/video/video.php?unit="  + unitNum;
   var videoWin = window.open(theURL,'video','scrollbars=yes,resizable=yes,width=550,height=400')
   videoWin.focus();
}
function transcript(shortname) {
    var theURL = "/courses/envsci/scientist/transcripts/" + shortname + ".html";
    var beyondWin = window.open(theURL,'transcript','scrollbars=yes,resizable=yes,width=800,height=600')
	beyondWin.focus();
}
function animation(shortName) {
	var theURL = "/courses/envsci/visual/animation.php?shortname=" + shortName;
var animationWin = window.open(theURL,'popup','scrollbars=yes,resizable=yes,width=400,height=400')
animationWin.focus();
}
function anim(shortName) {
	var theURL = "/courses/envsci/visual/animation.php?shortname=" + shortName;
var animWin = window.open(theURL,'anim','scrollbars=yes,resizable=yes,width=400,height=400')
animWin.focus();
}