		function swapImage(flag, img)	{
			if (flag == "over") {
				oversrc = "../images/scroll_" + img + "_over.gif";
				if (img == "right") { document.ctrl3.src = oversrc;}
				if (img == "left") { document.ctrl2.src = oversrc;}				
			}
			if (flag == "out") {
				outsrc = "../images/scroll_" + img + ".gif";
				if (img == "right") { document.ctrl3.src = outsrc;}
				if (img == "left") { document.ctrl2.src = outsrc;}				
			}
		} 
		function HScroll(el,dr,tx,ox,spd) { //v1.3 by PVII
 			var g,gg,fr,sp,pa='',slw=true,m=false,w,ww,lx,rx;tx=parseInt(tx);
 			if((g=MM_findObj(el))!=null){gg=(document.layers)?g:g.style;}else{return;}
 			if(dr=="Stop"){if(g.toMove){clearTimeout(g.p7Magic);}g.toMove=false;}
 			if((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1)&& !window.opera){pa="px";}
 			if(navigator.userAgent.indexOf("NT")>-1 || navigator.userAgent.indexOf("Windows 2000")>-1){slw=false;}
 			if(spd=="Slow"){sp=(slw)?2:1;fr=(slw)?40:30;}else if(spd=="Medium"){sp=(slw)?4:1;fr=(slw)?40:10;
 				}else{sp=(slw)?8:4;fr=(slw)?40:10;}if(spd=="Warp"){sp=5000;}var xx = parseInt(gg.left);
 			if(!xx){xx=0;}if(document.all || document.getElementById){w=parseInt(g.offsetWidth);
 			if(!w){w=parseInt(g.style.pixelWidth);}if(g.hasChildNodes){
 				for(wx=0;wx<g.childNodes.length;wx++){
  					ww=parseInt(g.childNodes[wx].offsetWidth);if(ww>w){w=ww;}}}
 				}else if(document.layers){w=parseInt(g.clip.width);}lx=tx-w+parseInt(ox);rx=tx;
 				if(dr=="Right"){if(xx>lx){m=true;xx-=sp;if(xx<lx){xx=lx;}}}
 				if(dr=="Left"){if(xx<rx){m=true;xx+=sp;if(xx>rx){xx=rx;}}}
 				if(dr=="Reset"){gg.left=tx+pa;if(g.toMove){clearTimeout(g.p7Magic);}g.toMove=false;}
 				if(m){gg.left=xx+pa;if(g.toMove){clearTimeout(g.p7Magic);}g.toMove=true;
  				eval("g.p7Magic=setTimeout(\"HScroll('"+el+"','"+dr+"',"+tx+","+ox+",'"+spd+"')\","+fr+")");
 				}else{g.toMove=false;}
		}
		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;
		}
		// *** CROSS-BROWSER COMPATIBILITY ***
		var isDOM = (document.getElementById ? true : false); 
		var isIE4 = ((document.all && !isDOM) ? true : false);
		var isNS4 = (document.layers ? true : false);
		var isDyn = (isDOM || isIE4 || isNS4);
		
		function getRef(id)	{
		 	if (isDOM) return document.getElementById(id);
		 	if (isIE4) return document.all[id];
		 	if (isNS4) return document.layers[id];
		}
		
		function getSty(id)
		{return (isNS4 ? getRef(id) : getRef(id).style);} 
		
		function scrSetup() { with (this)
		{
		 if (!isDyn) return;
		 
		 // References to document objects' properties, stored in scroller object.
		 leftRef = getRef(divs[0][0]);
		 contRef = getRef(divs[1][0]);
		 rightRef = getRef(divs[2][0]);
		
		 leftSty = getSty(divs[0][0]);
		 contSty = getSty(divs[1][0]);
		 rightSty = getSty(divs[2][0]);
		 
		 for (count = 0; count < divs.length; count++){
		  	getSty(divs[count][0]).visibility = 'visible';
			}
		 
		 layout();
		}
	}

function scrLayout() { with (this)
{
	if (!isDyn) return;
		winWidth = document.all ? document.body.clientWidth : window.innerWidth;
		winHeight = document.all ? document.body.clientHeight : window.innerHeight;
		
		// Loop through divs array, positioning/sizing controls.
		for (count = 0; count < divs.length; count++)
		{
			var tmpObj = getSty(divs[count][0]);
			if (divs[count][1]) tmpObj.left = eval(divs[count][1]);
			if (divs[count][2]) tmpObj.top = eval(divs[count][2]);
			if (divs[count][3])
			{
				var tmpW = eval(divs[count][3]);
				isNS4 ? tmpObj.clip.width = tmpW : tmpObj.width = tmpW;
			}
			if (divs[count][4]) tmpObj.height = eval(divs[count][4]);
		}
		getSty(divs[1][0]).clip= 'rect(' + cTop + 'px ' + cWidth + 'px ' + 250 + 'px ' + 0 + 'px)';
	}
}

// Main object of which instances are created.
function DHTMLScroller(name)
{

 // Array of objects to move when the window is resized (e.g. scrollbar, arrows).
 this.divs = new Array();
 this.contHeight = 0;
 this.leftHeight = 0;
 this.rightHeight = 0;
 this.contWidth = 0;
 this.leftWidth = 0;
 this.rightWidth = 0;
 this.cTop = 0;
 this.cBot = 0;
 this.cLeft = 0;
 this.cRight = 0;
 this.cWidth = 0;

 // Methods - bind to functions above.
 this.setup = scrSetup;
 this.layout = scrLayout;
}

// *** GLOBAL VARIABLES - START EDITING HERE ***
// Some global variables for the scroller code - scrFirstWidth is only for NS4 resize bug.
var activeScr = null, scrOffset = 0, winWidth, winHeight, scrFirstWidth = window.innerWidth;
var mainDiv;
mainDiv = new DHTMLScroller('mainDiv');

with (mainDiv)
{
 // divs[number] = new Array('id of div below', 'x', 'y', 'width', 'height');
divs[0] = new Array('CtrlLeft', '0', '64', '30', '250');
divs[1] = new Array('ContentContainer', '30', '67', 'winWidth-60', '250');
divs[2] = new Array('CtrlRight', 'winWidth-25', '64', '30', '250');
}
		
		function doPopup(url, name, width, height) {
			var options = width + "," + height + ",resizable=no,scrollbars=no,toolbar=no,menubar=no,status=no,directories=no"
			window.open(url, name, options);
		}
		

