var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random") {
		LeftPosition=(screen.width)?Math.floor(Math.random()*((screen.width-w)-75)):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='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
	win=window.open(mypage,myname,settings);
	if(win.focus) {
		win.focus();
	}
}


function BrowserWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random") {
		LeftPosition=(screen.width)?Math.floor(Math.random()*((screen.width-w)-75)):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=20;
		TopPosition=20
	}

	settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'+',menubar'+',toolbar'+',location'+',status';
	win=window.open(mypage,myname,settings);
	if(win.focus) {
		win.focus();
	}
}

function DisplayAlert(day, month, year, manualnum)
{

// 4th parameter is a manual override. If set to 1 force display of alert if zero don't display
var today=new Date();
var changetime=new Date();
changetime.setDate(day);
changetime.setMonth(month);
changetime.setFullYear(year);
difference = ( changetime.getTime() - today.getTime()) / (1000 * 60 * 60 * 24 )

if ( ( manualnum == 1 ) || ( manualnum == 0 ) )
	{
	if ( manualnum == 1 )
		{
		document.write("<img src='../images/workwithus/alert3.gif' width=23 height=20 alt='' border=0 align='left'>");
		}
	}
else	
	{
	if ( difference < 11 )
		{
		document.write("<img src='../images/workwithus/alert3.gif' width=23 height=20 alt='' border=0 align='left'>");
		}
	}
}
