//Resize and position window
var timeoutId;

function resizeCenterWindow(width, height) 
{
	var w=width
	var h=height
	var t
	var l
   	window.resizeTo(w,h);
   	l = screen.width / 2 - w/2
   	t = screen.height / 2 - h/2
   	
   	window.moveTo(l,t);
   	window.focus();     
}

//Opens a pop up window
function PopUpWindow(sUrl,iHeight,iWidth,bToolBar,bStatus,bScrollBar,bResizeable,sWindowName)
{
	var features      = "height=" + iHeight + ",width=" + iWidth + ",toolbar=" + bToolBar + ",status=" + bStatus + ",scrollbars=" + bScrollBar + ",resizable=" + bResizeable
	var window_handle = window.open(sUrl,sWindowName,features);
    window_handle.focus();
}


function disableButton(btn)
{
	btn.disabled=true;
	timeoutId = setTimeout('reEnableButton2()', 4000);
}


function reEnableButton2()
{
	document.forms[0].submit();
	clearTimeout(timeoutId);
}

function enableButton(btn)
{
	btn.disabled=false;
}

