//
// javaScript functions used by all pages
//
// this is the javascript the dreamweaver puts in each page.  you can take it out and
// put it in a single file that the browser downloads only once.  This saves on the ammount
// of files that are actually downloaded by the browser.  It also makes the HTML a little 
// cleaner.  Add this to every page that has the roll overs and remove that javascript that 
// them.


//dreamweaver generated functions

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];}}
}

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;
}

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;
}

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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// custom functions

//	this makes the popup window for any window that is to be to the right of the
//	anchor tags on the works.html page
//
//	p = the path to the html that the popup is made of
//	w = the with of the popup
//	h = the height of the popup
function mau_popup(p,w,h){
	var hi = new Number(h);
	var wi = new Number(w);
	var winLeft = window.screenY;
 	var winTop = window.screenX;
 	if( winLeft == null){
 		// for ie 5.5
		winLeft = window.screenLeft;
		winTop = window.screenTop; 
	}	
	// check it again
	if(winLeft == null){
		// if the browser doesn't know what the screenX or screenTop is
		// then set it absolute
		winLeft = 302;
		winTop = 80;
	}
 	else{
		winLeft += 280;
		winTop += 80;
	}
	paramStr = '"alwaysRaised=true,scrollbars=false,innerWidth=' + wi + ',innerHeight=' + hi + ',width=' + wi + ',height=' + hi + ',top=' + winTop + ',left=' + winLeft + '"';
	mainwindow= window.open(p,'popup',paramStr) 	
	mainwindow.focus();
}

//
// close the popup window
function closeWindow(){
	window.close();
}

//
//
function playSound() {
	ver=parseInt(navigator.appVersion)
	ie4=(ver>3  && navigator.appName!="Netscape")?1:0
	ns4=(ver>3  && navigator.appName=="Netscape")?1:0
	ns3=(ver==3 && navigator.appName=="Netscape")?1:0
 	if(ie4){ 
 		document.all['BGSOUND_ID'].src='hihat.wav';
 	}
 	if((ns4||ns3)	
 			&& navigator.javaEnabled() 
 			&& navigator.mimeTypes['audio/x-wav']
  			&& self.document.copland.IsReady()){
  		self.document.copland.play()
 	}
}


//
//
function stopSound() {
 	
 	ver=parseInt(navigator.appVersion)
	ie4=(ver>3  && navigator.appName!="Netscape")?1:0
	ns4=(ver>3  && navigator.appName=="Netscape")?1:0
	ns3=(ver==3 && navigator.appName=="Netscape")?1:0
 	
 	if(ie4) 
 		document.all['BGSOUND_ID'].src='jsilence.mid';
 	
 	if ((ns4||ns3)
  			&& navigator.javaEnabled()
  			&& navigator.mimeTypes['audio/wav']){
  		self.document.Bach.stop()
 	}
}


