// JavaScript Document
function addToCart(pid,head,b){
document.getElementById("shoppingCart").style.display='block';
var url="Order/addToCart.php?pid="+pid; 
if(head){ 
	var att=new Array();
	att=head.split(",");
	var sv=new Array();
	for(i=0;i<att.length;i++){
		if(b=='B'){var S="sB"+i+"-"+pid; var Q="qtyB"+pid;}
		else {var S="s"+i+"-"+pid; var Q="qty"+pid;}
		si=document.getElementById([S]); 
		sv[i]=si.options[si.selectedIndex].value;  
		if(sv[i]==""){alert("Please select "+att[i]); return}
		
		url+="&Item"+i+"="+sv[i]; 	
	}
}

else {if(b=='B'){var Q="qtyB"+pid;} else var Q="qty"+pid;}
q=document.getElementById([Q]); 
qt=q.options[q.selectedIndex].value;  
if(qt=='0'){alert("Please select quantity"); return}
else{		
url+="&qty="+qt; 
if(b=='B'){self.parent.tb_remove();}
return LoadPage(url,'shoppingCart');

}
}

function deleteThis(opID){
var cfm=confirm("Remove this product fron your shopping cart?");
if(cfm==true){url="Order/deleteProduct.php?opID="+opID; 
	return LoadPage(url,'shoppingCart')
	}
else return false
}

/*
function sendPsw(){
var email=document.getElementById("pswEmail").value; 
document.getElementById("forgotPasswordForm").style.display="none";
document.getElementById("loginForm").style.display="block";
var url="sendPassword.php?pswEmail="+email; 
return Loading(url,'loginForm')
}
*/
function getElement(id) {
    return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null;
}

function viewResult(page,a){
//var page=location.href; 
var b=getElement("brand"); 
var brand=b.options[b.selectedIndex].value; 
if(brand!=''){page+="brand="+brand+"&";}
var g=getElement("gender"); 
var gender=g.options[g.selectedIndex].value;
if(gender!=''){page+="gender="+gender+"&";}
if(a=='ALL'){page+="all=1&";}
location=page;
}