<!--

/*=================================================================
Function:	newWindow
Purpose:	Open a new browser window, can be centralised. 
Input:		mypage	-	Page URL
			myname	-	Window's name
			w		-	Window width
			h		-	Window height
			scroll	-	Scrollable?
			pos		-	Window's position
			resize	-	Resizeable?
Returns:	A window handler.
==================================================================*/
var win = null;
function newWindow(myPage, myName, w, h, scroll, pos, resize) {
	var winResize;
	if (resize == "yes") winResize = "yes"
	else if (resize == "no") winResize = "no"
	else winResize = "no";
	
	if(pos == "random") {
		LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100;
		TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;
	}

	if(pos == "center") {
		LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
		TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
	}
	else if((pos != "center" && pos != "random") || pos == null) {
		LeftPosition = 0;
		TopPosition = 20
	}
	
	settings = 'width=' + w + ',height=' + h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=' + winResize;
	win = window.open(myPage, myName, settings);
}
// -->

// Settings. Please read readme.html file for instructions
/*var ppcDF = "d/m/Y";
var ppcMN = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var ppcWN = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var ppcER = new Array(4);
ppcER[0] = "Required DHTML functions are not supported in this browser.";
ppcER[1] = "Target form field is not assigned or not accessible.";
ppcER[2] = "Sorry, the chosen date is not acceptable. Please read instructions on the page.";
ppcER[3] = "Unknown error occured while executing this script.";
var ppcUC = false;
var ppcUX = 4;
var ppcUY = 4;*/

/* Do not edit below this line unless you are sure what are you doing! */

var ppcIE = (navigator.appName == "Microsoft Internet Explorer");
var ppcNN = ((navigator.appName == "Netscape") && (document.layers));
var ppcTT="<table width=\"200\" cellspacing=\"1\" cellpadding=\"2\" border=\"1\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\">\n";
var ppcCD=ppcTT;var ppcFT="<font face=\"MS Sans Serif, sans-serif\" size=\"1\" color=\"#000000\">";var ppcFC=true;
var ppcTI=false;var ppcSV=null;var ppcRL=null;var ppcXC=null;var ppcYC=null;
//var ppcML=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
//var ppcWE=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var ppcNow=new Date();
var ppcPtr=new Date();

if (ppcNN) {
	document.location.href = "Netscape.htm";
	window.captureEvents(Event.RESIZE);
	window.onresize = restoreLayers;
	document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
	document.onmousedown = recordXY;
	document.onmouseup = confirmXY;
}

function restoreLayers(e) {
	if (ppcNN) {
		with (window.document) {
			open("text/html");
			write("<html><head><title>Restoring the layer structure...</title></head>");
			write("<body bgcolor=\"#FFFFFF\" onLoad=\"history.go(-1)\">");
			write("</body></html>");
			close();
		}
	}
}

function recordXY(e) {
	if (ppcNN) {
		ppcXC = e.x;
		ppcYC = e.y;
		document.routeEvent(e);
	}
}

function confirmXY(e) {
	if (ppcNN) {
		ppcXC = (ppcXC == e.x) ? e.x : null;
		ppcYC = (ppcYC == e.y) ? e.y : null;
		document.routeEvent(e);
	}
}

function showBox(Box) {
	//ppcSV = target;
	//ppcRL = rules;
	//if (ppcFC) {setCalendar();ppcFC = false;}
		//if ((ppcSV != null)&&(ppcSV)) {
			if (ppcIE) {
				var obj = document.all[Box];
				obj.style.left = 315;//document.body.scrollLeft+event.clientX;
				obj.style.top  = 50;//document.body.scrollTop+event.clientY;
				obj.style.visibility = "visible";
			}
			else if (ppcNN) {
				var obj = document.layers[Box];
				obj.left = 315;// ppcXC
				obj.top  = 86;//ppcYC
				obj.visibility = "show";
			}
		//else {showError(ppcER[0]);}}
	//else {showError(ppcER[1]);}
}

function hideBox(Box) {
	if (ppcIE) {document.all[Box].style.visibility = "hidden";}
	else if (ppcNN) {document.layers[Box].visibility = "hide";window.status = " ";}
	else {/* NOP */}

	//ppcTI = false;
	//setCalendar();
	//ppcSV = null;
	//if (ppcIE) {
	//	var obj = document.ppcMonthList.sItem;}
	//else if (ppcNN) {
	//	var obj = document.layers['PopUpCalendar'].document.layers['monthSelector'].document.ppcMonthList.sItem;}
	//else {/* NOP */}
	//obj.selectedIndex = 0;
}
