//**********************************
//****** Content Frame Script ******
//**********************************

function loadframe() {
if (document.layers) {
		prep_menu = "<ilayer id='content' top='0' left='0' width='445' height='400' src=''></ilayer>";
	} else {
		prep_menu = "<iframe id='content' bordercolor='#000000' border='0' style='position:absolute; width:445px; height:400px; z-index:1; top: 0px; left: 0px; background-color: #000000; layer-background-color: #000000; border: 0px;  #000000; overflow: auto' frameborder='0' src=''></iframe>";
	}
	document.all.contentholder.innerHTML = prep_menu;
}

//**********************************
//***** Content Opener Script ******
//**********************************

function op(page) {
	document.all.content.src=page+".html";
	hidemenu();
}

//**********************************

var step=100;
var frameup = true;
var inputblock=false;
var etc=false;

function slideobject(fu,ojn, hpx) {
	this.frameup=fu;
	this.objname = ojn;
	this.home = hpx;
	return this;
}


so = new Array()
so[0] = new slideobject(true,'frame',-100);
so[1] = new slideobject(false,'pframe',0);

function shift() {
	if (inputblock==true) return;
	inputblock = true;
	etc=false;
	if (so[1].frameup==true) {
		so[0].frameup=true;
		move(0,0);
	} else { 
		so[1].frameup=true;
		move(0,1);
	}
}

function move(dir,oi) {
	// dirs
	// 0 = up
	// 1 = down
	// 2 = up/down

	var op=0;
	if (oi==0) op=1;

	if (dir==0) {
		cframe = eval("document.all."+so[oi].objname+".style.top");
		ctop = pxremover(cframe);
		f_to(ctop-step,oi);
		if(ctop>-500) setTimeout("move(0,"+oi+")",30);
		else if (etc==true) inputblock=false;
		else {
			so[op].frameup=false;
			etc=true;
			move(1,op);
		}

	} else if (dir==1) {
		cframe = eval("document.all."+so[oi].objname+".style.top");
		ctop = pxremover(cframe);
		f_to(ctop+step,oi);
		if(ctop<so[oi].home) setTimeout("move(1,"+oi+")",20);
		else if (etc==true) inputblock=false;
		else {
			so[op].frameup=true;
			etc=true;
			move(0,op);
		}

	}


}

function f_to(val,oi) {
mthis = eval("document.all."+so[oi].objname);
mthis.style.top=val;
}

//******** Position Finder ********

function pxremover(v) {
  	v=v.toString(10);
	tchar = v.charAt(v.length-1);
	tchar=tchar.toLowerCase();
	if (isNaN(tchar))  { 
		v = v.substr(0,v.length-2); 
	}
	v = parseInt(v);
return v;
}

function pf_to(val) {
	document.all.movelayer.style.left = val;
}


//********* Show Menu ************

function showmenu() {
	if (so[0].frameup==true) return;
	shift();	
}

//********* Hide Menu ************

function hidemenu() {
	if (so[0].frameup==false) return;
	shift();
	document.all.pcaption.style.visibility="";
	pf_to(180);
}

//**********************************
//************* End ****************
//**********************************