// MLC:FRAMEWORK

function mlcload(){
	onsize();	
	window.onresize = onsize;
}

function onsize(){
	return;
	$width = getWidth();
	$height = getHeight();

	$banner = document.getElementById("divhead");
	$content = document.getElementById("page");	
	
	$content.style.height=($height-70)+"px";
//	$contents = document.getElementById($contentsid);	
}


function show_contents(){
	$contents = document.getElementById($contentsid);	
	if($contents!=null) $contents.style.display="inline";
}

// MLC:TAB
function showTab($id){
	document.getElementById($selid).className='mlctab';
	document.getElementById($id).className='mlcseltab';
	$selid=$id;
}
// DRAGGING BETA
// By: Martin Sykes
$me=null;
$dragX=-1;
$dragY=-1;

function mouseXY(e,obj){
	ret = new function(){ };
	curleft=curtop=0;
	do{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
	} while (obj = obj.offsetParent);
	ret.x = e.clientX - curleft;
	ret.y = e.clientY - curtop;
	return ret;
}

function begindrag(e,elename){
	if(!e) e=window.event;		
	$me = document.getElementById(elename);
	obj = mouseXY(e,$me);
	$dragX = obj.x;
	$dragY = obj.y;
	if($dragY > 20) return true; 
	document.body.focus();
	document.body.onmousemove = function(e){ ondrag(e); }
	document.body.onmouseup = function(e){ enddrag(e); }
	document.onselectstart = function () { return false; };
	return false;
}

function ondrag(e){
	if(!e) e=window.event;		

	obj = mouseXY(e,$me.offsetParent);
	newleft = obj.x - $dragX;
	newtop = obj.y - $dragY;
				
	$me.style.left=newleft+"px";
	$me.style.top=newtop+"px";
	return false;
}

function enddrag(e){
	document.body.onmousemove=document.body.onmouseup=document.body.onselectstart="";
	return false;
}

function hideWindow($id){
	$ele = document.getElementById($id);
	$ele.style.display="none";
}

function getWidth(){
	if(window.innerWidth)
		return window.innerWidth;
	if(document.body.clientWidth)
		return document.body.clientWidth;
	if(document.documentElement.clientWidth)
		return document.documentElement.clientWidth;
}

function getHeight(){
	if(window.innerHeight)
		return window.innerHeight;
	if(document.body.clientHeight)
		return document.body.clientHeight;
	if(document.documentElement.clientHeight)
		return document.documentElement.clientHeight;
}