// JScript source code
var msec = 0;			// number of milliseconds to pause shink or expand
var e_tym;				// timer for expand
var s_tym;				// timer for shrink
var tymr;				// timer for previous or next
var allow = true;		// this prevents for a previous or next command from being
						// while a previous or next command is in process
var CurrentImg;
var CurrentID;

function SlideShowImage(id, url, src, alt, prev, next, duration, flashid, ext) {
	this.id = id;
	this.url = url;
	this.src = src;
	this.alt = alt;
	this.prev = prev;
	this.next = next;
	this.duration = duration;
	this.flashid = flashid;
	this.ext = ext;
}

function next(){
	if(allow){
		window.status=window.status+"|";
		var flash_tag='';
		
		allow = false;
		clearTimeout(tymr);
		setNextPrev(CurrentImg);
		id2 = eval(CurrentID.next);

		document.getElementById('iFrame4Mac').src='SlideShowFrame.cfm?id=' + id2.id + '&src=' + id2.src + '&url=' + escape(id2.url) + '&ext=' + id2.ext + '&alt=' + id2.alt;
		
		CurrentImg = NextImg;
		CurrentID = eval(id2);
		tymr = setTimeout('next()', CurrentID.duration * 1000);
		allow = true;
	}
}

function previous(){
	if(allow){
		var flash_tag='';

		allow = false;
		clearTimeout(tymr);
		setNextPrev(CurrentImg);
		id2 = eval(CurrentID.prev);

		document.getElementById('iFrame4Mac').src='SlideShowFrame.cfm?id=' + id2.id + '&src=' + id2.src + '&url=' + escape(id2.url) + '&ext=' + id2.ext;
		
		CurrentImg = PrevImg;
		CurrentID = eval(id2);
		tymr = setTimeout('previous()', CurrentID.duration * 1000);
		allow = true;
	}
}
function setNextPrev(id){
	switch(id){
		case 'img2':
			CurrentImg = 'img2'
			PrevImg = 'img1';
			NextImg = 'img3';
			PrevHref = 'href1';
			NextHref = 'href3';
		break
		case 'img3':
			CurrentImg = 'img3'
			PrevImg = 'img2';
			NextImg = 'img1';
			PrevHref = 'href2';
			NextHref = 'href1';
		break
		default:
			CurrentImg = 'img1'
			PrevImg ='img3';
			NextImg = 'img2';
			PrevHref = 'href3';
			NextHref = 'href2';
		break
	}
}

function startFlash(flashid){
	document.getElementById("JSFlash").innerHTML = eval(flashid + '_swf');
}

function stopFlash(oFlsh){
	document.getElementById("JSFlash").innerHTML = '';
}

function playFlash(oFlsh){
	document.getElementById("JSFlash").innerHTML = eval(flashid + '_swf');
}

function thisFlash(sID) {
	if (navigator.appName.indexOf ("Microsoft") !=-1) {
    	return window.document.forms[0][sID];
  	} else {
    	return document[sID];
  	}
}

function flashLoaded(oFlash) {
	if(typeof(oFlash) != "undefined"){
		return 100 //oFlash.PercentLoaded() == 100;
	}else {
		return 0 //false;
	}
}
function loadDestination(sURL) {
	sURL=removeWhiteSpace(sURL);
	if(sURL!=""){
		top.location=sURL;
	}
}


//Support Functions
//===================
function removeWhiteSpace(sInput) {
	if (typeof sInput != "string") { 
   		return sInput; 
	} else {
		return sInput.replace(/\s/g, "");	
	}
} 

function drawFlash(url,id,src){
	var str='';
	str =  '<a id="href2" target="_top" href="' + url + '" onMouseDown="return springBoard(this,\'slideshow\');"><img id="' + id + '" title="" src = "trans.gif" style="position: absolute; top: 0px; left: 0px; width: 524px; height: 224px; border: none;" /></a>'
	str += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="524" height="224" id="' + id + '">'
	str += '<param name="allowScriptAccess" value="sameDomain" />'
	str += '<param name="movie" id="flash' + id + '" value="' + src + '" />'
	str += '<param name="quality" value="high" />'
	str += '<param name="wmode" value="transparent" />'
	str += '<param name="bgcolor" value="#999999" />'
	str += '<embed src="' + src + '" quality="high" wmode="transparent" bgcolor="#ffffff" name="' + id + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" style="position: absolute: top: 0px; left: 0px; width: 524px; height: 224px;" />'
	str += '</object>'
	document.write(str);
}