// Begin
// to insert current date - used in footers to always have current copyright
function currentdate(){
var cdate = new Date();
var cMonth = cdate.getMonth() +1;
var cDay = cdate.getDate();
var cYear = cdate.getYear();
if (cYear < 2000){cYear=cYear+1900}
document.write("Current date: " + cMonth + "/" + cDay + "/" + cYear + 
"");
}

// to insert copyright + current year - used in footer
function copyright(){
var cdate = new Date();
var cYear = cdate.getYear();
if (cYear < 2000){cYear=cYear+1900}
document.write("Copyright &copy; 2003- " + cYear);
}

// insert footer with copyright
function kfooter(){
var cdate = new Date();
var cYear = cdate.getYear();
if (cYear < 2000){cYear=cYear+1900}
document.write('<div class=\"footer\"><img src="images/hr.gif"><br>&nbsp;<br>| Copyright &copy; 2003 - ' + cYear + '&nbsp;&nbsp;<a href=\"http://pslc.ws\" target=\"_blank\">Polymer Science Learning Center</a> |<br>| <a href="http://www.psrc.usm.edu" target="blank">Department of Polymer Science</a> | <a href=\"http://www.usm.edu\" target=\"_blank\">The University of Southern Mississippi</a> |</div><hr>');
document.write('');
}

// <!-- PART OF script below and many more are available free online at -->
// <!-- The JavaScript Source!! http://javascript.internet.com -->

function closeit(){self.close();}

function Bbig(page) {
OpenWin = this.open(page, "CtrlWindow","height=800,width=1000,left=20,top=20,scrollbars=yes,resizable=yes,location=no");
}
function Huge(page) {
OpenWin = this.open(page, "CtrlWindow", "height=520,width=750,left=120,top=120,scrollbars=yes");
}
function Big(page) {
OpenWin = this.open(page, "CtrlWindow", "height=450,width=650,left=40,top=40,scrollbars=yes");
}
function Start(page) {
OpenWin = window.open(page, "big", "height=420,width=580,left=80,top=80,scrollbars=yes");
OpenWin.focus();
}
function Start_tall(page) {
OpenWin = window.open(page, "CtrlWindow", "height=600,width=550,left=400,top=20,scrollbars=auto,resizable=yes");
}
function Startlittle(page) {
OpenWin = window.open(page, "little", "height=100,width=300,scrollbars=yes,left=0,top=0");
OpenWin.focus();
}
function Startmedium(page) {
OpenWin = window.open(page, "medium", "height=200,width=480,scrollbars=yes,left=0,top=0");
OpenWin.focus();
}
function Start_small(page) {
OpenWin = this.open(page, "CtrlWindow", "height=300,width=600,left=120,top=120,scrollbars=yes,resizable=yes");
}
function Start_verysmall(page) {
OpenWin = this.open(page, "CtrlWindow", "height=260,width=200,left=120,top=120,scrollbars=yes,resizable=yes");
}

// resizes the current window to fit the entire screen:
// window.moveTo(0,0);
// window.resizeTo(screen.width,screen.height);
// resizeBy(x,y) Resizes a window by the specified amount in pixels 
// resizeTo(x,y) Resizes a window to the specified pixel values
// doesn't work as written - perhaps depends on browser

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

// Functions that swap images. //
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
//added to older version of script
function MM_preloadImages() { //v3.0
 var d=document; 
 if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
// The following scripts were for other sites at pslc.ws

//Capture the onblur event so clicking on another window can execute a javascript.
//This would be used to close a window in body tag.
captureEvents(onblur);
//The following code sets up a timer to close a window after a specified interval that
//is passed to startclock in the body tag.
var timerID = null
var timerRunning = false
function stopclock(){
if(timerRunning)
clearInterval(timerID)
timerRunning = false
}
function startclock(seconds){
// Make sure the clock is stopped
stopclock()
timerID = setInterval("closeit()",1000*seconds)
timerRunning = true
}

// End -->
