//////////////////////////////////////////////////////////////////////////////////////////
// this javascript includes the following functions used throughout the site...
// 
// MM_swapImgRestore() for mouseovers on the home page, restores the original
//		image prior to mousing over
//
// MM_preloadimages() preloads the set of images passed as arguements
//
// MM_findObj() helps get around some of the netscape vs. ie bugs regarding div tags and such
//
// MM_swapImage() changes images for mouseovers
//
// MM_showHideLayers() is for the header bar popup menues.  specifies which layers to show 
// 		or hide on a mouseover.
//
// openWindow(url, name, width, height) creates a popup window with passed parameters as shown
//
// newImage(arg) quickie javascript to declare a new image at the url passed as arg
// 		(is the adobe version of the about MM_ dreamweaver sript)
//
// changeImages() swaps out images for mouseovers and such...
// 		(is the adobe version of the about MM_ dreamweaver sript)
//
// preloadImages() preloads images to set them for mouseover changes and such
// 		(is the adobe version of the about MM_ dreamweaver sript)
//
//////////////////////////////////////////////////////////////////////////////////////////

// declare global variables for javascript
var preloadFlag = false;
var askEmail = "0";

//////////// functions begin ////////////////////////////////////////////
function MM_swapImgRestore() { //v3.0
  var x,a=document.MM_sr; 
  for(var i=0; a&&i<a.length&&(x=a[i])&&x.oSrc; i++) {
	  x.src=x.oSrc;
	  }
}

function MM_preloadimages() { //v3.0
  var d=document; 
  if(d.images) { 
  	if(!d.MM_p) {
		d.MM_p=new Array();
		}
	var j=d.MM_p.length
	var a=MM_preloadimages.arguments; 
	for(var 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_findObj(name, d) { //v3.0
	var p,x;  
	if(!d) {d=document}; 
	if((p=name.indexOf("?"))>0&&parent.frames.length) {
    	d=parent.frames[name.substring(p+1)].document; 
		n=n.substring(0,p);
		}
	if(!(x=d[name]) && d.all) {
		x=d.all[name]
		} 
	for (var i=0; !x&&i<d.forms.length; i++) {
		x=d.forms[i][name]
		}
	for(var i=0; !x&&d.layers&&i<d.layers.length; i++) {
  		x=MM_findObj(name,d.layers[i].document)
		}
	return x;
}

function MM_swapImage() { //v3.0
  var j=0,x;
  var a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(var 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_showHideLayers() { //v3.0
  var v,obj
  var args=MM_showHideLayers.arguments;
  for (var i=0; i<(args.length-2); i+=3) { 
	if ((obj=MM_findObj(args[i]))!=null) { 
	  	v=args[i+2];
	    if (obj.style) { 
			obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; 
			}
	    obj.visibility=v; 
		}
	}
}



function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}