// JavaScript Document
// JavaScript Document
   selectedtype=new Array();
   selectedstyle=new Array();   
   selectedbrand=new Array();
   selectedcolor=new Array();
   selectedstore=new Array();
   selectedprice=new Array();
   var myslider = {};
 
	function defaultslider(){
		myslider.setValues(0,200);  
	}
   
   function passprice(){
     var p1= document.getElementById('min').innerHTML
     var p2= document.getElementById('max').innerHTML
	
	 getprice(p1,p2);
   }   
   
   function getprice(price1,price2){
    
    var price=price1+'-'+price2;
	 
	    //alert(price);
		 
	     var c=document.getElementById("cat").value;
	     var t=document.getElementById("type").value;
	     var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var st=document.getElementById("stores").value;
		 document.getElementById("price").value=price;
		 
		 document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		 
		   var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	
	    // x_getprice_pass(price,c,t,s,br,st,do_price_pass);
   }
   
   function do_color_records(c){
     document.getElementById('pg').value="";
	 
	 document.getElementById("presult").innerHTML = c[0];
	 document.getElementById("pagination").innerHTML = c[1];
	 document.getElementById("z").innerHTML = c[2];
   }
   function color_records(cid){
        //alert(cid)
	     found=0;	 
		 for(i=0;i<selectedcolor.length;i++)
		 {
				//alert(selectedcolor[i])
				if(selectedcolor[i]==cid)
				{
				//alert("found"+i)
					position=i
					found=1
				}
				
		 }
			 
		 var id="changeclass"+cid;
		 if(found==0){
		   selectedcolor.push(cid);
		   //document.getElementById(id).className ="checkimage";
		   document.getElementById(id).className="activeselected";
		 }else{
			 
			  selectedcolor.splice(position,1);	
			  document.getElementById(id).className="active";
		 }	
		defaultslider();	
		
		load_type_color(selectedcolor);
		load_style_color(selectedcolor);
		load_brand_color(selectedcolor);
		load_store_color(selectedcolor);
	  		
	  var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  var m=document.getElementById("brand").value;
	  document.getElementById("color").value=selectedcolor;
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
	       var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	
	 // x_getcolor_records(selectedcolor,c,t,s,m,document.getElementById('search').value,document.getElementById('pg').value,do_color_records)
   }   
   
   function pagesize(){
       
	   var c=document.getElementById("cat").value;
	   var t=document.getElementById("type").value;  
	   var s=document.getElementById("style").value;
	   var br=document.getElementById("brand").value;
	   var co=document.getElementById("color").value;
	   var st=document.getElementById("stores").value;
	   
	   var pr=document.getElementById("price").value;
	   //var sy= document.getElementById("sby").value;
	   //document.getElementById("sortby").value=sy;		      
	   var ps= document.getElementById("ps").value;	   
	   //alert(ps);
	   document.getElementById("psize").value=ps;
	   
	   
	   var clear="yes";
	   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch); 
   }
   
   function pagesize2(){
       
	   var c=document.getElementById("cat").value;
	   var t=document.getElementById("type").value;  
	   var s=document.getElementById("style").value;
	   var br=document.getElementById("brand").value;
	   var co=document.getElementById("color").value;
	   var st=document.getElementById("stores").value;
	   
	   var pr=document.getElementById("price").value;
	      
	   var ps1= document.getElementById("ps1").value;
	   	   
	   //alert(ps1);
	   
	   for(i=0;i<document.getElementById("ps").options.length;i++)	{
			if( document.getElementById("ps").options[i].value == ps1 )	{
				document.getElementById("ps").selectedIndex = i;
			}
		}   
	   
	   
	   document.getElementById("psize").value=ps1;
	   
	   
	   var clear="yes";
	   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch); 
   }
   
   
   
      function pagesize1(){
       
	   var c=document.getElementById("cat").value;
	   var t=document.getElementById("type").value;  
	   var s=document.getElementById("style").value;
	   var br=document.getElementById("brand").value;
	   var co=document.getElementById("color").value;
	   var st=document.getElementById("stores").value;
	   
	   var pr=document.getElementById("price").value;
	   var sy= document.getElementById("sby").value;
	   document.getElementById("sortby").value=sy;
	   
/*	   if(document.getElementById("psize").value!=''){
	   var ps= document.getElementById("psize").value;	   
	   document.getElementById("psize").value=ps;
	   }else{	*/	      
	   var ps= document.getElementById("ps1").value;	   
	   document.getElementById("psize").value=ps;
	  // }
	   //alert(document.getElementById("psize").value)
	   
	   var clear="yes";
	   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch); 
   }
        
   function sortby(sby){   
	   var c=document.getElementById("cat").value;
	   var t=document.getElementById("type").value;  
	   var s=document.getElementById("style").value;
	   var br=document.getElementById("brand").value;
	   var co=document.getElementById("color").value;
	   var st=document.getElementById("stores").value;
	   
	   var pr=document.getElementById("price").value;
	  
	   //var sy= document.getElementById("sby").value;
	   document.getElementById("sortby").value=sby;
	   
	   var ps= document.getElementById("ps").value;	   
	   document.getElementById("psize").value=ps;
	      
	   var clear="yes";
	   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);   
   }
   
   function sortby_popular(){  
    
	   var c=document.getElementById("cat").value;
	   var st=document.getElementById("stores").value;

	   var sy= document.getElementById("sby").value;
	   document.getElementById("sortby").value=sy;
	   var ps= document.getElementById("ps").value;	   
	   document.getElementById("psize").value=ps;
	   
	   
	   var clear="yes";
	   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	   x_clearsearch(c,st,clear,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	      
   }
   
   
      function sortby1(){ 
	    
		   var c=document.getElementById("cat").value;
		   var t=document.getElementById("type").value;  
		   var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   
		   var pr=document.getElementById("price").value;
		   var sy= document.getElementById("sby1").value;
		   document.getElementById("sortby").value=sy;
		   
		   if(document.getElementById("psize").value!=''){
			   var ps= document.getElementById("psize").value;	   
			   document.getElementById("psize").value=ps;
		   }else{
			   var ps1= document.getElementById("ps1").value;	   
			   document.getElementById("psize").value=ps1;
		   }
		   
		   var clear="yes";
		   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		   
	   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);   
   }
   function clearall(){
        document.getElementById("key").value="";
        document.getElementById("search").value="";
        //document.getElementById("cat").value="";
		document.getElementById("type").value="";  
		document.getElementById("style").value="";
		document.getElementById("brand").value="";
		document.getElementById("color").value="";
		document.getElementById("stores").value="";
		document.getElementById("price").value="";
		document.getElementById("keyw").value="";
		document.getElementById("gend").value="";
		document.getElementById("sortby").value="";
		document.getElementById("psize").value="";
		 
		  selectedtype=[];
		  selectedstyle=[];   
		  selectedbrand=[];
		  selectedcolor=[];
		  selectedstore=[];
		  selectedprice=[];
		
        //maincat(1);
		  mcat=document.getElementById("cat").value;  
		  defaultslider();
		  loadtype(mcat);
		  gender_style(mcat);
		  load_brands_fromcat(mcat);
		  load_color_fromcat(mcat);
		  load_stores_fromcat(mcat);
		  //load_price_fromcat(mcat);
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  x_getmaincat(mcat,document.getElementById('pg').value,do_cat);
		//document.getElementById("cat").value="";
	   // x_getmaincat(mcat,document.getElementById('pg').value,do_cat); 
   }
   
   function do_clearsearch(z){
     document.getElementById('pg').value="";
	 
	 document.getElementById("presult").innerHTML = z[0];
	 document.getElementById("pagination").innerHTML = z[1];
	 document.getElementById("z").innerHTML = z[2];
		
   }
   
    function cleartype(){
	//alert("hai");  
	        var c=document.getElementById("cat").value;
			var t=document.getElementById("type").value;  
			var s=document.getElementById("style").value;
			var br=document.getElementById("brand").value;
			var co=document.getElementById("color").value;
			var st=document.getElementById("stores").value;
			var pr=document.getElementById("price").value;
			var clear="yes";
			
			if(t!=''){
			typeuncheck();					    
	     	t="";
			selectedtype=[];
			document.getElementById("type").value="";
			document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
			
			loadstyle(selectedtype);
			load_brands_fromtype(selectedtype);
			load_color_fromtype(selectedtype);
			load_stores_fromtype(selectedtype);
			
			x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
			}else{
			alert("No other type is selected to make clear!");
			return false;
			}
	   
    } 
	function clearkeyword(){
		    var c=document.getElementById("cat").value;
	        var t=document.getElementById("type").value;  
			var s=document.getElementById("style").value;
			var br=document.getElementById("brand").value;
			var co=document.getElementById("color").value;
			var st=document.getElementById("stores").value;
			var pr=document.getElementById("price").value;
			var clear="yes";
			document.getElementById("key").value="";
			document.getElementById("search").value="";
			
		   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	}
	function clearstyle(){	
	        var c=document.getElementById("cat").value;
	        var t=document.getElementById("type").value;  
			var s=document.getElementById("style").value;
			var br=document.getElementById("brand").value;
			var co=document.getElementById("color").value;
			var st=document.getElementById("stores").value;
			var pr=document.getElementById("price").value;
			var clear="yes";
			
			if(s!=''){
			styleuncheck();
			 selectedstyle=[];
			s="";
	       document.getElementById("style").value="";
		   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		    load_type(selectedstyle);	
			load_brands(selectedstyle);
			load_colors(selectedstyle);
			load_stores(selectedstyle);
		   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
		   }else{
		    alert("No other style is selected to make clear!");
			return false;		   
	       }
	}
	
	function clearbrand(){	
	       var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   if(br!=''){
		   branduncheck();	  		  	
		   br="";   
		    selectedbrand=[];
		   document.getElementById("brand").value="";				   
		   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		   
		   load_type_brand(selectedbrand);
		   load_style_brand(selectedbrand);
		   load_color_frombrand(selectedbrand);
		   load_store_frombrand(selectedbrand);
		
		   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);  
		   }else{
		   alert("No other brand is selected to make clear!");
			return false;		   
	       }
	}
	
	function clearcolor(){	
	       var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   if(co!=''){
		   coloruncheck();	  		  	
		   co="";   
		    selectedcolor=[];
		   document.getElementById("color").value="";				   
		   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		   
		   load_type_color(selectedcolor);
		   load_style_color(selectedcolor);
		   load_brand_color(selectedcolor);
		   load_store_color(selectedcolor);
		
		   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);  
		   }else{
		   alert("No other color is selected to make clear!");
			return false;		   
	       }
	}
	
	
	
	function clearstore(){
	       var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;		
		   var clear="yes"; 
		   if(st!=''){  
		   storeuncheck();		  
		   selectedstore=[];   
		   st="";
	       document.getElementById("stores").value="";		   
		   document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		   
		   load_type_store(selectedstore);
		   load_style_store(selectedstore);	 
		   load_color_store(selectedstore);
		   load_brand_store(selectedstore);
		   	 
		   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
		   }else{
		    alert("No other store is selected to make clear!");
			return false;		   
	       }
		   
	}
	
	function clearprice(){
	        var c=document.getElementById("cat").value;
	        var t=document.getElementById("type").value;  
	        var s=document.getElementById("style").value;
		    var br=document.getElementById("brand").value;
			var co=document.getElementById("color").value;
		    var st=document.getElementById("stores").value;
		    var pr=document.getElementById("price").value;
			var clear="yes";
			defaultslider();
			selectedprice=[];
			pr="";
			document.getElementById("price").value='';
			document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
			   x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
			
						   
		   
	}
	
	
	function priceuncheck(){
	        var pr=document.getElementById("price").value;
	        price=pr.split(",");
		    for(i=0;i<price.length;i++){
			  var id="change_image_price"+price[i];
			  document.getElementById(id).src="images/active-nonSelect.gif";
		    }
			return;	
	}
			
		
	function storeuncheck(){
	       var st=document.getElementById("stores").value;
		   var store=st.split(","); 
		   for(i=0;i<store.length;i++){
				//alert(store[i]);
				var id="change_image_store"+store[i];
				//alert(id);
				document.getElementById(id).src="images/active-nonSelect.gif";
		   }			
		   return;
	}
	
	function coloruncheck(){
	        var co=document.getElementById("color").value;
			color =co.split(",");
		    for(i=0;i<color.length;i++){
			  var id="changeclass"+color[i];
			  document.getElementById(id).className="active";
		    }
			return;
	}
	
	
	
	function branduncheck(){
	        var br=document.getElementById("brand").value;
			brand =br.split(",");
		    for(i=0;i<brand.length;i++){
			  var id="change_image_brand"+brand[i];
			  document.getElementById(id).src="images/active-nonSelect.gif";
		    }
			return;
	}
	
	function styleuncheck(){
	       var s=document.getElementById("style").value;
	       var style=s.split(","); 
		   for(i=0;i<style.length;i++){
		    	var id="change_image_style"+style[i];
		        document.getElementById(id).src="images/active-nonSelect.gif";
		   }
		   return;
	}
		
	function typeuncheck(){
	       var t=document.getElementById("type").value;
		  
	       var ts=t.split(",");			
		   for(i=0;i<ts.length;i++){
			   var id="change_image"+ts[i];
			   document.getElementById(id).src="images/active-nonSelect.gif";
		  }     
		   return;	
		   
	}
	
	function searchpaging(page){
	document.getElementById('pg').value=page;
	k=document.getElementById("key").value;
	document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	 x_get_findsearch(k,document.getElementById("cat").value,document.getElementById('pg').value,do_findsearch);
	}
	
	function keywordpaging(page){
	document.getElementById('pg').value=page;
	k=document.getElementById("keyw").value;
	g=document.getElementById("gend").value;
		
	document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	 x_getkeyword_search(k,g,document.getElementById('pg').value,do_keyword_search);
	}
	
		
	function catpaging(page){
	document.getElementById('pg').value=page;
	//maincat(document.getElementById("cat").value);
	mcat=document.getElementById("cat").value;
	if(mcat!=''){
	mcat=document.getElementById("cat").value;
	}else{
	mcat=1
	}
	document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	x_getmaincat(mcat,document.getElementById('pg').value,do_cat);	
	}
	
	function typepaging(page){
	//alert(page)
	mcat=document.getElementById("cat").value;
	document.getElementById('pg').value=page;
	var selectedtype=document.getElementById("type").value
	document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	x_gettype_records(mcat,selectedtype,document.getElementById('search').value,document.getElementById('pg').value,do_type_records);	
	//type_records(document.getElementById("type").value);
	}
	
	function stylepaging(page){
	var mcat=document.getElementById("cat").value; 	
	document.getElementById('pg').value=page;
	var selectedstyle=document.getElementById("style").value;
	document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
    x_getstyle_records(mcat,selectedstyle,document.getElementById('type').value,document.getElementById('search').value,document.getElementById('pg').value,do_style_records);
	//style_records(document.getElementById("style").value)	
	}	
	
	function brandpaging(page){
	    var c=document.getElementById("cat").value;
	    var t=document.getElementById("type").value;  
	    var s=document.getElementById("style").value;
	
		document.getElementById('pg').value=page;
        var m=document.getElementById("brand").value;
		document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		x_get_brands(m,c,t,s,document.getElementById('search').value,document.getElementById('pg').value,do_brands);
	//brands(document.getElementById("brand").value)
	}
	function colorpaging(page){
      var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  var m=document.getElementById("brand").value;
		
		document.getElementById('pg').value=page;
        var co=document.getElementById("color").value;
		document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		x_getcolor_records(co,c,t,s,m,document.getElementById('search').value,document.getElementById('pg').value,do_color_records);
	}
		
	function storespaging(page){	  	
	  var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  var br=document.getElementById("brand").value;
	  document.getElementById('pg').value=page;	 
	  var m=document.getElementById("stores").value;
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  x_getmerchant_records(m,c,t,s,br,document.getElementById('search').value,document.getElementById('pg').value,do_merchant_records);		 
	}
	
	function pstorespaging(page){
		  	
	  var c=document.getElementById("cat").value;
	  document.getElementById('pg').value=page;	 
	  var m=document.getElementById("pstores").value;
	  
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  x_getpopularmerchant(m,c,document.getElementById('pg').value,do_popularmerchant);		 
	}
	
	function pricepaging(page){
	  var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  var br=document.getElementById("brand").value;
	  var st=document.getElementById("stores").value;
	 
	  document.getElementById('pg').value=page;	 
	  var selectedprice=document.getElementById("price").value;
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  x_getprice_pass(selectedprice,c,t,s,br,st,document.getElementById('pg').value,do_price_pass);
	}
	
	function clearpaging(page){	
	  var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  var br=document.getElementById("brand").value;
	  var co=document.getElementById("color").value;
	  var st=document.getElementById("stores").value;	  
	  var pr=document.getElementById("price").value;
	  document.getElementById('pg').value=page;
	  var clear="yes";
	  
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	
	}	

	function do_cat(z) {			
	    /*alert(z[0]);
		alert(z[1]);*/
		//alert(z[1]);
		
	    document.getElementById('pg').value="";

		document.getElementById("presult").innerHTML = z[0];
		document.getElementById("pagination").innerHTML = z[1];
		document.getElementById("z").innerHTML = z[2];
					
	}
	function do_type(y) {	    
		document.getElementById("y").innerHTML = y;		
				
		if(document.getElementById('type').value!=''){
			tid=document.getElementById('type').value;
			var id1="change_image"+tid;	   						
			document.getElementById(id1).src ="images/active.gif";
			
		}	   
	}
	function do_pstyle(x) {	    
		document.getElementById("x").innerHTML = x;
		
		if(document.getElementById('style').value!=''){
		sid=document.getElementById('style').value;
		var id2="change_image_style"+sid;
	    document.getElementById(id2).src ="images/active.gif";
		}
	}
	function do_type_records(t) {
	    document.getElementById('pg').value="";
		document.getElementById("presult").innerHTML = t[0];
		document.getElementById("pagination").innerHTML = t[1];
		document.getElementById("z").innerHTML = t[2];
	}
	function do_gender_style(s) {
	    document.getElementById("x").innerHTML = s;
	}	
	function do_style_records(s) {
	    document.getElementById('pg').value="";
	
		document.getElementById("presult").innerHTML = s[0];
		document.getElementById("pagination").innerHTML = s[1];
		document.getElementById("z").innerHTML = s[2];
	}
	function do_popular_style(s){
	    document.getElementById("z").innerHTML = s;
	}	
	function do_price_pass(xy) {
	
	    document.getElementById('pg').value="";
		document.getElementById("presult").innerHTML = xy[0];
		document.getElementById("pagination").innerHTML = xy[1];
		document.getElementById("z").innerHTML = xy[2];
	}
	function do_merchant_records(m) {	
	    document.getElementById('pg').value="";   
		document.getElementById("presult").innerHTML = m[0];
		document.getElementById("pagination").innerHTML = m[1];
		document.getElementById("z").innerHTML = m[2];
		
	}
	function do_findsearch(k) {
	    document.getElementById('pg').value="";
		document.getElementById("presult").innerHTML = k[0];
		document.getElementById("pagination").innerHTML = k[1];
		document.getElementById("z").innerHTML = k[2];
		
	}
	function do_popular_type(k){	
		var str=k;
		var tot=str.split(",");
		var tid=tot[0];
		var cid=tot[1];	
		var sid=tot[2];	
		
	   if(cid==1){
	   document.getElementById("g1").className = "selected";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cid==2){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "selected";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cid==3){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "selected";
	   document.getElementById("g4").className = "";
	   }else{
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "selected";
	   }
		
		document.getElementById('cat').value=cid;
		document.getElementById('type').value=tid;
		document.getElementById('style').value=sid;
				
	    loadtype(cid);	   	   
	    loadstyle(tid); 
		load_brands(sid);
		load_stores(sid);
		//load_price_fromstyle(sid);

	}
	
	function do_makeactive(m){
	    var str1=m;
		var tot=str1.split(",");
		var tid=tot[0];
		var cid=tot[1];	
			
	   if(cid==1){
	   document.getElementById("g1").className = "selected";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cid==2){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "selected";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cid==3){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "selected";
	   document.getElementById("g4").className = "";
	   }else{
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "selected";
	   }
	   
   	   document.getElementById('cat').value=cid;
       document.getElementById('type').value=tid;
	   
	  loadtype(cid); 
	  loadstyle(tid);	  
	  load_brands_fromtype(tid);
	  load_stores_fromtype(tid);
	  //load_price_fromtype(tid);
	}	
		
	function do_keyword_search(k) {
	    document.getElementById('pg').value="";
				
		document.getElementById("presult").innerHTML = k[0];
		document.getElementById("pagination").innerHTML = k[1];
		document.getElementById("z").innerHTML = k[2];
	}
	
	function do_popularmerchant(k){
		document.getElementById('pg').value="";
		document.getElementById("z").innerHTML = k;
	}
	
	function do_compare(u){
	    document.getElementById("z").innerHTML =u;
	}
	function do_brands(m) {
	    document.getElementById('pg').value="";
		
		document.getElementById("presult").innerHTML = m[0];
		document.getElementById("pagination").innerHTML = m[1];
		document.getElementById("z").innerHTML = m[2];
		
	}
	function do_load_brands(br){
	    document.getElementById("br").innerHTML = br;
	}
	function do_load_stores(st){
	    document.getElementById("st").innerHTML = st;
	}
	function do_load_price(pr){
	   document.getElementById("pr").innerHTML = pr;
	}		
	function do_load_store_frombrand(st){
	   document.getElementById("st").innerHTML = st;
	}	
	function do_load_price_frombrand(pr){
	   document.getElementById("pr").innerHTML = pr;
	}
	function do_load_price_fromstyle(pr){
	   document.getElementById("pr").innerHTML = pr;
	}
	function do_load_brands_fromtype(br){
	document.getElementById("br").innerHTML = br;	
	}
	function do_load_stores_fromtype(st){
	document.getElementById("st").innerHTML = st;	
	}
	function do_load_price_fromtype(pr){
	document.getElementById("pr").innerHTML = pr;	
	}
	function do_load_brands_fromcat(br){
	document.getElementById("br").innerHTML = br;	
	}
	function do_load_stores_fromcat(st){
	document.getElementById("st").innerHTML = st;	
	}
	function do_load_price_fromcat(pr){
	document.getElementById("pr").innerHTML = pr;	
	}
	
	function do_load_color_fromcat(co){
	document.getElementById("co").innerHTML = co;	
	}		
	function do_load_color_fromtype(co){
	document.getElementById("co").innerHTML = co;
	}
	function do_load_colors(co){
	  document.getElementById("co").innerHTML = co;
	}
    function do_load_color_frombrand(co){
	   document.getElementById("co").innerHTML = co;
	}
	
	function abc(){
	   var m;
	   m="Mens";
	   //document.getElementById('cats').innerHTML="&raquo;&nbsp;<a onClick='maincat(1);loadtype(1)' href=#>" + m + "</a>";
	}

    //Product Display////////
	function maincat(cat) {
	
	  window.sajax_cancel();
	  
	   if(cat==1){
	   document.getElementById("g1").className = "selected";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cat==2){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "selected";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cat==3){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "selected";
	   document.getElementById("g4").className = "";
	   }else{
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "selected";
	   }
	   
	    document.getElementById("cat").value="";
		document.getElementById("type").value="";  
		document.getElementById("style").value="";
		document.getElementById("brand").value="";
		document.getElementById("stores").value="";
		document.getElementById("price").value="";
		document.getElementById("gend").value="";
		
		/*document.getElementById('minPrice').innerHTML=0;
		document.getElementById('maxPrice').innerHTML=500;*/
		
		defaultslider();
		
	  var mcat=cat;
	  var acat;
	  document.getElementById("cat").value=mcat
	  document.getElementById("x").innerHTML ="<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td width=4%>&nbsp;</td><td width=96%>( Please Select Any One Of The Type )</td></tr></table>"
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  //alert(document.getElementById("cat").value)	

	  loadtype(mcat);
	  gender_style(mcat);
	  load_brands_fromcat(mcat);
	  load_color_fromcat(mcat);
	  load_stores_fromcat(mcat);
	  //load_price_fromcat(mcat);
	  	 
	  selectedtype=[];
	  selectedstyle=[];   
      selectedbrand=[];
	  selectedcolor=[];
      selectedstore=[];
      selectedprice=[];
	 x_getmaincat(mcat,document.getElementById('pg').value,do_cat);

	}
	
	function maincat_fromhome(cat) {
	
	   window.sajax_cancel();
	  
	   if(cat==1){
	   document.getElementById("g1").className = "selected";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cat==2){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "selected";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "";
	   }else if(cat==3){
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "selected";
	   document.getElementById("g4").className = "";
	   }else{
	   document.getElementById("g1").className = "";
	   document.getElementById("g2").className = "";
	   document.getElementById("g3").className = "";
	   document.getElementById("g4").className = "selected";
	   }
		
	  var mcat=cat;
	  var acat;
	  document.getElementById("cat").value=mcat
      document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";

/*	  loadtype(mcat);
	  gender_style(mcat);
	  load_brands_fromcat(mcat);
	  load_color_fromcat(mcat);
	  load_stores_fromcat(mcat);*/
	  //load_price_fromcat(mcat);
	  	 
	  selectedtype=[];
	  selectedstyle=[];   
      selectedbrand=[];
	  selectedcolor=[];
      selectedstore=[];
      selectedprice=[];
	 x_getmaincat(mcat,document.getElementById('pg').value,do_cat);

	}
	
	
	function merchant_records_fromhome(mid) {	

	 document.getElementById("price").value="";
	 found=0;	 
	 for(i=0;i<selectedstore.length;i++)
	 {
			//alert(selectedtype[i])
			if(selectedstore[i]==mid)
			{
			//alert("found"+i)
				position=i
				found=1
			}
	 }
	 
	 var id="change_image_store"+mid;
	 if(found==0){
	  selectedstore.push(mid);
	  document.getElementById(id).src ="images/active.gif";
	 }else{
	  selectedstore.splice(position,1);	
	  document.getElementById(id).src ="images/active-nonSelect.gif";
	 }	
	 
	 //load_price(selectedstore);
	/* load_type_store(selectedstore);
	 load_style_store(selectedstore);	 
	 load_color_store(selectedstore);
	 load_brand_store(selectedstore);*/
	 
	 //defaultslider();
	  var m=selectedstore;
	  var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  //document.getElementById("stores").value=m;
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
	       var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	
	  //x_getmerchant_records(m,c,t,s,document.getElementById("brand").value,document.getElementById('search').value,document.getElementById('pg').value,do_merchant_records);
	}
	
	
	function type_records_fromhome(tid) {
	    var mcat=document.getElementById("cat").value; 		
		
	
			 found=0;	 
			 for(i=0;i<selectedtype.length;i++)
			 {
					//alert(selectedtype[i])
					if(selectedtype[i]==tid)
					{
					//alert("found"+i)
						position=i
						found=1
					}
					
			 }
				 
			 var id="change_image"+tid;
			 if(found==0){
			  selectedtype.push(tid);
			  //document.getElementById(id).className ="checkimage";
			   document.getElementById(id).src="images/active.gif";
			 }else{
				 
				  selectedtype.splice(position,1);	
				  document.getElementById(id).src="images/active-nonSelect.gif";
			 }
		 

	 /* document.getElementById('type').value=selectedtype;
	  defaultslider();
	  loadstyle(selectedtype);	  
	  load_brands_fromtype(selectedtype);
	  load_color_fromtype(selectedtype);
	  load_stores_fromtype(selectedtype);*/
	 // load_price_fromtype(selectedtype);
	   
	  //alert(selectedtype)	  
	  //var t=tid;
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
           var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch); 	   
		   
	// x_gettype_records(mcat,selectedtype,document.getElementById('search').value,document.getElementById('pg').value,do_type_records);
	}
	
	
	function style_records_fromhome(sid) {	
	//alert(sid);		
	//alert(document.getElementById('type').value);
	     var mcat=document.getElementById("cat").value; 
	
			 found=0;	 
			 for(i=0;i<selectedstyle.length;i++)
			 {
					//alert(selectedtype[i])
					if(selectedstyle[i]==sid)
					{
					//alert("found"+i)
						position=i
						found=1
					}
			 }
			 
			 var id="change_image_style"+sid;
			 
/*			 alert(found);
			 alert(id);*/
			 
			 if(found==0){
			  selectedstyle.push(sid);
			  document.getElementById(id).src ="images/active.gif";
			 }else{
			  selectedstyle.splice(position,1);	
			  document.getElementById(id).src ="images/active-nonSelect.gif";
			 }
		 
		/*	defaultslider(); 
		  load_type(selectedstyle);	
		  load_brands(selectedstyle);
		  load_colors(selectedstyle);
		  load_stores(selectedstyle);*/	 
	  var s=selectedstyle;
	  //styledisplay(s);
	 // document.getElementById("style").value=s
	  //document.getElementById("result").innerHTML="<strong>Now you are under Style</strong>";
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
	  	  
           var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);	  
	  /*x_getstyle_records(mcat,selectedstyle,document.getElementById('type').value,document.getElementById('search').value,document.getElementById('pg').value,do_style_records);*/
	  
	
	}
			
	function default_results(mcat){
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
	 x_getmaincat(mcat,document.getElementById('pg').value,do_cat);	
	}
	
	
		//Loading type////////
	function loadtype(stype) {
	  var t=stype;  
	  //document.getElementById("type").value=t
	  document.getElementById("y").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
		x_getloadtype(t,do_type);
	}
	
	function loadstyle(type) {
		  // document.getElementById(style).style.class = "font_red";   	   
	 var m=type;	   
     var c=document.getElementById("cat").value;
	 var s=document.getElementById("style").value;
	 var br=document.getElementById("brand").value;
	 var co=document.getElementById("color").value;
     var st=document.getElementById("stores").value;
	 	   
	   document.getElementById("x").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
		x_getloadstyle(m,c,s,br,co,st,do_pstyle);
	}
	
	function gender_style(gender){
	//alert(gender);	
	document.getElementById("x").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	x_getgender_style(gender,do_gender_style);
	}
	
	function typedisplay(m){
	x_gettypedisplay(m,do_typedisplay);	
	}
	
	function styledisplay(s){
	//document.getElementById("brands").innerHTML ="";
	x_getstyledisplay(s,do_styledisplay);
	}
	
	function type_records(tid) {
	    var mcat=document.getElementById("cat").value; 		
		
	
			 found=0;	 
			 for(i=0;i<selectedtype.length;i++)
			 {
					//alert(selectedtype[i])
					if(selectedtype[i]==tid)
					{
					//alert("found"+i)
						position=i
						found=1
					}
					
			 }
				 
			 var id="change_image"+tid;
			 if(found==0){
			  selectedtype.push(tid);
			  //document.getElementById(id).className ="checkimage";
			   document.getElementById(id).src="images/active.gif";
			 }else{
				 
				  selectedtype.splice(position,1);	
				  document.getElementById(id).src="images/active-nonSelect.gif";
			 }
		 
	
	 
	  document.getElementById('type').value=selectedtype;
	  defaultslider();
	  loadstyle(selectedtype);	  
	  load_brands_fromtype(selectedtype);
	  load_color_fromtype(selectedtype);
	  load_stores_fromtype(selectedtype);
	 // load_price_fromtype(selectedtype);
	   
	  //alert(selectedtype)	  
	  //var t=tid;
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
           var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch); 	   
		   
	// x_gettype_records(mcat,selectedtype,document.getElementById('search').value,document.getElementById('pg').value,do_type_records);
	}
	
	
	function style_records(sid) {	
	//alert(sid);		
	//alert(document.getElementById('type').value);
	     var mcat=document.getElementById("cat").value; 
	
			 found=0;	 
			 for(i=0;i<selectedstyle.length;i++)
			 {
					//alert(selectedtype[i])
					if(selectedstyle[i]==sid)
					{
					//alert("found"+i)
						position=i
						found=1
					}
			 }
			 
			 var id="change_image_style"+sid;
			 
/*			 alert(found);
			 alert(id);*/
			 
			 if(found==0){
			  selectedstyle.push(sid);
			  document.getElementById(id).src ="images/active.gif";
			 }else{
			  selectedstyle.splice(position,1);	
			  document.getElementById(id).src ="images/active-nonSelect.gif";
			 }
		 
			defaultslider(); 
		  load_type(selectedstyle);	
		  load_brands(selectedstyle);
		  load_colors(selectedstyle);
		  load_stores(selectedstyle);
		  
	 
	 
	  var s=selectedstyle;
	  //styledisplay(s);
	  document.getElementById("style").value=s
	  //document.getElementById("result").innerHTML="<strong>Now you are under Style</strong>";
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
	  	  
           var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);	  
	  /*x_getstyle_records(mcat,selectedstyle,document.getElementById('type').value,document.getElementById('search').value,document.getElementById('pg').value,do_style_records);*/
	  
	
	}
	
	function popular_style(sid,gender){
		popular_type(sid);     
		x_getpopular_style(sid,gender,do_popular_style);
	}
		
	function popular_type(sid){
	     document.getElementById("z").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></td></tr><tr><td>&nbsp;</td><tr></table>";	
		x_getpopular_type(sid,do_popular_type);	
	}	
	
	function populartypealone(tid,gender){	        
		makeactive(tid);
		document.getElementById("z").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></td></tr><tr><td>&nbsp;</td><tr></table>";	
		x_getpopulartypealone(tid,gender,do_populartypealone);
	}
	
	function makeactive(tid){
	    x_getmakeactive(tid,do_makeactive);
	}	
	
	function do_populartypealone(s){
		document.getElementById("z").innerHTML = s;
	}
		
	function load_brands(sid){
	 var c=document.getElementById("cat").value;
	 var t=document.getElementById("type").value;
	 var br=document.getElementById("brand").value;
	 var co=document.getElementById("color").value;
     var st=document.getElementById("stores").value;
	 
	 document.getElementById("br").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	 x_getload_brands(sid,c,t,br,co,st,do_load_brands);	
	 }
	 
	 function load_type(sid){
	 var c=document.getElementById("cat").value;
	 var t=document.getElementById("type").value;
	 var br=document.getElementById("brand").value;
	 var co=document.getElementById("color").value;
     var st=document.getElementById("stores").value;
	 
	 document.getElementById("y").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	 
	 x_getload_type(sid,c,t,br,co,st,do_load_type);
	 
	 }
	 function do_load_type(y){
	 document.getElementById("y").innerHTML = y;
	 }
	 	 	 
	 function load_colors(sid){
	 var c=document.getElementById("cat").value;
	 var t=document.getElementById("type").value;
	 var br=document.getElementById("brand").value;
	 var co=document.getElementById("color").value;
     var st=document.getElementById("stores").value;
	 document.getElementById("co").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	 x_getload_colors(sid,c,t,br,co,st,do_load_colors);	
	 }
	 
	 function load_stores(sid){
	 var c=document.getElementById("cat").value;
	 var t=document.getElementById("type").value;
	 var br=document.getElementById("brand").value;
	 var co=document.getElementById("color").value;
     var st=document.getElementById("stores").value;
	 document.getElementById("st").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	 x_getload_stores(sid,c,t,br,co,st,do_load_stores);	
	 }
	
	 function load_price(sid){
	     document.getElementById("pr").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 //var st=document.getElementById("stores").value;
	    x_getload_price(sid,c,t,s,br,do_load_price);
	 }
	 
	 function load_store_frombrand(bname){
	     document.getElementById("st").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var co=document.getElementById("color").value;
		 var st=document.getElementById("stores").value;
		 x_get_load_store_frombrand(bname,c,t,s,co,st,do_load_store_frombrand);
	 }
	 
	 function load_color_frombrand(bname){
	     document.getElementById("co").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var co=document.getElementById("color").value;
		 var st=document.getElementById("stores").value;
		 
		 x_get_load_color_frombrand(bname,c,t,s,co,st,do_load_color_frombrand);
	 }
	 
	 function load_style_brand(bname){
	     document.getElementById("x").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var co=document.getElementById("color").value;
		 var st=document.getElementById("stores").value;
         x_get_load_style_fromall(bname,c,t,s,co,st,do_load_style_fromall)
	 }
	 
	 function load_type_brand(bname){
	     document.getElementById("y").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var co=document.getElementById("color").value;
		 var st=document.getElementById("stores").value;
		 x_get_load_type_fromall(bname,c,t,s,co,st,do_load_type_fromall)
	 }
	 
	 function load_style_color(cname){
	     document.getElementById("x").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var st=document.getElementById("stores").value;		 
         x_get_load_style_fromcolor(cname,c,t,s,br,st,do_load_style_fromcolor)
	 }
	 	 function load_type_color(cname){
	     document.getElementById("y").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var st=document.getElementById("stores").value;
		 
         x_get_load_type_fromcolor(cname,c,t,s,br,st,do_load_type_fromcolor)
	 }
	 
	 function do_load_type_fromcolor(y){
	   document.getElementById("y").innerHTML = y;
	 }
	 
	  function do_load_style_fromcolor(x){
	   document.getElementById("x").innerHTML = x;
	 }
	 	 
	 function do_load_style_fromall(x){
	   document.getElementById("x").innerHTML = x;
	 }
	 
	 function do_load_type_fromall(y){
	   document.getElementById("y").innerHTML = y;
	 }
	 
	  function load_style_store(sname){
	     document.getElementById("x").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var co=document.getElementById("color").value;
         x_get_load_style_fromstore(sname,c,t,s,br,co,do_load_style_fromstore)
	 }
	 
	 function load_color_store(sname){
	 
	     document.getElementById("co").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var co=document.getElementById("color").value;
         x_get_load_color_fromstore(sname,c,t,s,br,co,do_load_color_fromstore)
		 
	 }
	 
	 function load_store_color(cname){
	 
	     document.getElementById("st").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var st=document.getElementById("stores").value;
         x_get_load_store_fromcolor(cname,c,t,s,br,st,do_load_store_fromcolor)
		 
	 }
	 
	 function load_brand_color(cname){
	 
	     document.getElementById("br").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var st=document.getElementById("stores").value;
		 
         x_get_load_brand_fromcolor(cname,c,t,s,br,st,do_load_brand_fromcolor)
		 
	 }
	 
	 
	 function do_load_brand_fromcolor(br){
	   document.getElementById("br").innerHTML =br;
	}
	 
	function do_load_store_fromcolor(s){
	   document.getElementById("st").innerHTML =s;
	}
	 
	 
	 function load_brand_store(sname){
	 
	     document.getElementById("br").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var co=document.getElementById("color").value;
		 
         x_get_load_brand_fromstore(sname,c,t,s,br,co,do_load_brand_fromstore)
		 
	 }
	 
	 function do_load_brand_fromstore(br){
	   document.getElementById("br").innerHTML = br;
	 }
	 
	 
	 
	 function load_type_store(sname){
		 document.getElementById("y").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
		 var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var co=document.getElementById("color").value;
		 x_get_load_type_fromstore(sname,c,t,s,br,co,do_load_type_fromstore)
    }
	
	function do_load_color_fromstore(co){
	   document.getElementById("co").innerHTML = co;
	 }
	 
	 function do_load_type_fromstore(y){
	   document.getElementById("y").innerHTML = y;
	 }
	 
	  function do_load_style_fromstore(x){
	   document.getElementById("x").innerHTML = x;
	 }
	 
	 function load_price_frombrand(bname){
	     document.getElementById("pr").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 var s=document.getElementById("style").value;
		 //var br=document.getElementById("brand").value;
		 x_get_load_price_frombrand(bname,c,t,s,do_load_price_frombrand);
	 
	 }
	 function load_price_fromstyle(sid){
	     document.getElementById("pr").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var t=document.getElementById("type").value;
		 x_get_load_price_fromstyle(sid,c,t,do_load_price_fromstyle);
	 }
	
	function load_brands_fromtype(tid){
	     document.getElementById("br").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
		 var c=document.getElementById("cat").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var co=document.getElementById("color").value;
		 var st=document.getElementById("stores").value;
	     x_get_load_brands_fromtype(tid,c,s,br,co,st,do_load_brands_fromtype);
	}
	function load_color_fromtype(tid){
	   document.getElementById("co").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
		 var c=document.getElementById("cat").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var co=document.getElementById("color").value;
		 var st=document.getElementById("stores").value;		 
	     x_get_load_color_fromtype(tid,c,s,br,co,st,do_load_color_fromtype);
	}
	
	function load_stores_fromtype(tid){
	     document.getElementById("st").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var co=document.getElementById("color").value;
		 var st=document.getElementById("stores").value;
		  x_get_load_stores_fromtype(tid,c,s,br,co,st,do_load_stores_fromtype);	     
	}
	function load_price_fromtype(tid){
	     document.getElementById("pr").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     var c=document.getElementById("cat").value;
		 x_get_load_price_fromtype(tid,c,do_load_price_fromtype);	
	}
	function load_brands_fromcat(cat){
	     document.getElementById("br").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
		 x_get_load_brands_fromcat(cat,do_load_brands_fromcat);
	}
	function load_color_fromcat(cat){
	     document.getElementById("co").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
		 x_get_load_color_fromcat(cat,do_load_color_fromcat);
	}
	
	function load_stores_fromcat(cat){
	     document.getElementById("st").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     x_get_load_stores_fromcat(cat,do_load_stores_fromcat);	     
	}
	function load_price_fromcat(cat){
	     document.getElementById("pr").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/bigloading.gif' border=0>&nbsp;&nbsp;Loading...</td></tr><tr><td>&nbsp;</td><tr></table>";
	     x_get_load_price_fromcat(cat,do_load_price_fromcat);	
	}
	
	
     function price_pass(ranges){
	    
	   	//alert(ranges);
			 found=0;	 
		 for(i=0;i<selectedprice.length;i++)
		 {
				//alert(selectedtype[i])
				if(selectedprice[i]==ranges)
				{
				//alert("found"+i)
					position=i
					found=1
				}
		 }
		 
		 var id="change_image_price"+ranges;
		 if(found==0){
		  selectedprice.push(ranges);
		  document.getElementById(id).src ="images/active.gif";
		 }else{
		  selectedprice.splice(position,1);	
		  document.getElementById(id).src ="images/active-nonSelect.gif";
		 }
		 //alert(selectedprice);
		 var c=document.getElementById("cat").value;
	     var t=document.getElementById("type").value;
	     var s=document.getElementById("style").value;
		 var br=document.getElementById("brand").value;
		 var st=document.getElementById("stores").value;
		 document.getElementById("price").value=selectedprice;
		 document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	     x_getprice_pass(selectedprice,c,t,s,br,st,do_price_pass);
	}
		
	function merchant_records(mid) {	

	 document.getElementById("price").value="";
	 found=0;	 
	 for(i=0;i<selectedstore.length;i++)
	 {
			//alert(selectedtype[i])
			if(selectedstore[i]==mid)
			{
			//alert("found"+i)
				position=i
				found=1
			}
	 }
	 
	 var id="change_image_store"+mid;
	 if(found==0){
	  selectedstore.push(mid);
	  document.getElementById(id).src ="images/active.gif";
	 }else{
	  selectedstore.splice(position,1);	
	  document.getElementById(id).src ="images/active-nonSelect.gif";
	 }	
	 
	 //load_price(selectedstore);
	 load_type_store(selectedstore);
	 load_style_store(selectedstore);	 
	 load_color_store(selectedstore);
	 load_brand_store(selectedstore);
	 
	 defaultslider();
	  var m=selectedstore;
	  var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  document.getElementById("stores").value=m;
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
	       var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	
	  //x_getmerchant_records(m,c,t,s,document.getElementById("brand").value,document.getElementById('search').value,document.getElementById('pg').value,do_merchant_records);
	}
	
	//document.onkeydown = checkKeycode

	function findsearch(keyword) {	
	defaultslider();
		if(keyword==''){ 	
		  alert("Please Enter the Keyword to search!");
		  document.getElementById("search").focus();
		  return false;
		}else{
		  var k=keyword;
		  //alert(k)
		  document.getElementById("key").value=k;
		  
		  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		 
		   var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
		
		 // x_get_findsearch(k,document.getElementById("cat").value,document.getElementById('pg').value,do_findsearch);
		  }
	  
	}
	
	function keyword_search(keyword,gender){	
		    	
		document.getElementById("keyw").value=keyword;
		document.getElementById("gend").value=gender;
		document.getElementById("cat").value=gender;
		 if(gender=='1'){
		   document.getElementById("g1").className = "selected";
		   document.getElementById("g2").className = "";
		   document.getElementById("g3").className = "";
		   document.getElementById("g4").className = "";
		}else if(gender=='2'){
		   document.getElementById("g1").className = "";
		   document.getElementById("g2").className = "selected";
		   document.getElementById("g3").className = "";
		   document.getElementById("g4").className = "";
		}else if(gender=='3'){
		 
		   document.getElementById("g1").className = "";
	       document.getElementById("g2").className = "";
	       document.getElementById("g3").className = "selected";
	       document.getElementById("g4").className = "";
		}else{
		
		  document.getElementById("g1").className = "";
	      document.getElementById("g2").className = "";
	      document.getElementById("g3").className = "";
	      document.getElementById("g4").className = "selected";
		}
		  defaultslider();
		  loadtype(gender);
		  gender_style(gender);
		  load_brands_fromcat(gender);
		  load_stores_fromcat(gender);
		  //load_price_fromcat(gender);
		
		document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
		x_getkeyword_search(keyword,gender,document.getElementById('pg').value,do_keyword_search);	
	}
	
	function brands(manuf) {

	 found=0;	 
	 for(i=0;i<selectedbrand.length;i++)
	 {
			//alert(selectedtype[i])
			if(selectedbrand[i]==manuf)
			{
			//alert("found"+i)
				position=i
				found=1
			}
	 }
	 
	 //manuf=manuf.replace(/_/, " ")
	// alert(manuf)
	 
	 var id="change_image_brand"+manuf;
	 //alert(id)
	 if(found==0){
	  selectedbrand.push(manuf);
	  document.getElementById(id).src ="images/active.gif";
	 }else{
	  selectedbrand.splice(position,1);	
	  document.getElementById(id).src ="images/active-nonSelect.gif";
	 }	
		//alert(selectedbrand);
		load_type_brand(selectedbrand);
		load_style_brand(selectedbrand);
		load_color_frombrand(selectedbrand);
		load_store_frombrand(selectedbrand);
		defaultslider();
		//load_price_frombrand(selectedbrand);
	
	  //document.getElementById("brands").innerHTML ="&nbsp;&raquo;&nbsp;<a onClick=brands('"+ selectedbrand + "'); href=#>" + selectedbrand + "</a>"
	  var m=selectedbrand;
	  var c=document.getElementById("cat").value;
	  var t=document.getElementById("type").value;
	  var s=document.getElementById("style").value;
	  document.getElementById("brand").value=m;
	  //document.getElementById("result").innerHTML ="<strong>Now you are under Brands</strong>";
	  document.getElementById("z").innerHTML = "<table width=100% border=0 cellpadding=0 cellspacing=0><tr><div>&nbsp;</div></tr><tr><div align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></div></tr><tr><div>&nbsp;</div></tr></table>";
	  
	       var c=document.getElementById("cat").value;
	       var t=document.getElementById("type").value;  
	       var s=document.getElementById("style").value;
		   var br=document.getElementById("brand").value;
		   var co=document.getElementById("color").value;
		   var st=document.getElementById("stores").value;
		   var pr=document.getElementById("price").value;
		   var clear="yes";
		   
	x_clearsearch(c,t,s,br,co,st,pr,clear,document.getElementById('search').value,document.getElementById('pg').value,document.getElementById("sortby").value,document.getElementById("psize").value,do_clearsearch);
	  
	  //x_get_brands(m,c,t,s,document.getElementById('search').value,document.getElementById('pg').value,do_brands);
	}
	
	function compare(ucode){
	var u=ucode;
	document.getElementById("z").innerHTML = "<table width=100% cellpadding=0 cellspacing=0><tr><td>&nbsp;</td></tr><tr><td align=center><img src='http://shoecss.s3.amazonaws.com/images/loading.gif'  border=0></td></tr><tr><td>&nbsp;</td><tr></table>";
	x_getcompare(u,do_compare);	
	}	
