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];
		//alert(cached[i].src);
	}
}
	

//  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;
}

//cacheImgs('images/','start.gif','stop.gif');
var iPause = 1
var stop = true;
var start = false;
var pausePic_btn = new Array('images/start.gif','images/stop.gif')
function pausePic(){
	objPause = document['pauseImg'];
	if(iPause == 1){
		start = true;
		stop = false;
		pauseMe();
		objPause.src=pausePic_btn[0];
		iPause = iPause + 1;}
	else if(iPause == 2){
		start = false;
		stop = true;
		runSlideShow();
		objPause.src=pausePic_btn[1];
		iPause = 1;}
}
function pauseMe(){clearTimeout(t);}

function onImgSwap(){
	objPause = document['pauseImg'];
	if(start){objPause.src=pausePic_btn[1]}
	else if(stop){objPause.src=pausePic_btn[3]}
}
function offImgSwap(){
	objPause = document['pauseImg'];
	if(start){objPause.src=pausePic_btn[0]}
	else if(stop){objPause.src=pausePic_btn[2]}
}
//<a href=""javascript:pausePic();"" onmouseover=""onImgSwap();"" onmouseout=""offImgSwap();""><img src=""../../../images/promos/stop_picture_off.gif"" width=76 height=16 border=0 alt="""" name=""pauseImg""></a>

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); 
}

function runSlideShow2() {
	if (document.all) {
		document.images.SlideShow2.style.filter="blendTrans(duration=2)";
		document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration2)";
		document.images.SlideShow2.filters.blendTrans.Apply();
	}
	document.images.SlideShow2.src = preLoad2[h].src;
	if (document.all) {
		document.images.SlideShow2.filters.blendTrans.Play();
	}
	h = h + 1;
	if (h == r) h = 0; 
	q = setTimeout('runSlideShow2()', slideShowSpeed2); 
}

function openWin(url,w,h){
	window.open(url,'PopWindow','width='+w+',height='+h)
}

function openQTPop(url){
	window.open(url,'Audio','width=320,height=100')
}

function openQTvideo(url) {
	window.open(url,"Video","width=320,height=310");
}

// function for showMe

if (ns4) {var visible='show'; var hidden='hide';}
if (ie4up) {var visible='visible'; var hidden='hidden';}
if (ns5up) {var visible='visible'; var hidden='hidden';}

var isMacIE4 = ((navigator.userAgent.indexOf('MSIE')!=-1) && (navigator.userAgent.indexOf('Mac')!=-1) && (navigator.appVersion.charAt(22)==4)) ? true : false;
function browsePop(url){window.open(url,"",'width=175,height=150');}
function showMe(divId){
	if (!(ie4up || ns5up || ns4)) {window.open('http://www.christies.com/LotFinder/search/lotsummary.asp?intSaleID=11258')}
	if (ie4up) {var daRef=document.all[divId].style;}
	if (ns5up) {var daRef=document.getElementById(divId).style;}
	if (ns4) {var daRef=document.layers[divId];}
	if (daRef.visibility==hidden || daRef.visibility=='') {daRef.visibility=visible;}
	else {daRef.visibility=hidden;}}

	
//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


	
//Shockwave Detection function
function shockwaveDetectAxVer(reqVer) {
// For detecting the ActiveX for ie win.
// Requires vbscript function below to be included on
// the page to do the actual checking.
// 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.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);
	      }
	    }
	  }
	  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);
}
//This script needs to go on the page itself for the Shockwave detection to work
/*
<script language="VBScript">
<!-- // You need this visual basic helper to detect ActiveX control
Function VBGetShockwaveVer(i)
  on error resume next
  Dim swControl, swVersion
  swVersion = "0.0"
  
  set swControl = CreateObject("SWCtl.SWCtl." + CStr(i))
  if (IsObject(swControl)) then
    swVersion = CStr(i) + ".0"
    swVersion = CStr(swControl.ShockwaveVersion(""))
  end if

  VBGetShockwaveVer = swVersion
End Function
// -->
</script>
*/
