var xmlProductFilter; function GetXmlHttpObject(){ var xmlHttp=null; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e){ // Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } var filterByChoice=""; function displayByFilterMenu(productId,filterType,selectMenu,dept){ filterByChoice=filterType; xmlProductFilter=GetXmlHttpObject(); var filterCriteria=selectMenu.options[selectMenu.options.selectedIndex].value; var url="index.cgi"; url=url+"?productFilter="+filterType+"&prt="+productId+"&filterCriteria="+filterCriteria+"&dept="+dept; //alert(url); xmlProductFilter.onreadystatechange=displayProductsByFilterMenu; xmlProductFilter.open("GET",url,true); xmlProductFilter.send(null); } function displayProductsByFilterMenu(){ if (xmlProductFilter.readyState==4){ if(xmlProductFilter.responseText != "" || xmlProductFilter.responseText != false){ document.getElementById('productTableContainer').innerHTML=xmlProductFilter.responseText; } else{ alert("Unable to update products with your 'Filter by "+filterByChoice+"' choice"); } } return false; } /*~~~~~~~~~~~~~~~~~~~~~~~ additonal jQuery code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ /* department - category shopping menu */ $(function(){ var theMenuId='#prodMenu ul'; $(theMenuId+' li ul').hide(); var activeNode=$.cookie('activeMenu'); $('#'+activeNode+' ul').show(); $('#'+activeNode).addClass('activeMenu'); var activeItem=$.cookie('activeItem'); $('#'+activeItem).addClass('activeItem'); $(theMenuId+' li').each(function(){ var thisId=$(this).attr('id'); $(this).click(function(){ if($('#'+thisId+' ul').css('display') != 'none'){ $(theMenuId+' li ul').hide(0); } else{ $(theMenuId+' li ul').hide(0); $('#'+thisId+' ul').show(0); } $.cookie('activeMenu',thisId); }); $('#'+thisId+' ul li a').click(function(){ $.cookie('activeItem',$(this).parent().attr('id')); }); }); }); /* remove the value of the keywords when taken focus to save manual deletion*/ $(function(){ $('#keyword').focusin(function(){ $(this).animate({opacity:1.0},250,function(){ $(this).attr('value',''); }); }); $('#keyword').focusout(function(){ var tv=$(this).attr('value'); if(tv == ''){ $(this).attr('value','Enter Keywords...'); } }); });