function lp()
{
	document.myfrm.action = "../myaccount/loyaltyprogram.asp";
	document.myfrm.submit();
}

function pressEnter(keyPressed){
if (keyPressed == 13){
	window.document.nivfrm.submit();
}
}

function onImage(){
	window.document.nivfrm.submit();
}

function FSrchIn() {
if ( (document.myfrm.txtkeywords.value =="") || (document.myfrm.txtkeywords.value == "Keywords") ) 
	{	alert ("Please enter your Search Keyword");
		document.myfrm.cbosearch.focus(); 	}
else
	{	
		//document.myfrm.txtkeywords.value ="";
		//document.myfrm.srchwrd.value ="";
		//document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/searchresult.asp";
		document.myfrm.submit();  }
}

function findkey(evt){

var key = (evt.which) ? evt.which : event.keyCode;

if (key==13){
FSrchIn();
}
}


function showall() {
		document.myfrm.txtkeywords.value ="";
		document.myfrm.action="../details/searchresult.asp";
		document.myfrm.submit();  
}


function AddtoCart(sno) 
{	
	document.myfrm.getProdID.value = sno;
//	alert(document.myfrm.getProdID.value);
	document.myfrm.action = "../shoppingcart/shoppingcart.asp";
	document.myfrm.submit(); }

function AddtoCartindex(sno) 
{	
	document.myfrm.getProdID.value = sno;
	document.myfrm.action = "../shoppingcart/shoppingcart.asp";
	document.myfrm.submit(); }

function goSignIn() {
	document.myfrm.action = "../myaccount/login.asp";
	document.myfrm.submit(); }

function goCreateAcct()
{
	document.myfrm.action = "../myaccount/createaccount.asp";
	document.myfrm.submit();
}

function getdetails(mycat,mysno,mycatnm,mypageno)
{
		
		document.myfrm.getcategory.value=mycat;
		document.myfrm.getsno.value=mysno;		
		document.myfrm.getcatname.value=mycatnm;
		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/bookdetails.asp";
		document.myfrm.submit();
}

//mycat - clicking on which category e.g SUB - Shop by subcategory
//mysno - clicking on which category sno e.g SUB - sno of subcategory
//mycatnm - category name
//myactualsno - parent category sno
//mypageno - resetting page no
//mynewageno - e.g u r in age that age sno
//fromwhichcat - from which cat page
function getdetailssubcat(mycat,mysno,mycatnm,myactualsno,mypageno,mynewageno,fromwhichcat)
{
		document.myfrm.getcategory.value=mycat;
		document.myfrm.getsno.value=myactualsno;		
		document.myfrm.getcatname.value=mycatnm;	
		document.myfrm.getsubcatsno.value=mysno;
		document.myfrm.newageno.value=mynewageno;
		document.myfrm.newageno.value=fromwhichcat;
		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/bookdetails.asp";
		document.myfrm.submit();
}

function getdetailssubcatforage(fromwhichcatpage,fromwhichcatsno,fromwhichcatname,clickedonwhichcat,clickedonsubcatsno,clickedonsubcatnm)
{
		document.myfrm.getcategory.value=fromwhichcatpage;
		document.myfrm.getsno.value=fromwhichcatsno;		
		document.myfrm.getcatname.value=fromwhichcatname;	
		document.myfrm.getclickedonwhichcat.value=clickedonwhichcat;
		document.myfrm.getclickedoncatsno.value=clickedonsubcatsno;
		document.myfrm.getclickedoncatnm.value=clickedonsubcatnm;
		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/bkda.asp";
		document.myfrm.submit();
}

function getdetailssubcatforcat(fromwhichcatpage,fromwhichcatsno,fromwhichcatname,clickedonwhichcat,clickedonsubcatsno,clickedonsubcatnm)
{
		document.myfrm.getcategory.value=fromwhichcatpage;
		document.myfrm.getsno.value=fromwhichcatsno;		
		document.myfrm.getcatname.value=fromwhichcatname;	
		document.myfrm.getclickedonwhichcat.value=clickedonwhichcat;
		document.myfrm.getclickedoncatsno.value=clickedonsubcatsno;
		document.myfrm.getclickedoncatnm.value=clickedonsubcatnm;
		document.myfrm.subgetclickedonwhichcat.value="";
		document.myfrm.subgetclickedoncatsno.value="";
		document.myfrm.subgetclickedoncatnm.value="";
		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/bkdc.asp";
		document.myfrm.submit();
}

