// controls.js - last modified: March 09 2010 11:17:36.


$(document).ready
(function()
{$.xui=$.xui||{};$.xui.currentQuery='';var navigate=function(args,add,scroll)
{if(/\?/.test(args))args=args.replace(/^.*\?(.*$)/g,'$1');var href=window.location.href.replace(/^.*\.\w{2,4}(\/.*\.html?).*$/,'$1');$.getJSON(href+'?'+args+"&method=jsonp&jsoncallback=?",function(data)
{$('#search-filters').replaceWith(data['search-filters']);$('#current-filters').replaceWith(data['current-filters']);$('#product-list').replaceWith(data['product-list']);registerNavControls();$('#search-filters .shade').Shade();$.xui.currentQuery=$.str.urldecode(data['currentQuery']);if(add)$.historyLoad($.xui.currentQuery,true);if(scroll)
$.scrollTo('#product-list',400);});};$.xui.navigate=navigate;var registerNavControls=function()
{$('a.search-filter-link').click(function(evt)
{evt.preventDefault();var href=this.href.replace(/^.*\.\w{2,4}(\/.*\.html).*$/,'$1');if(href!=window.location.href.replace(/^.*\.\w{2,4}(\/.*\.html).*$/,'$1'))
{window.location.href=href;return false;}
navigate(this.href.replace(/^.*\?(.*$)/g,'$1'),true,false);return false;});$('form.search-nav-form').submit(function(evt)
{evt.preventDefault();navigate($(this).serialize(),true,false);return false;});$('a.search-nav-link').click(function(evt)
{evt.preventDefault();var href=this.href.replace(/^.*\.\w{2,4}(\/.*\.html).*$/,'$1');if(href!=window.location.href.replace(/^.*\.\w{2,4}(\/.*\.html).*$/,'$1'))
{window.location.href=href;return false;}
navigate(this.href.replace(/^.*\?(.*$)/g,'$1'),true,true);return false;});};$.historyInit(null,function(hash)
{if($.xui.currentQuery!=hash)
navigate(hash,true,false);});registerNavControls();});