
function StrCheck()
{
	if(event.keyCode<'0' || event.keyCode>'9')
	return false;
	return true;
}

function makevisible(cur,which)
{
//0.6 for mouse out opticity
strength=(which==0)? 1 : 0.8
if (cur.style.MozOpacity)
cur.style.MozOpacity=strength
else if (cur.filters)
cur.filters.alpha.opacity=strength*100
}

function CheckQty(F)
			{
				if(F.value=="" || F.value=="0")
				{
					F.value="0"
					return true
				}
				else
				{
					var myregex=new RegExp("^[1-9][0-9]{0,5}$");
					if(!F.value.match(myregex))
					{
						alert("Please Specify a valid Quanity.");
						F.select();
						return false;
					}
				}
				return true;
			}	
 function HighlightRow(chkB)	{
	
	// Old code for VS 2002 / .NET framework 1.0 code
	//-----------------------------------------------
	// In .NET 1.0 ASP.NET was using SPAN tag with
	// CheckBox control. 
	//var oItem = chkB.children;
	//xState=oItem.item(0).checked;
	var xState=chkB.checked;
		
	if(xState)
		{chkB.parentElement.parentElement.style.backgroundColor='lightcoral';  // grdEmployees.SelectedItemStyle.BackColor
		 chkB.parentElement.parentElement.style.color='white'; // grdEmployees.SelectedItemStyle.ForeColor
		}else 
		{chkB.parentElement.parentElement.style.backgroundColor='orange'; //grdEmployees.ItemStyle.BackColor
		 chkB.parentElement.parentElement.style.color='black'; //grdEmployees.ItemStyle.ForeColor
		}
	}

//cheking for empty checkbox count
function CheckAllCheckboxes(spanChk){
	
		//-----------------------------------------------
	count=0
		elm=spanChk.elements.length;
		for(i=0;i<elm;i++)
		if(spanChk.elements[i].type=="checkbox")
			{
			//elm[i].click();
			if(spanChk.elements[i].checked!=false)
			count++;
			}
		if(count==0)
		{
			alert("Please place a order by selecting any Book.");
			return false;
		}
		return true;
	}
	
// Email login
function ValidLogin(F)
{
	if(F.UserID.value=="")
	{
		alert("Please Enter Login Name.")
		return false
	}
	if(F.Password.value=="")
	{
		alert("Please Enter Password.")
		return false
	}
	F.user.value=F.UserID.value + "@ratnasagar.com"
	F.pass.value=F.Password.value
	if(!EmailCheck(F.user.value))
	return false
	F.UserID.value=""
	F.Password.value=""
	F.action="http://70.84.62.8:2095/login/"
	F.method="Post"
	F.target="_blank"
	//F.submit()
	//F.target="_blank"
	return true
	
}
//Checking mail
 function EmailCheck(S)
 {
 pass = S.indexOf('@',0);
 pass1 = S.indexOf('.',0);
 	if((pass==-1) || (pass1==-1))
 	{
		alert("Please Enter valid Login and Password.");
		return false;
	}
	return true
 }
 function EnterBut(F)
 {
	if(event.keyCode==13)
	{
		F.click();
		return false;
	}
	return true;
}

function OpenPPT(F)
{
	window.open("openppt.aspx?Cat="+F,"","toolbar=no,menubar=no;width=600,height=500")
}