var ns4=(document.layers)?true:false;
var ie4up=(document.all)?true:false;
var ns5up=(document.getElementById && !ie4up)?true:false;

//  the first parameter passed must be the full image path up to and including the last '/'
//  after that list all images with extension (.gif, .jpg) and they will be cached
function cacheImgs(){
	cached = new Array();
	for (var i=1;i<arguments.length;i++){
		cached[i]=new Image();
		cached[i].src = arguments[0] + arguments[i];
	}
}
	

//  for rollovers - the first parameter passed should be the name of the image followed by the rollover image with extension (.gif, .jpg)   
function imgSwap(nom,pik){
	var end_path;
	var image_path;
	end_path=document[nom].src.lastIndexOf('/') + 1;
		image_path=document[nom].src.substring(0,end_path);
		document[nom].src = image_path + pik;
}

function runSlideShow() {
	if (document.all) {
		document.images.SlideShow.style.filter="blendTrans(duration=2)";
		document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.images.SlideShow.src = preLoad[j].src;
	if (document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
	}
	j = j + 1;
	if (j == p) j = 0; 
	t = setTimeout('runSlideShow()', slideShowSpeed); 
}

//Flash Detector
var flash3Installed = false;		// boolean. true if flash 3 is installed
var flash4Installed = false;		// boolean. true if flash 4 is installed
var flash5Installed = false;		// boolean. true if flash 5 is installed

// write vbscript detection if we're on ie win

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;	// true for ie
var isMac = (navigator.appVersion.indexOf("Mac") != -1) ? true : false; // true for mac
var isIEMac4 = (navigator.userAgent.charAt(navigator.userAgent.indexOf('MSIE')+5)<5)?true:false;
if(isIE && !isMac){ // only write vbscript on ie win
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

//now we will test for flash in netscape

if (navigator.plugins){								// does navigator.plugins exist?
	if (navigator.plugins["Shockwave Flash 2.0"] 	// if yes then is Flash 2 installed?
	|| navigator.plugins["Shockwave Flash"]){		// or is flash 3+ installed?
		// set convenient references to flash 2 and the plugin description and version
		var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
		var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
		var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		flash3Installed = (flashVersion == 3)?true:false;
		flash4Installed = (flashVersion == 4)?true:false;
		flash5Installed = (flashVersion == 5)?true:false;}}	

if(isIEMac4){flash5Installed = true;}

//if (!(flash3Installed || flash4Installed || flash5Installed)){ // if no flash

function nsCssFix() {document.location=document.location;}
if ((ns4) && (parseInt(navigator.appVersion)==4)){window.onresize=nsCssFix;}

function shockwaveDetectAxVer(reqVer) {
// For detecting the ActiveX for ie win.
// Requires vbscript function above.
// Returns version found or 0.0.
// This function can return a boolean or a floating point value.
// If you supply a reqVer value (number) it will return true or false
// depending on if that version or higher was found.
// If you don't supply a parameter it will return the found version number.
	
	  // this function returns a floating point value which should be the version of the Shockwave control or 0.0
	  // this function should only be called from Internet Explorer for Windows
	  if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && !(((navigator.appVersion.charAt( navigator.appVersion.indexOf("MSIE")+5 )) <= 4 ) && isMac) && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)){
	   	// loop backwards through the versions until we get a bite
	    for (i=8;i>0;i--) {
	      versionString = VBGetShockwaveVer(i);
	      if (versionString != "0.0") {
	        // if we get 1.0 we assume it is actually 6.0
	        versionNum = (versionString == "1.0" ? 6.0 : parseFloat(versionString));
			return (reqVer ? versionNum >= reqVer : versionNum);
	      }
	    }
	  }
	  //cannot detect IE 4 or less on the Mac, so return true or version number and let the user figure it out.
	  else if( ( navigator.userAgent.indexOf("MSIE") >=0 ) && ( navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE")+5) <= 4 ) && (isMac) ){
	  	return (reqVer ? true : reqVer)
	  }
	  else if(navigator.mimeTypes && navigator.mimeTypes["application/x-director"] && navigator.mimeTypes["application/x-director"].enabledPlugin) {
		if(navigator.plugins && navigator.plugins["Shockwave for Director"] && (versionIndex = navigator.plugins["Shockwave for Director"].description.indexOf(".")) != - 1){
	    	var versionString = navigator.plugins["Shockwave for Director"].description.substring(versionIndex-1,versionIndex);
	    	var subVersionString = navigator.plugins["Shockwave for Director"].description.substring(versionIndex+1,versionIndex+2);
	    	versionIndex = parseInt( versionString );
			subVersionIndex = parseInt(subVersionString);
			versionNum = versionIndex+'.'+subVersionIndex;
			return (reqVer ? versionNum >=reqVer : versionNum);
	    }
	  }
	return (reqVer ? false : 0.0);
}


function openPop(popPage,popHeight){
	window.open(popPage,"DreesmannPop","width=420,height="+popHeight+",scrollbars=no,menu=no")
}
