function ResizeDiv() {
	NewWidth = 0;
	NewHeight = 0;
	
	if(document.body.scrollWidth < document.body.clientWidth) {
		NewWidth = document.body.clientWidth;
	}
	else {
		NewWidth = document.body.scrollWidth;
	}
	
	if(document.body.scrollHeight < document.body.clientHeight) {
		NewHeight= document.body.clientHeight;
	}
	else {
		NewHeight= document.body.scrollHeight;
	}

	document.getElementById("left").style.height = NewHeight;
	document.getElementById("leftline").style.height = NewHeight;
	
	document.getElementById("topline1").style.width = NewWidth;
	document.getElementById("topline2").style.width = NewWidth;
	document.getElementById("topline3").style.width = NewWidth;
}

function ActivateResizer() {
	ResizeDiv();
	window.setTimeout(ActivateEvents, 100);
}

function ActivateEvents() {
	window.onresize = ResizeDiv;
	window.onscroll = ResizeDiv;
}

NS4 = (document.layers) ? 1 : 0;
NS5 = (document.getElementById) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
if(IE4 == 1) {
	NS5 = 0;
}

function ShowElement(element, posX, posY, show) {
	if (NS4) {
		document.layers[element].left = posX;
		document.layers[element].top = posY;
		if(show == true) {
			document.layers[element].visibility = "show";
		}
		else {
			document.layers[element].visibility = "hide";
		}
	} 

	if (NS5) {
			document.getElementById(element).style.left = posX;
			document.getElementById(element).style.top = posY;
		if(show == true) {
			document.getElementById(element).style.visibility = "visible";
		}
		else {
			document.getElementById(element).style.visibility = "hidden";
		}
	} 

	if (IE4) {
		document.all[element].style.pixelLeft = posX;
		document.all[element].style.pixelTop = posY;
		if(show == true) {
			document.all[element].style.visibility = "visible";
		}
		else {
			document.all[element].style.visibility = "hidden";
		}
	} 
}

function cdmDialog(url){
	if (screen.width) {
		dLeft = (screen.width-640)/2;
		dTop = (screen.height-480)/2;
	} else {
		dLeft = 100;
		dTop = 100;
	}
	
	cdmWindow = window.open(url, "Dialog", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=400,left=" + dLeft + ",top=" + dTop +",screenX=" + dLeft + ",screenY=" + dTop);
	if (cdmWindow.focus) cdmWindow.focus();

}

function closePopup() {
	window.top.opener.focus();
	window.close();
}

