// JavaScript Document
function ajax_validatelogin(username, pass){
	new ajax ('ajax.php', {postBody: 'method=validate_login&username='+username+'&pass='+pass, onComplete: validatelogin_callback});
	document.getElementById("WAIT").style.left = (Screen.getViewportWidth()/2 - (300/2))+"px";
	document.getElementById("WAIT").style.top = (Screen.getScrollTop()+(Screen.getViewportHeight()/2)-50)+"px";
	document.getElementById("WAIT").style.display = '';
	document.getElementById("COVER").style.display = '';
	document.getElementById("COVER").style.height = Screen.getDocumentHeight()+'px';
}

function validatelogin_callback(request, uservar){
	document.getElementById("WAIT").style.display = 'none';
	document.getEleentById("COVER").style.display = 'none';
	if(request!=null){
		if(request.responseText=="OK"){
			document.frm_login.submit();
		}else{
			alert("Login Failed !! Did you entered username and password properly?");
		}
	}else{
		alert("Temporary failure. Please try again later");
	}
}

// Function for play video
function popup_videoplayer(video_id){
	var popwindow = window.open('index.php?view=playvideo&id='+video_id,'VideoPlayer','width=400,height=300,status=0,address=0,resize=1');
	if(!popwindow){
		alert("Your POP UP Blocker blocked the video player\n\nPlease disable any POP UP Blocker,\nor hold down CNTRL key while clicking on button/link");
	}
}
