<!--

function newImage(arg) {
	if (!DHTML) return;
	rslt = new Image();
	rslt.src = arg;
	return rslt;
}




var clipTop = 0;
var clipWidth = 777;
var clipBottom = 130;
var clipLeft = 0;
var clipRight = 777;
var topper = 183;
var topper2 = 0;
var lyrheight = 0;
var lyrwidth = 0;
var imgs = new Array();
var time,time2,amount,theTime,theHeight,theWidth,DHTML;
var qad;
var fadein=false;

window.onload = onPageLoad;

function getObj(name){
  if (document.getElementById){
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all){
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers){
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

// show or hide the layer
function vis(lyrname,val)
{
	if (!DHTML) return;
	var f = new getObj(lyrname);
	f.style.visibility = val;
}

function init(){
	DHTML = (document.getElementById || document.all || document.layers)
	if (!DHTML) return;
	var x = new getObj('slides');
	if (document.layers){
		lyrheight = x.style.clip.bottom;
		lyrwidth = x.style.clip.right;
		lyrheight += 20;
		lyrwidth += 20;
		x.style.clip.top = clipTop;
		x.style.clip.left = 0;
		x.style.clip.right = clipWidth;
		x.style.clip.bottom = clipBottom;
	}
	else if (document.getElementById || document.all){
		lyrheight = x.obj.offsetHeight;
		lyrwidth = x.obj.offsetWidth;
		x.style.clip = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
	}

	var bluebox = newImage('images/bluebox.gif');
	var whitebox = newImage('images/whitebox.gif');

	for (var i=1;i<12;i++) {
		var num;
		if (i<10) {
			num = '0'+i;
		} else {
			num = '' + i;
		}
		var barID = 'timebar_' + num;
		imgs[i] = document.getElementById(barID);
		imgs[i].onmouseover = mouseGoesOver;
		imgs[i].onmouseout = mouseGoesOut;
	}

	//qad = document.getElementById('quest_ad');
	//qad.onmouseover = mouseGoesOverQ;
	//qad.onmouseout = mouseGoesOutQ;
}

function scrollayer(layername,amt,tim){
	if (!DHTML) return;
	thelayer = new getObj(layername);
	if (!thelayer) return;
	amount = amt;
	theTime = tim;
	//realscroll();
	hrzscroll();
}

function hrzscroll(){
	if (!DHTML) return;
	clipLeft += amount;
	clipRight += amount;
	topper2 -= amount;
	if (clipLeft < 0 || clipRight > lyrwidth){
		clipLeft -= amount;
		clipRight -= amount;
		topper2 += amount;
		return;
	}else{
		//stop trying to scroll since we are at a boundary anyway.
		stopScroll();
	}
	if (document.getElementById || document.all){
		clipstring = 'rect('+clipTop+' '+clipRight+' '+clipBottom+' '+clipLeft+')'
		thelayer.style.clip = clipstring;
		thelayer.style.left = topper2;
	} else if (document.layers){
		thelayer.style.clip.left = clipLeft;
		thelayer.style.clip.right = clipRight;
		thelayer.style.left = topper2;
	}
	time = setTimeout('hrzscroll()',theTime);
	//time = setInterval('hrzscroll()',theTime);

}

function mouseGoesOver() {
	var num = this.id.substring(this.id.lastIndexOf('_')+1);
	this.src = 'images/bluebox.gif'; //mouseOvers[this.number].src;
	if (num < 6){
		scrollayer('slides',-2,0.5)
	} else if (num > 6){
		scrollayer('slides',2,0.5)
	}
}

function mouseGoesOut() {
	this.src = 'images/whitebox.gif'; //mouseOuts[this.number].src;
	stopScroll();
}

function stopScroll()
{
	if (time) clearTimeout(time);
}

function preScroll(){
	scrollayer('slides',1,0.5);
}

function onPageLoad(){
	//init scroll clipping etc.
	init();
	//un-hide the clipped layer
	vis('slides','visible');
	//vis('quest_ad','visible');
	// sleep then slowly scroll to reveal 10/11 thumbs	
	setTimeout('preScroll()', 700);
	//time2 = setInterval('fadeInOutQAD()',100);
}

// scroll thumbnails and highlight timebar segment
function changeScroll(numbar,mylayer,myspeed,mytimeoot){
	imgs[numbar].src='images/bluebox.gif';
	scrollayer(mylayer,myspeed,mytimeoot);
}

// stop scroll and un-highlight timebar segment
function changeScrollOut(numbar){
	imgs[numbar].src='images/whitebox.gif';
	stopScroll();
}


function mouseGoesOverQ() {
	setopacity(50);
}

function mouseGoesOutQ() {
	setopacity(20);
}

function setopacity(amount){
	if (document.all) qad.filters.alpha.opacity = amount;
	else if (document.getElementById) qad.style.MozOpacity = amount/100;
}

function fadeInQAD() {
	var myopac;
	if(document.all){
		myopac = qad.filters.alpha.opacity;
	}
	else if(document.getElementById) {
		myopac = qad.style.MozOpacity * 100;
	}
	if (myopac < 100) {
		setopacity(myopac+2);
	} else if (time2) clearInterval(time2);
}

function fadeInOutQAD() {
	var myopac;
	if(document.all){
		myopac = qad.filters.alpha.opacity;
	}
	else if(document.getElementById) {
		myopac = qad.style.MozOpacity * 100;
	}
	if(!fadein){
		if (myopac < 100) {
			setopacity(myopac+2);
		} else {
			fadein = true;
		}
	} else {
		if (myopac > 20) {
			setopacity(myopac-2);
		} else if (time2){
			clearInterval(time2);
		}
	}
}

function fadeOutQAD() {
	var myopac;
	if(document.all){
		myopac = qad.filters.alpha.opacity;
	}
	else if(document.getElementById) {
		myopac = qad.style.MozOpacity * 100;
	}
	if (myopac > 0) {
		setopacity(myopac-2);
	} else if (time2) clearInterval(time2);
}

function Start2(page) {
OpenWin = this.open(page, "CtrlWindow2", "toolbar=yes,menubar=no,location=no,scrollbars=yes,resizable=yes,width=750,height=400,left=0,top=0,screenX=100,screenY=50");
OpenWin.focus();
}

//End hiding script from old browsers-->
