
          /********************	    JAVASCRIPT		********************/




/***********************************************************************************************************

				 THE IMAGESWAPPER
	
************************************************************************************************************/
function imgswap(pic,imageName){
	
	/*This function takes image names that have "N" for normal or "H" for highlighted as the last
	letter in the image name and also a suffix (".gif" etc) must be present also 
	All images must be in a folder named "media" unless otherwise explicitly stated in all references
	to the image within the HTML page.
	If the image rolled over changed a different image than itself on the same page then add the name of 
	the swapped image as the second parameter (imageName) otherwise leave it blank*/
	

	if (pic.indexOf("media")==-1){
			
			pic = "media/"+pic;
			}
			
	var suffix = pic.slice(pic.length-4,pic.length);
	
  	var picstartpos = pic.indexOf("media/");
	var picname = pic.substring(picstartpos+6,pic.length-5);
	
	
	
	if(typeof(imageName)!="undefined"){
		picname=imageName;}
	
  	if(document.all){
  	
  	
  	
			document.all(picname).src=pic;
  	}
  
  
  	if(document.layers){
  
  	var theString = document.images[picname].src;
  	
  	/*This finds the second to last delimiter to obtain the whole image address for Netscape
  	or just gives it the ../name string which appears to work*/
  	
  	
  	if(pic.charAt(0)=="."){
  		
  	document.images[picname].src=pic;}
  	else{
  	var lastPos = (theString.slice(0,theString.lastIndexOf("/")-1).lastIndexOf("/")+1);
 	document.images[picname].src=theString.slice(0,lastPos)+(pic);
 	}
   
  }
}

/***********************************************************************************************************

				 	OPEN POPUP WINDOW
	
************************************************************************************************************/
// page=*.asp or *.html to open
// h,w,t,l = height,width,top,left
// rs = resizable scrollbars
function openpopup(page,pagename,h,w,t,l,rs,sbs) { 
	
  w = window.open(page, pagename, "height="+h+",width="+w+",top="+t+",left="+l+",resizable="+rs+",scrollbars="+sbs);
  w.focus();
}