
var win = null;
function NewWindow(mypage,myname,w,h,scroll)
{
	
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;

settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no'
win = window.open(mypage,myname,settings)

}

function login_validate()
{

	 if((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.getElementById("email").value))==false) 
		{
			alert("Please enter valid Email address!");
			document.getElementById("email").focus();
			return false;
		}

     
	 if(document.getElementById("password").value == "")
	  {
			alert("Please enter password!");
			document.getElementById("password").focus();
			return false;
	 }
	
}

var xmlHttp;
var str="";
function getChapter(page)
{ 
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url=page
	url='sample_certificate.php'+"?q="+str+"&page="+id
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
}
return xmlHttp;
}



