
//
// Creates a Popup
//
function winOpen( myurl, myname, mywidth, myheight, myresize, myscroll )
{
	xPos = ( screen.availWidth / 2 ) - ( mywidth / 2 ) - 4;
	yPos = ( screen.availHeight / 2 ) - ( myheight / 2 ) - 16;
	
	var newWin = window.open( myurl, myname,"left=" + xPos + ",top=" + yPos + ",width=" + mywidth + ",height=" + myheight +",location=no,menubar=no,resizable=" + myresize + ",scrollbars=" + myscroll + ",status= no,toolbar= no")
	newWin.focus();
}

//
// Confirmation
//
function confirmLink( theLink, confirmMsg )
{
	if( ( confirmMsg == '' ) || ( typeof( window.opera ) != 'undefined' ) )
	{
		return true;
	}
	
	var is_confirmed = confirm(confirmMsg);
	
	if( is_confirmed )
	{
		theLink.href += '&is_js_confirmed=1';
	}
	
	return is_confirmed;
}

//
// Checks if the email-address is valid.
//
function checkEmail( email )
{
	var regularExpr = /^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-\.]+)\.([a-zA-Z]{2,4}$)/;
	
	if (regularExpr.test(email) )
	{
		return true;
	}
	else if( email.value == "" )
	{
		return true;
	}
	else
	{
		return false;
	}
}
