function openWindowMax(url,Arg)
{
	var availHeight = window.screen.availHeight - 150;
	var availWidth = window.screen.availWidth - 10;
	var openArg;
	switch(Arg)
	{
		case true:
			openArg = "left=0,top=0,height= " + availHeight + ",width=" + availWidth + ",resizable=1";
			break;
		case false:
			openArg = "left=0,top=0,height= " + availHeight + ",width=" + availWidth + ",toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
			break;
		default:
			openArg = "left=0,top=0,height= " + availHeight + ",width=" + availWidth + ",toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes";
			break;
	}
	var newWin = open(url,"",openArg);
}

function openWindow(url)
{
	var availHeight = window.screen.availHeight - 40;
	var docwin = open(url,"","height=" + availHeight + ",width=740,top=0,left=0,resizable=yes,scrollbars=yes,menubar=yes");	
}

function init(){
	var p = /Templates/gi;
	var url = location;
	var availHeight = window.screen.availHeight - 40;

	if(p.test(url))
	{
		var bodyheight = document.body.scrollHeight;
		if(bodyheight>availHeight)bodyheight = availHeight;
		window.resizeTo(740,bodyheight+40);
	}
}
function openPopup(url)
{
	//var re = new RegExp(contentid + "=true","ig");
	//alert(document.cookie);
	//if(!re.test(document.cookie)){
		//document.cookie = document.cookie + contentid + "=true;";
		var availHeight = window.screen.availHeight - 40;
		var docwin = open(url,"","height=" + availHeight + ",width=740,top=0,left=0,resizable=yes,scrollbars=yes");	
		//alert(document.cookie);
		//alert(re.test(document.cookie));
	//}
}

window.onload = init;