
function openWindow(url,wname,w,h,props) 
{
	var winTop=(screen.height-h)/2;
	var winLeft=(screen.width-w)/2;
	
	var windowprops = "width=" + w + ",height=" + h +",left="+winLeft+",top="+winTop+","+props;
	return window.open(url,wname,windowprops);
} 

function setCookie(name, value)
{
	var curCookie = name + "=" + escape(value)+';';
	document.cookie = curCookie
}

function getCookie(name)
{
	var prefix,cookieStartIndex,cookieEndIndex

	prefix = name + "="
	cookieStartIndex = document.cookie.indexOf(prefix)

	if (cookieStartIndex == -1)
		return ''
	cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex +  prefix.length)
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length

	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}

function isValidEmail(email)
{
	return email.match('^.+@.+[.].+$') ? 1 : 0;
}
