	
	
	
function fourdigits(number)	
{
	return (number < 1000) ? number + 1900 : number;
}


function getprettydate()
{
	var now = new Date();
	var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
	today = days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear()));
	return today;
}
	
	
/* OPEN WINDOW ---------------------------------------------------- */
function launch(newURL, newName, newFeatures, orgName)
{
  var remote = open(newURL, newName, newFeatures);
  
  if (remote.opener == null)
  {
    remote.opener = window;
  }
  
  remote.opener.name = orgName;
  return remote;
}

function OpenWindow(TheWindow, h, w, WinName, type)
{
	switch(type)
	{
		case 1: myRemote = launch(""+TheWindow+"", ""+WinName+"", "height="+h+", width="+w+", screenX=50, left=50, screenY=50, top=50, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, toolbar=0", "TheOrgName");
			// nothing
			break;
		case 2: myRemote = launch(""+TheWindow+"", ""+WinName+"", "height="+h+", width="+w+", screenX=50, left=50, screenY=50, top=50, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=1, scrollbars=1, status=0, toolbar=0", "TheOrgName");
			// resizable=1, scrollbars=1
			break;
		case 3: myRemote = launch(""+TheWindow+"", ""+WinName+"", "height="+h+", width="+w+", screenX=50, left=50, screenY=50, top=50, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0, menubar=1, resizable=1, scrollbars=1, status=0, toolbar=0", "TheOrgName");
			// menubar=1, resizable=1, scrollbars=1
			break;
		case 4: myRemote = launch(""+TheWindow+"", ""+WinName+"", "height="+h+", width="+w+", screenX=50, left=50, screenY=50, top=50, channelmode=0, dependent=0, directories=0, fullscreen=0, location=0, menubar=1, resizable=1, scrollbars=1, status=1, toolbar=1", "TheOrgName");
			// menubar=1, resizable=1, scrollbars=1, status=1, toolbar=1
			break;
		default: myRemote = launch(""+TheWindow+"", ""+WinName+"", "height="+h+", width="+w+", screenX=50, left=50, screenY=50, top=50", "TheOrgName");
			break;
	}
}
/* ---------------------------------------------------- OPEN WINDOW */
	
	
	

