var d = document;
var isNav = false, isNS6 = false, isIE = false;

if(d.layers) {
	isNav = true;
	var range = "";
	var styleObj = "";
	} 
else if (d.all) {
	isIE = true;
	range = "all.";
	styleObj = ".style";
	} 
else if(d.getElementById) {
	isNS6 = true;
	var range = "getElementById('";
	var styleObj = "').style";
}

//do the resize	
function erection(iw,ih) {
	if(isIE) {
		var cx = parseInt(top.document.body.clientWidth);
		var cy = parseInt(top.document.body.clientHeight);
	}
	else {
		var cx = (window.innerWidth);
		var cy = (window.innerHeight);	
	}
	
	//resize width
	if (cx < iw-10) {
		resizeBy(((iw-cx)/8),0);
	}
	else if(cx > iw+10) {
		resizeBy(((iw-cx)/8),0);
	}
	else {
		resizeBy(iw-cx,0);
	}
	
	//resize height
	if (cy < ih-10) {
		resizeBy(0,((ih-cy)/8));
	}
	else if (cy > ih+10) {
		resizeBy(0,((ih-cy)/8));
	}
	else {
		resizeBy(0,ih-cy);
	}
	
	if((cx != iw) || (cy != ih)) {
		setTimeout('erection('+iw+','+ih+')','20');
	}

}

function openWin( windowURL, windowName, windowFeatures ) 
{
	// default to this dimension if no dimension specified
	if ( windowFeatures == "" ) 
	{
		windowFeatures = "width=480,height=300,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=0,left=120, top=80";
	}
	newWindow = window.open( windowURL, windowName, windowFeatures );
	newWindow.focus();
}