<!-- //
function newwindow(url) 
{
        var toppos = parseInt((parseInt(window.screen.height)-600) / 2) ;
        var leftpos = parseInt((parseInt(window.screen.width)-800) / 2) ;
        var sizes = new String("top=" + toppos + ",left=" + leftpos);
        var newWindow = window.open(url, null, "toolbar=no,location=no,scrollbars=yes,menubar=no,resizable=yes,status=yes,height=530,width=785," + sizes, false);
        newWindow.focus();
}

function WeatherWindow(url) 
{
        var toppos = parseInt((parseInt(window.screen.height)-600) / 2) ;
        var leftpos = parseInt((parseInt(window.screen.width)-800) / 2) ;
        var sizes = new String("top=" + toppos + ",left=" + leftpos);
        var newWindow = window.open(url, "WeatherWindow", "toolbar=no,location=no,scrollbars=yes,menubar=no,resizable=yes,status=yes,height=650,width=780," + sizes, false);
        newWindow.focus();
}

function GetNewWindow(url, windowName) 
{
        var toppos = parseInt((parseInt(window.screen.height)-600) / 2) ;
        var leftpos = parseInt((parseInt(window.screen.width)-800) / 2) ;
        var sizes = new String("top=" + toppos + ",left=" + leftpos);
        var newWindow = window.open(url, windowName, "toolbar=no,location=no,scrollbars=yes,menubar=no,resizable=yes,status=yes,height=530,width=785," + sizes, false);
        newWindow.focus();
        return newWindow;
}

function OpenPrintPreview(url) {		
		var newWindow = window.open(url, "NAVBPrintView", "width=500,height=500,toolbar=0,location=0,directories=0,status=1,menubar=1,resizable=1,scrollbars=1");
		newWindow.focus();
}


function DisableLinks(message) {
	for (var i=0;i<window.document.links.length;i++) {
		window.document.links(i).href = "javascript:alert('" + message + "')";
		window.document.links(i).onclick = "";
		window.document.links(i).target = "_self";
	}
}

function TrapKeyDown(btnID, event){
	btn = findObj(btnID);
	if (document.all){
		if (event.keyCode == 13){
			event.returnValue=false;
			event.cancel = true;
			btn.click();
		}
	}
	else if (document.getElementById){
		if (event.which == 13){
			event.returnValue=false;
			event.cancel = true;
			btn.focus();
			btn.click();
		}
	}
	else if(document.layers){
		if(event.which == 13){
			event.returnValue=false;
			event.cancel = true;
			btn.focus();
			btn.click();
		}
	}
}

function findObj(n, d) { 
	var p,i,x;  
	if(!d) 
		d=document; 
	if(!(x=d[n])&&d.all) 
		x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
		x=findObj(n,d.layers[i].document);
	if(!x && d.getElementById) 
		x=d.getElementById(n); 
	return x;
}

function PrintIt() {
	var da = (document.all) ? 1 : 0;
	var pr = (window.print) ? 1 : 0;
	var mac = (navigator.userAgent.indexOf("Mac") != -1); 
	if (pr) { // NS4, IE5
		window.print();
	} else if (da && !mac) { // IE4 (Windows)
		window.document.writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
		window.document.writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
		window.document.writeln('Sub window_onunload');
		window.document.writeln('  On Error Resume Next');
		window.document.writeln('  Set WB = nothing');
		window.document.writeln('End Sub');
		window.document.writeln('Sub vbPrintPage');
		window.document.writeln('  OLECMDID_PRINT = 6');
		window.document.writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
		window.document.writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
		window.document.writeln('  On Error Resume Next');
		window.document.writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
		window.document.writeln('End Sub');
		window.document.writeln('<' + '/SCRIPT>');
		vbPrintPage();
	}
}
//-->