// ------------------------------------------------------------------
// This one is temporary
function changeBG(backgroundname) {
		document.body.id = backgroundname;
}

// ------------------------------------------------------------------

function picChg(theImage, theImageToReplace)
{
	document.getElementById(theImageToReplace).src = 'pub/images/' + theImage;
}

// ------------------------------------------------------------------
// FUNCTION: Makes div holding video visible, and changes background image 

	function load_video(video) {
		document.body.id = 'watch_movie'; //change the background image
		document.getElementById('video_holder').style.visibility = "visible"; //make the SWF div visible
	 
		// load video here... some how
		var mc = getFlashMovieObject('SimexPlayer');  //get the correct object for the SWF file

		if (navigator.appName.toUpperCase().match(/MICROSOFT INTERNET EXPLORER/) != null) {
			alert('The Video you are about to watch is copyrighted material, please do not copy.');
		}
		mc.playVideo(video); 
		
	}
	
	 
	function getFlashMovieObject(movieName) {
	 if (window.document[movieName]) {
		return window.document[movieName];
	 }
	 if (navigator.appName.indexOf("Microsoft Internet")==-1) {
		if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; 
	 }
	 else {
		return document[movieName];
	 }
	}



// ------------------------------------------------------------------

	function turnOn(imgName) {
		if (document.images) {
			document[imgName].src = eval(imgName + 'on.src');
		}
	}
	
	function turnOff(imgName) {
		if (document.images) {
			document[imgName].src = eval(imgName + 'off.src');
		}
	}
	
	function funnel_win(theURL,winName,width,height) {
		var myWin = window.open(theURL,winName,'width=' + width + ',height=' + height + ',top=' + (screen.height-height)/2 + ',left=' + (screen.width-width)/2 + ',scrollbars=yes');
	}

	function MM_findObj(n, d) { //v4.01
	 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	 if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_showHideLayers() { //v3.0 (id, null, 'show/hide')
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (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 enlargeRuler() {
		minPageHeight = 287;
		minRulerHeight = 0;
		if (document.layers) {
			if (window.innerHeight > minPageHeight) document.images['ruler'].height = (window.innerHeight - minPageHeight) + minRulerHeight;
		}
		else if (document.documentElement.clientHeight > 0) {
			if (document.documentElement.clientHeight > minPageHeight) document.images['ruler'].height = (document.documentElement.clientHeight - minPageHeight) + minRulerHeight;
		}
		else {
			if (document.body.clientHeight > minRulerHeight) document.images['ruler'].height = (document.body.clientHeight - minPageHeight) + minRulerHeight;
		}
	}
	
	function myRuler() {
		minPageHeight = 287;
		minRulerHeight = 0;
		if (document.layers) document.write ('<img src=\"' + rootURL + 'pub/images/dot.gif\" width=\"1\" height=\"'+((window.innerHeight > minPageHeight) ? (window.innerHeight - (minPageHeight + 10)) + minRulerHeight : 1)+'\" name=\"ruler\">');
			else document.write ('<img src=\"' + rootURL + 'pub/images/dot.gif\" width=\"1\" height=\"1\" name=\"ruler\">');
	}
	
	url = document.location.href;
	xend = url.lastIndexOf("/") + 1;
	rootURL = url.substring(0, xend);