if (is.ns4) {
var domRef="document.layers.";
var domClose = ""
var styleRef=""; }
	else if ((is.ie) && (!is.dom) && (!is.ie55)) {	
	var domRef="document.all.";
	var domClose = ""
	var styleRef=".style"; 
	leftPos = 'left'; }
	else if ((is.dom)||(is.ie55)) {
	var domRef="document.getElementById(\""
	var domClose = "\")"
	var styleRef=".style"
	var leftPos = 'left'; }

	
//* create object reference 
function getRef(obj) {
//alert(obj);
if (typeof(obj) == 'string') {	

	theObj = eval(domRef+obj+domClose);		
	} else {
		theObj = obj	
		}
	//alert(theObj);
	return theObj	
}

/***************************************************************************/
var OxPos 
var yPos = 0
var xMin = 0
var xMax = 122
var xPos = 389
var timerSpeed = 1
var EStatus = 0
var mPos = 0
if (is.ns6) {
	var speed = 10 
	} else {
	var speed = 5 }

function init() {
	left = getRef('hScr1');
	center = getRef('divider');
	right = getRef('hScr2');
	rightC = getRef('hC2');
	if (is.ie4) {right.focus();}
}

function l_on(){
	if ((typeof(left) != 'object') || (is.ie4) || (is.ns4)) { return;
	} else {	
	if(EStatus == 0){ EStatus = 1; rightC.style.zIndex = 1; left.style.zIndex=3; center.style.zIndex=3; l_expand(); }
	if(EStatus == 3){ clearTimeout(timerid); EStatus = 1; rightC.style.zIndex = 1; left.style.zIndex=3; center.style.zIndex=3; l_expand(); }
	if(EStatus == 4 || EStatus == 5){ EStatus = 6; r_shrink(); }
	mPos = 1; }
}

function l_off(){
	if ((typeof(left) != 'object') || (is.ie4) || (is.ns4)) { return;
	} else {
	if(EStatus == 1){ clearTimeout(timerid);EStatus = 3; l_shrink();}
	if(EStatus == 2){ EStatus = 3; l_shrink();}
	mPos = 0; }
}

function r_on(){
	if ((typeof(left) != 'object') || (is.ie4) || (is.ns4)) { return;
	} else {
	if(EStatus == 0){ EStatus = 4; left.style.zIndex = 0; rightC.style.zIndex=3; center.style.zIndex=0; r_expand(); }
	if(EStatus == 6){ clearTimeout(timerid); EStatus = 4; left.style.zIndex = 0; rightC.style.zIndex=3; center.style.zIndex=0; r_expand();}
	if(EStatus == 1 || EStatus == 2){ EStatus = 3; l_shrink(); }
	mPos = 2; }
}

function r_off(){
	if ((typeof(left) != 'object') || (is.ie4) || (is.ns4))  { return;
	} else {
	if(EStatus == 4){ clearTimeout(timerid);EStatus = 6; r_shrink();}
	if(EStatus == 5){ EStatus = 6; r_shrink();}
	mPos = 0; }
}


function l_expand(){
	if (clipValues(left,'r')<305) {
		clipBy(left,0,speed,0,0);			
		xPos = xPos+speed;
		shiftTo(center, xPos, 327);
		if ( (EStatus != 1) && (EStatus != 2) && (clipValues(left, 'r')>307) ) {(clipValues(left,'r')=307);}		
		timerid=setTimeout("l_expand()",timerSpeed);
	 }
	else{
		EStatus = 2;
		clearTimeout(timerid);
		//alert(timerid + "revealing slide 1:" + clipValues(hScr1,'r'));	
	}		
}

function l_shrink(){
	if (clipValues(left,'r')>197) {		
		clipBy(left,0,-speed,0,0);
		xPos = xPos-speed;
		shiftTo(center, xPos, 327);		
		if (clipValues(left, 'r')<=200) { left.style.zIndex=0; center.style.zIndex=0;}		
		timerid = setTimeout("l_shrink()",timerSpeed)
	} else {		
		xPos = 389;
		shiftTo(center, xPos, 327);
		EStatus = 0;
		clearTimeout(timerid);
		if(mPos == 2){r_on();}
		//alert("revealing slide 1:" + clipValues(hScr1,'r'));	
	}		
}

function r_expand() {		
	OxPos = Number(eval('right.style.'+leftPos).split("px")[0])
	//alert("this is from r_expand" + OxPos);
	if (OxPos > xMin) {
	//alert("reducing by 1: " + OxPos);
		OxPos = OxPos - speed;
      		if (OxPos < xMin) { OxPos = xMin; }
		shiftTo(right, OxPos, yPos);
		timerid = setTimeout("r_expand()",timerSpeed);
	} else {
		OxPos = xMin;
		shiftTo(right, OxPos, yPos);
		EStatus = 5;
		clearTimeout(timerid);
	}
}

function r_shrink(){
//alert('im shrinking');
	OxPos = Number(eval('right.style.'+leftPos).split("px")[0]) 
	//alert("this is from r_shrink" + OxPos);
 	if (OxPos < xMax) {
      		OxPos = OxPos + speed;
      		if (OxPos > xMax) {OxPos = xMax; right.style.zIndex=0; rightC.style.zIndex=0; center.style.zIndex = 0;}
      		shiftTo(right, OxPos, yPos);
      		timerid = setTimeout("r_shrink()",timerSpeed);
		} else {
		OxPos = xMax;
   		shiftTo(right, OxPos, yPos);
		clearTimeout(timerid);
		EStatus = 0;		
		if(mPos == 1){l_on();}
	}
}

function shiftTo(div, x, y) {
// alert('arrive shift to');
  if (is.dom) {  
    div.style.left = x + "px";
  } else if (is.ns4) {
	 div.moveTo(x,y);
  } else if ((is.ie) && (!is.dom)) { 
    div.style.pixelLeft = x;
  }
}

function clipValues(obj,which) {
	if (is.ns4) {
		if (which=="t") return obj.clip.top
		if (which=="r") return obj.clip.right
		if (which=="b") return obj.clip.bottom
		if (which=="l") return obj.clip.left
	}
	else if ((is.ie) || (is.dom)) {
	//alert('getting clip values');
	//alert(obj.style.clip);
		var clips = obj.style.clip		
		var regexp = /pt/
		var rpl = clips.replace(regexp,"px")
		//alert(rpl);
		rpl = rpl.replace(regexp,"px")
		//alert(rpl);
		var clipv = rpl.split("rect(")[1].split(")")[0].split("px")
		//alert(clipv)
		if (which=="t") return Number(clipv[0])		
		if (which=="r") return Number(clipv[1])	
		if (which=="b") return Number(clipv[2])
		if (which=="l") return Number(clipv[3])
	}
}

function clipBy(obj,t,r,b,l) {
	if (is.ns4) {
		obj.clip.top = clipValues(obj,'t') + t
		obj.clip.right = clipValues(obj,'r') + r
		obj.clip.bottom = clipValues(obj,'b') + b
		obj.clip.left = clipValues(obj,'l') + l
	}
	else if ((is.ie) || (is.dom)) {

	obj.style.clip = "rect("+(this.clipValues(obj,'t')+t)+"px "+(this.clipValues(obj,'r')+r)+"px "+Number(this.clipValues(obj,'b')+b)+"px "+Number(this.clipValues(obj,'l')+l)+"px)"
	
	}
}








/***************************************************/






	
