function openWindow(url) {
    if (document.all)
        var xMax = screen.width, yMax = screen.height;
    else
        if (document.layers)
            var xMax = window.outerWidth, yMax = window.outerHeight;
        else
            var xMax = 640, yMax=480;

	var width=700,height=350
//	var xOffset = (xMax - width)/2, yOffset = 0;
   var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2-50;

    window.open(url,'','width='+width+',height='+height+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+
	xOffset+'toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no,alwaysRaised=yes');
}
function login()  {
	form=document.register
	if (form.email_id.value.search(/^[-\w\.]+@([-\w]+\.)+[-\w]+$/) == -1) {
		alert("Invalid email")
		return false
	}
	if (form.pass.value.length < 4) {
		alert("Password must be minimum 4 chars")
		return false
	}
}

function register()  {
	form=document.form_register
	if (form.email_id.value.search(/^[-\w\.]+@([-\w]+\.)+[-\w]+$/) == -1) {
		alert("Invalid email")
		return false
	}
	if (form.pass.value.length < 4) {
		alert("Password must be minimum 4 chars")
		return false
	}

	if (form.pass.value != form.repass.value) {
		alert("Password mismatch")
		return false
	}
}

