function PopUp(nURL,winName,popW,popH,nShowControls) {
	w = screen.width ; h = screen.height
  	if (document.layers) {
    		if ((w >= 800) && (w <= 1028)) {w = 1028}
    		if ((h >= 600) && (h <= 780))  {h = 780}
    		if ((w >= 640) && (w <= 800))  {w = 800}
    		if ((h >= 480) && (h <= 600))  {h = 600}
    		if (w <= 640) {w = 640}
    		if (h <= 480) {h = 480}
  	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	switch(nShowControls){
		case 1: 
			// For full windows
			var windowprops = "location=yes,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes,status=yes" + ",left=" + leftPos + ",top=" + topPos + ",width=" + popW + ",height=" + popH;
			break;
		case 2: 
			// For printing
			var windowprops = "location=no,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes,status=yes" + ",left=" + leftPos + ",top=" + topPos + ",width=" + popW + ",height=" + popH;
			break;
		default:
			// For clean simple popups (like dialog boxes)
			var windowprops = "location=no,scrollbars=no,menubar=no,toolbar=no,resizable=no,status=no" + ",left=" + leftPos + ",top=" + topPos + ",width=" + popW + ",height=" + popH;
	}
	popup = window.open(nURL,winName,windowprops);
	if (popup.blur) {
	  popup.focus();
	}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

ChangeMiniTab = function(nNewActiveTab,nFullTabARRAY){
	needToConfirm=false;
	confirmBackOn=true;
	// Make all tabs inactive and hide all tab page content, then set new tab active and show its content
	if(eval("document.getElementById('" + nNewActiveTab + "')")){ // only if new tab DIV exists
		var nTabName = "";
		var nTabBodyName = "";
		for(x=0;x<nFullTabARRAY.length;x++){
			nTabName = nFullTabARRAY[x];
			nTabBodyName = "tabbody"+nFullTabARRAY[x];
			$(nTabName).className = "minitab";
			$(nTabBodyName).hide();
			//eval("document.getElementById('" + nFullTabARRAY[x] + "').className='minitab'");
			//eval("MM_showHideLayers('tabbody" + nFullTabARRAY[x] + "','','hide')");
		}
		nTabName = nNewActiveTab;
		nTabBodyName = "tabbody"+nNewActiveTab;
		$(nTabName).className = "minitabActive";
		$(nTabBodyName).show();
		//eval("MM_showHideLayers('tabbody" + nNewActiveTab + "','','show')");
		//eval("document.getElementById('" + nNewActiveTab + "').className='minitabActive'");
	}
}

// Initialize ajax loader images
var loaderImgL = "<div id=\"loader\"><img src='img/loading_l.gif' width='32' height='32' alt='Loading...' /></div>";
var loaderImgS = "<div id=\"loader\"><img src='img/loading.gif' width='136' height='16' alt='Saving...' /></div>";
