//------------------------------------------------------------------------------
//© 2003 - SoftComm Technology ®. [ e-biz dimension of KMD ] All rights reserved. 
//------------------------------------------------------------------------------
//----------------------------------------------------------
	//Copyright (c) 2002 SoftComm Technology.
	//All rights reserved.

	//Project:    Myanmar Book Centre [ Online Book Sale ]
	//File:       mbc_check.js
	//Revised:    2002
	//Owner:      nOnOi
//-----------------------------------------------------------

//1.Old User Form Check
//Begin
function chk_login()
{
	if(document.login.email.value=="")
	{
		alert("Enter your email!");
		document.login.email.focus();
		return false;
	}
	if (!isEmail(login.email.value)) 
	{
		alert("Invalid email!");
		document.login.email.focus();
		document.login.email.select();
		return false;
	}
	if(document.login.pass.value=="")
	{
		alert("Enter your password!")
		document.login.pass.focus();
		return false;
	}
	return true;	
}
function cle_login()
{
	document.login.email.focus();
}
function isEmail(email) 
{
	var result = false
	var theStr = new String(email)
	var index = theStr.indexOf("@");
	if (index > 0) 
	{
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1)) 
		{
			result = true;
		}
	}
	return result;
}
//End

//2.New Register Form Check
//Begin
function chk_reg()
{
	if(document.reg.txtname.value=="")
	{
		alert("Enter your name!");
		document.reg.txtname.focus();
		return false;
	}
	if(document.reg.txtpass.value=="")
	{
		alert("Enter your password!");
		document.reg.txtpass.focus();
		return false;
	}	
	if(document.reg.txtsq.value=="")
	{
		alert("Enter secret question!");
		document.reg.txtsq.focus();
		return false;
	}
	if(document.reg.txtsa.value=="")
	{
		alert("Enter secret answer!");
		document.reg.txtsa.focus();
		return false;
	}
	if(document.reg.txtemail.value=="")
	{
		alert("Enter your email!");
		document.reg.txtemail.focus();
		return false;
	}
	if (!isEmail(reg.txtemail.value)) 
	{
		alert("Invalid email!");
		document.reg.txtemail.focus();
		document.reg.txtemail.select();
		return false;
	}	
	return true;
}
function cle_reg()
{
	document.reg.txtname.focus();
}
//End

//3.OrderStatus Detail New Window 
//Begin
function view(oid)
{
	var id;
	id = oid;
	opopup = window.showModalDialog('orderstatus_cd.asp?oid=' + id,"1",'dialogHeight:400px;dialogWidth:725px;status=no;help=no;resizable=no;location=no;menubar=no;toolbar=no')
	//opopup = window.open("orderstatus_cd.asp?oid=" + id,"newWindow","Height=400,Width=720,status=no,help=no,resizable=no,location=no,menubar=no,toolbar=no,scrollbars=yes")
}
//End

