// ------------------------------------------------------------------

	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);

	var slide_show_active = 0; 	//slide show starts in off
	var curr_pic = 0;
	function changePic(pic_id){
		document.getElementById('main_img').src = pic_id;
	}

	function toggleIt(id) {
		var f = document.getElementById(id);
		if (f.style.display=='block') {
			f.style.display='none';
		}
		else {
			f.style.display='block';
		}
	}

	function toggleItv2(id) {
		var f = document.getElementById(id);
		
		if (f.style.display=='block') {
			// Reset all to display none
			document.getElementById('monday').style.display='none';
			document.getElementById('tuesday').style.display='none';
			document.getElementById('wednesday').style.display='none';
			document.getElementById('thursday').style.display='none';
			document.getElementById('friday').style.display='none';
			document.getElementById('saturday').style.display='none';
			//document.getElementById('sunday').style.display='none';
			f.style.display='none';
		}
		else
		{
			// Reset all to display none
			document.getElementById('monday').style.display='none';
			document.getElementById('tuesday').style.display='none';
			document.getElementById('wednesday').style.display='none';
			document.getElementById('thursday').style.display='none';
			document.getElementById('friday').style.display='none';
			document.getElementById('saturday').style.display='none';
			document.getElementById('sunday').style.display='none';
			f.style.display='block';
		}
	}


	function slideShow(block_id, id, speed, action_id){
		var imgblocks = document.getElementsByName('bttn_ss_'+block_id);
		var imgButtons = document.getElementsByName('tween_'+block_id);
		var state = document.getElementById('slide_show_state_'+block_id);
		var counter;
		counter = id;
		if (Number(state.value) == 0 || action_id == 1) {
			if (action_id == 0) {
				for (i = 0; i < imgblocks.length; i ++)	imgButtons[i].src = 'pub/images/pause.gif';
				state.value = '1'
			}
			if (state.value == '1'){
				chngImg(block_id, counter, 3);
				counter++;
				if (counter >= imgblocks.length) counter = 0;
				setTimeout('slideShow('+block_id+','+counter+', '+speed+',1);',speed * 1000)
			}

		}
		else {
			for (i = 0; i < imgblocks.length; i ++)	imgButtons[i].src = 'pub/images/play.gif';
			state.value = '0'
		}
	}

	function slideit(block_id, id){
		/*var imgblocks = document.getElementsByName('bttn_ss_'+block_id);
		if (imgblocks[0].value == 'Start Slide Show') {
		if (document.getElementById('slide_show_bttn').value == 'Stop Slide Show') {
			moveNext(block_id, id);
			setTimeout("slideit("+block_id+","+(Number(id)+1)")", 3000);
		}*/
	}

	function chngImg(block_id, id, action_id) {
		var imgblocks = document.getElementsByName('bttn_ss_'+block_id);
		if (imgblocks.length > 1) {
			for (i = 0; i < imgblocks.length; i++) {
				document.getElementById('ss_'+block_id+'_'+i).className = '';
				document.getElementById('ss_'+block_id+'_'+i).style.display = 'none';
			}

			if (action_id == 1) {
				document.getElementById('ss_'+block_id+'_'+0).style.display = '';
			}
			else if (action_id == 2) {
				if (id == 0) id = imgblocks.length
				document.getElementById('ss_'+block_id+'_'+Number((Number(id)-1))).style.display = '';
			}
			else if (action_id == 3) {
				if (id == (imgblocks.length-1)) id = -1
				document.getElementById('ss_'+block_id+'_'+Number((Number(id)+1))).style.display = '';
			}
			else if (action_id == 4) {
				document.getElementById('ss_'+block_id+'_'+(imgblocks.length-1)).style.display = '';
			}
			else  {
				document.getElementById('ss_'+block_id+'_'+0).style.display = '';
			}
		}
	}
	function expandCollapseMenu(img) {
		var imgfilec = 'contract.gif'
		var imgfilee = 'expand.gif'
		var currentSrc = document.getElementById(img).src.split('/')[document.getElementById(img).src.split('/').length-1];	
		if (imgfilee == currentSrc) {
			document.getElementById(img).src = document.getElementById(img).src.replace(imgfilee, imgfilec);
			document.getElementById('ab0').style.width = '99%';
			document.getElementById('ab0tbl').style.width = '99%';
			for (i = 1; i <= 11; i++) {
				document.getElementById('ab0'+i).style.display = '';
			}
		}
		else {
			document.getElementById(img).src = document.getElementById(img).src.replace(imgfilec, imgfilee);
			document.getElementById('ab0tbl').style.width = '20px';
			document.getElementById('ab0').style.width = '20px';
			for (i = 1; i <= 11; i++) {
				document.getElementById('ab0'+i).style.display = 'none';
			}
		}
		return false;
	}