//javascript:subgetdetailssubcatforcat
function subgetdetailssubcatforcat(fromwhichcatpage,fromwhichcatsno,fromwhichcatname,clickedonwhichcat,clickedonsubcatsno,clickedonsubcatnm,getageclickedonwhichcat,getageclickedonsubcatsno,getageclickedonsubcatnm)
{
		document.myfrm.getcategory.value=fromwhichcatpage;
		document.myfrm.getsno.value=fromwhichcatsno;		
		document.myfrm.getcatname.value=fromwhichcatname;	

		document.myfrm.getclickedonwhichcat.value=clickedonwhichcat;
		document.myfrm.getclickedoncatsno.value=clickedonsubcatsno;
		document.myfrm.getclickedoncatnm.value=clickedonsubcatnm;

		document.myfrm.subgetclickedonwhichcat.value=getageclickedonwhichcat;
		document.myfrm.subgetclickedoncatsno.value=getageclickedonsubcatsno;
		document.myfrm.subgetclickedoncatnm.value=getageclickedonsubcatnm;

		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/bkdc.asp";
		document.myfrm.submit();
}

function getdetailssubcatforr(fromwhichcatpage,fromwhichcatsno,fromwhichcatname,clickedonwhichcat,clickedonsubcatsno,clickedonsubcatnm)
{
		document.myfrm.getcategory.value=fromwhichcatpage;
		document.myfrm.getsno.value=fromwhichcatsno;		
		document.myfrm.getcatname.value=fromwhichcatname;	
		document.myfrm.getclickedonwhichcat.value=clickedonwhichcat;
		document.myfrm.getclickedoncatsno.value=clickedonsubcatsno;
		document.myfrm.getclickedoncatnm.value=clickedonsubcatnm;
		document.myfrm.getpageno.value="xy";

		document.myfrm.action="../details/bkdr.asp";
		document.myfrm.submit();
}

function getdetailssubcatforprice(fromwhichcatpage,fromwhichcatsno,fromwhichcatname,clickedonwhichcat,clickedonsubcatsno,clickedonsubcatnm)
{
		document.myfrm.getcategory.value=fromwhichcatpage;
		document.myfrm.getsno.value=fromwhichcatsno;		
		document.myfrm.getcatname.value=fromwhichcatname;	
		document.myfrm.getclickedonwhichcat.value=clickedonwhichcat;
		document.myfrm.getclickedoncatsno.value=clickedonsubcatsno;
		document.myfrm.getclickedoncatnm.value=clickedonsubcatnm;
		document.myfrm.subgetclickedonwhichcat.value="";
		document.myfrm.subgetclickedoncatsno.value="";
		document.myfrm.subgetclickedoncatnm.value="";
		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/bkdp.asp";
		document.myfrm.submit();
}

function getdetailssubcatfornewadd(fromwhichcatpage,fromwhichcatsno,fromwhichcatname,clickedonwhichcat,clickedonsubcatsno,clickedonsubcatnm)
{
		document.myfrm.getcategory.value=fromwhichcatpage;
		document.myfrm.getsno.value=fromwhichcatsno;		
		document.myfrm.getcatname.value=fromwhichcatname;	
		document.myfrm.getclickedonwhichcat.value=clickedonwhichcat;
		document.myfrm.getclickedoncatsno.value=clickedonsubcatsno;
		document.myfrm.getclickedoncatnm.value=clickedonsubcatnm;
		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/newadditions.asp";
		document.myfrm.submit();
}

function getdetailssubcatforspecialoffers(fromwhichcatpage,fromwhichcatsno,fromwhichcatname,clickedonwhichcat,clickedonsubcatsno,clickedonsubcatnm)
{
		document.myfrm.getcategory.value=fromwhichcatpage;
		document.myfrm.getsno.value=fromwhichcatsno;		
		document.myfrm.getcatname.value=fromwhichcatname;	
		document.myfrm.getclickedonwhichcat.value=clickedonwhichcat;
		document.myfrm.getclickedoncatsno.value=clickedonsubcatsno;
		document.myfrm.getclickedoncatnm.value=clickedonsubcatnm;
		document.myfrm.getpageno.value="xy";
		document.myfrm.action="../details/specialoffers.asp";
		document.myfrm.submit();
}

