// - - - - - - - - - - - - - - - - - - GRID - - - - - - - - - - - - - - - - - - - - - - 
var isIE =  (navigator.appName.indexOf("Microsoft") != -1);

// - - - - - - - - - - - - - - - - - - Open POPUP Window - - - - - - - - - - - - - - - - - - - - 

function openPopUpWindow(url, w, h, attr){
/*	if (isIE) {
		window.showModalDialog( url, 'dialogHeight: ' + h + 'px; dialogWidth: ' + w + 'px; status: no;' );
	} else {*/
		if (attr=null)
			attr='resizable=1,directories=0,toolbar=1,scrollbars=0,menubar=1,top=0,left=0';
//		attr='resizable=1,directories=1,toolbar=1,scrollbars=1,menubar=1,top=1,left=1';
//	attr = 'resizable=0;

		var sSizeAndPosition;
		sSizeAndPosition = 'width=' + w + ', height=' + h + ', top=' + (screen.height - parseInt(h))/2 + ', left=' + (screen.width - parseInt(w))/2;
		// try to close old window
		try{window.PopUpWindow.close();}catch(e){}

		window.PopUpWindow = window.open(url, 'edit', sSizeAndPosition + ', ' + attr);
//	}
}


// - - - - - - - - - - - - - - - - - - PAGE UNLOAD handler - - - - - - - - - - - - - - - - - - - - 
function Page_Unload(){
	try{
		if(window.PopUpWindow != null)
			window.PopUpWindow.close();
	}catch(e){}
}

window.onbeforeunload = Page_Unload;