// Returns the current year
today=new Date();
nxYear=today.getFullYear();

// Returns the current date
var monthNames = new Array(
"January","February","March","April","May","June","July",
"August","September","October","November","December");
var now = new Date();
dateToday=(monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear());

// Validates email address
function checkEmail(frmMail) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frmMail.email.value)){
return (true)
}
alert("Invalid email address, try again")
return (false)
}


// The JavaScript Source - http://javascript.internet.com - CaricaFoto
function popFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*	function destroypage()
*   function OpenNewWindow(URL,windowH,windowW,mStatus)
*	function OpenNewImageWindow(URL,windowH,windowW,mStatus)
*	function OpenNotesWindow(tobject)
*	function OpenInLineWindow(cPicture,nWidth,nHeight,cMessage,nBorder)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

var NewWindow;
var NewImageWindow;

/*
*********************************************************
destroypage
*********************************************************
*/
function destroypage()
{
	if (NewWindow!=null)NewWindow.close();
}	

/*
*********************************************************
OpenNewImageWindow
*********************************************************
*/


function OpenNewImageWindow(URL)
	{
	var iTop,iLeft,available_width,available_height,windowH,windowW,sURL;
	windowH=600;
	windowW=700;

	sURL = "../popImage.aspx?processID=" + URL;
	
	 if(document.all) {
			available_width=window.screen.width;
			available_height=window.screen.height;
       } else {
			available_width=innerWidth;
			available_height=innerHeight;
       }

	iTop	= (parseFloat(available_height)/2)	- (parseFloat(windowH)/2);
	iLeft	= (parseFloat(available_width)/2)	- (parseFloat(windowW)/2);

	s = "width=" + windowW + ",height=" + windowH + ",top=" + iTop + ",left=" + iLeft + ",toolbar=no,status=yes,resizable=yes,scrollbars=yes"

	if (NewWindow!=null)NewWindow.close();
	
	NewWindow = window.open(sURL,"popFrameless", s);
	NewWindow.focus;
	}	