function getdetailsforage(mycat,mysno,mycatnm)
{
		document.myfrm.getcategory.value=mycat;
		document.myfrm.getsno.value=mysno;		
		document.myfrm.getcatname.value=mycatnm;
		document.myfrm.getpageno.value="xy";
		document.myfrm.getclickedonwhichcat.value="";
		document.myfrm.getclickedoncatsno.value="";
		document.myfrm.getclickedoncatnm.value="";

		document.myfrm.action="../details/bkda.asp";
		document.myfrm.submit();
}

function getdetailsforcategory(mycat,mysno,mycatnm)
{
		document.myfrm.getcategory.value=mycat;
		document.myfrm.getsno.value=mysno;		
		document.myfrm.getcatname.value=mycatnm;
		document.myfrm.getpageno.value="xy";
		document.myfrm.getclickedonwhichcat.value="";
		document.myfrm.getclickedoncatsno.value="";
		document.myfrm.getclickedoncatnm.value="";

		document.myfrm.action="../details/bkdc.asp";
		document.myfrm.submit();
}

function getdetailsforreturngifts(mycat,mysno,mycatnm)
{
		document.myfrm.getcategory.value=mycat;
		document.myfrm.getsno.value=mysno;		
		document.myfrm.getcatname.value=mycatnm;
		document.myfrm.getpageno.value="xy";
		document.myfrm.getclickedonwhichcat.value="";
		document.myfrm.getclickedoncatsno.value="";
		document.myfrm.getclickedoncatnm.value="";

		document.myfrm.action="../details/bkdr.asp";
		document.myfrm.submit();
}

function getdetailsforreturnprice(mycat,mysno,mycatnm)
{
		document.myfrm.getcategory.value=mycat;
		document.myfrm.getsno.value=mysno;		
		document.myfrm.getcatname.value=mycatnm;	
		document.myfrm.getpageno.value="xy";
		document.myfrm.getclickedonwhichcat.value="";
		document.myfrm.getclickedoncatsno.value="";
		document.myfrm.getclickedoncatnm.value="";

		document.myfrm.action="../details/bkdp.asp";
		document.myfrm.submit();
}

function getdetails(mycat,mysno,mycatnm)
{
		document.myfrm.getcategory.value=mycat;
		document.myfrm.getsno.value=mysno;		
		document.myfrm.getcatname.value=mycatnm;	
		document.myfrm.getpageno.value="xy";
		document.myfrm.getclickedonwhichcat.value="";
		document.myfrm.getclickedoncatsno.value="";
		document.myfrm.getclickedoncatnm.value="";

		document.myfrm.action="../details/bookdetails.asp";
		document.myfrm.submit();
}

function specialoffers()
{
		document.myfrm.action="../details/specialoffers.asp";
		document.myfrm.submit();
}

function newadd()
{
		document.myfrm.action="../details/newadditions.asp";
		document.myfrm.submit();
}

function fnCheckAlphNumeric()
{

var iAsciiNull=0;

if ((window.event.keyCode>=65 && window.event.keyCode<=90) || (window.event.keyCode>=97 && window.event.keyCode<=122) || window.event.keyCode==32 || window.event.keyCode==44 || window.event.keyCode==46 || window.event.keyCode==64)
{
return true; 
}
else if ((window.event.keyCode<48 || window.event.keyCode>57))
{ 
window.event.keyCode=iAsciiNull;
return false; 
}
else
{
return true; 
}
}

function fnCheckAlphNumericnospace()
{

var iAsciiNull=0;


if ((window.event.keyCode>=65 && window.event.keyCode<=90) || (window.event.keyCode>=97 && window.event.keyCode<=122))

{
return true; 
}
else if ((window.event.keyCode<48 || window.event.keyCode>57))

{ 
window.event.keyCode=iAsciiNull;
return false; 
}

else
{
return true; 
}
}


//logout
function lout()
{
	window.open("logout.asp","newWindow");
	window.opener = top;
	window.close();
	setTimeout("lout()",2);

}
