/* 
 Al Payson Scripts File
*/
function xCoord(id) {
	object=document.getElementById(id);
	xc=parseInt(object.style.left);
	return xc;
	}	
function yCoord(id) {
	object=document.getElementById(id);
	yc=parseInt(object.style.top);
	return yc;
	}
function hideIt(id) {
	object=document.getElementById(id);
	object.style.visibility="hidden";
	}
function placeIt(id, x, y) {
	object=document.getElementById(id);
	object.style.left=x+"px";
	object.style.top=y+"px";
	}
function shiftIt(id, dx, dy) {
	object=document.getElementById(id);
	object.style.left=xCoord(id)+dx+"px";
	object.style.top=yCoord(id)+dy+"px";
	}
function showIt(id) {
	object=document.getElementById(id);
	object.style.visibility="visible";
	}	
function winWidth() {
	if (window.innerWidth) return window.innerWidth;
	else if (document.documentElement) return document.documentElement.offsetWidth;
	else if (document.body.clientWidth) return document.body.clientWidth;
	}
function winHeight() {
	if (window.innerHeight) return window.innerHeight;
	else if (document.documentElement) return document.documentElement.offsetHeight;
	else if (document.body.clientHeight) return document.body.clientHeight;
	}
function getFontSize(id) {
	object=document.getElementById(id);
	fs=parseInt(object.style.fontSize);
	return fs;
	}
function changeFontSize(id, dfs) {
	fs=getFontSize(id);
	setFontSize(id, (fs+dfs));
	}
function setFontSize(id, fs) {
	object=document.getElementById(id);
	object.style.fontSize= fs +"pt";
	}
	var HomeOff= new Image();
		HomeOff.src="images/buttons/HomeButtWh.jpg"
	var HomeOn= new Image();
		HomeOn.src="images/buttons/HomeButtRed.jpg"		
	var AudioOff= new Image();
		AudioOff.src="images/buttons/AudioButtWh.jpg"
	var AudioOn= new Image();			
		AudioOn.src="images/buttons/AudioButtRed.jpg"
	var BioOff= new Image();
		BioOff.src="images/buttons/BioButtWh.jpg"
	var BioOn= new Image();
		BioOn.src="images/buttons/BioButtRed.jpg"	
	var SchedOff= new Image();
		SchedOff.src="images/buttons/SchedButtWh.jpg"
	var SchedOn= new Image();
		SchedOn.src="images/buttons/SchedButtRed.jpg"
	var PicsOff= new Image();
		PicsOff.src="images/buttons/PicsButtWh.jpg"
	var PicsOn= new Image();
		PicsOn.src="images/buttons/PicsButtRed.jpg"
	var EbayOff= new Image();
		EbayOff.src="images/buttons/EbayButtWh.jpg"
	var EbayOn= new Image();
		EbayOn.src="images/buttons/EbayButtRed.jpg"
	var BJBOff= new Image();
		BJBOff.src="images/buttons/BJBButtWh.jpg"
	var BJBOn= new Image();
		BJBOn.src="images/buttons/BJBButtRed.jpg"
	var JFOff= new Image();
		JFOff.src="images/buttons/JFButtWh.jpg"
	var JFOn= new Image();
		JFOn.src="images/buttons/JFButtRed.jpg"
	var BlueLawOff= new Image();
		BlueLawOff.src="images/buttons/BlueLawButtWh.jpg"
	var BlueLawOn= new Image();
		BlueLawOn.src="images/buttons/BlueLawButtRed.jpg"
	var DEPOff= new Image();
		DEPOff.src="images/buttons/DEPButtWh.jpg"
	var DEPOn= new Image();
		DEPOn.src="images/buttons/DEPButtRed.jpg"
	var USCOff= new Image();
		USCOff.src="images/buttons/USCButtWh.jpg"
	var USCOn= new Image();
		USCOn.src="images/buttons/USCButtRed.jpg"
	var EmailOff= new Image();
		EmailOff.src="images/buttons/EmailButtWh.jpg"
	var EmailOn= new Image();
		EmailOn.src="images/buttons/EmailButtRed.jpg"
        var LinksOff= new Image();
                LinksOff.src="images/buttons/LinksButtWh.jpg"
        var LinksOn= new Image();
                LinksOn.src="images/buttons/LinksButtRed.jpg"
function on(img) {
    document[img].src = eval(img+'on').src;
    }
function off(img) {
    document[img].src = eval(img+'off').src;
    }

function openNewSmWindow(url){
window.open(url,"newsmwindow","width=500,height=400");
}
function openNewLgWindow(url){
window.open(url,"newlgwindow","width=800,height=800,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes");
}
  
function nameDefined(ckie,nme)
{
   var splitValues
   var i
   for (i=0;i<ckie.length;++i)
   {
      splitValues=ckie[i].split("=")
      if (splitValues[0]==nme) return true
   }
   return false
}

function delBlanks(strng)
{
   var result=""
   var i
   var chrn
   for (i=0;i<strng.length;++i) {
      chrn=strng.charAt(i)
      if (chrn!=" ") result += chrn
   }
   return result
}
function getCookieValue(ckie,nme)
{
   var splitValues
   var i
   for(i=0;i<ckie.length;++i) {
      splitValues=ckie[i].split("=")
      if(splitValues[0]==nme) return splitValues[1]
   }
   return ""
}
function insertCounter() {
 readCookie()
 displayCounter()
}
 function displayCounter() {
 document.write('<H5 ALIGN="CENTER">')
 document.write("You've visited this page ")
 if(counter==1) document.write("the first time.")
 else document.write(counter+" times.")
 document.writeln('</H3>')
 }
function readCookie() {
 var cookie=document.cookie
 counter=0
 var chkdCookie=delBlanks(cookie)  //are on the client computer
 var nvpair=chkdCookie.split(";")
 if(nameDefined(nvpair,"pageCount"))
 counter=parseInt(getCookieValue(nvpair,"pageCount"))
 ++counter
 var futdate = new Date()
 var expdate = futdate.getTime()
 expdate += 3600000 * 24 *30  //expires in 1 hour
 futdate.setTime(expdate)

 var newCookie="pageCount="+counter
 newCookie += "; expires=" + futdate.toGMTString()
 window.document.cookie=newCookie
}
              