(function($){$.ifixpng=function(customPixel){$.ifixpng.pixel=customPixel;};$.ifixpng.getPixel=function(){return $.ifixpng.pixel||'images/pixel.gif';};var hack={ltie7:$.browser.msie&&$.browser.version<7,filter:function(src){return"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop,src='"+src+"')";}};$.fn.ifixpng=hack.ltie7?function(){return this.each(function(){var $$=$(this);var base=$('base').attr('href');if(base){base=base.replace(/\/[^\/]+$/,'/');}
if($$.is('img')||$$.is('input')){if($$.attr('src')){if($$.attr('src').match(/.*\.png([?].*)?$/i)){var source=(base&&$$.attr('src').search(/^(\/|http:)/i))?base+$$.attr('src'):$$.attr('src');$$.css({filter:hack.filter(source),width:$$.width(),height:$$.height()}).attr({src:$.ifixpng.getPixel()}).positionFix();}}}else{var image=$$.css('backgroundImage');if(image.match(/^url\(["']?(.*\.png([?].*)?)["']?\)$/i)){image=RegExp.$1;image=(base&&image.substring(0,1)!='/')?base+image:image;$$.css({backgroundImage:'none',filter:hack.filter(image)}).children().children().positionFix();}}});}:function(){return this;};$.fn.iunfixpng=hack.ltie7?function(){return this.each(function(){var $$=$(this);var src=$$.css('filter');if(src.match(/src=["']?(.*\.png([?].*)?)["']?/i)){src=RegExp.$1;if($$.is('img')||$$.is('input')){$$.attr({src:src}).css({filter:''});}else{$$.css({filter:'',background:'url('+src+')'});}}});}:function(){return this;};$.fn.positionFix=function(){return this.each(function(){var $$=$(this);var position=$$.css('position');if(position!='absolute'&&position!='relative'){$$.css({position:'relative'});}});};})(jQuery);
;(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.6rc6",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},cssCache:{},css:function(name){if($.ui.cssCache[name]){return $.ui.cssCache[name];}
var tmp=$('<div class="ui-gen"></div>').addClass(name).css({position:'absolute',top:'-5000px',left:'-5000px',display:'block'}).appendTo('body');$.ui.cssCache[name]=!!((!(/auto|default/).test(tmp.css('cursor'))||(/^[1-9]/).test(tmp.css('height'))||(/^[1-9]/).test(tmp.css('width'))||!(/none/).test(tmp.css('backgroundImage'))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css('backgroundColor'))));try{$('body').get(0).removeChild(tmp.get(0));}catch(e){}
return $.ui.cssCache[name];},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});return _remove.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(event,key,value){if(event.target==element){return self._setData(key,value);}}).bind('getData.'+name,function(event,key){if(event.target==element){return self._getData(key);}}).bind('remove',function(){return self.destroy();});};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').removeAttr('aria-disabled');},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element
[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+
this.namespace+'-state-disabled').attr("aria-disabled",value);}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);event=$.Event(event);event.type=eventName;if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.widget.defaults={disabled:false};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;return false;}});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(event){if(event.originalEvent.mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=true;this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);(function($){$.widget("ui.slider",$.extend({},$.ui.mouse,{_init:function(){var self=this,o=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"
+" ui-slider-"+this.orientation
+" ui-widget"
+" ui-widget-content"
+" ui-corner-all");this.range=$([]);if(o.range){if(o.range===true){this.range=$('<div></div>');if(!o.values)o.values=[this._valueMin(),this._valueMin()];if(o.values.length&&o.values.length!=2){o.values=[o.values[0],o.values[0]];}}else{this.range=$('<div></div>');}
this.range.appendTo(this.element).addClass("ui-slider-range"
+" ui-widget-header");(o.range=="min")&&(this.orientation=="horizontal")&&this.range.css({left:0});(o.range=="max")&&(this.orientation=="horizontal")&&this.range.css({right:0});(o.range=="min")&&(this.orientation=="vertical")&&this.range.css({bottom:0});(o.range=="max")&&(this.orientation=="vertical")&&this.range.css({top:0});}
if($(".ui-slider-handle",this.element).length==0)
$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle").ifixpng();if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length<o.values.length)
$('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle").ifixpng();}
this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default"
+" ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(event){event.preventDefault();}).hover(function(){$(this).addClass('ui-state-hover');},function(){$(this).removeClass('ui-state-hover');}).focus(function(){self.handles.removeClass('ui-state-focus');$(this).addClass('ui-state-focus');}).blur(function(){$(this).removeClass('ui-state-focus');});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i);});this.handles.keydown(function(event){var index=$(this).data("index.ui-slider-handle");if(self.options.disabled)
return;switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(!self._keySliding){self._keySliding=true;$(this).addClass("ui-state-active");self._start(event);}
break;}
var curVal,newVal,step=self._step();if(self.options.values&&self.options.values.length){curVal=newVal=self.values(index);}else{curVal=newVal=self.value();}
switch(event.keyCode){case $.ui.keyCode.HOME:newVal=self._valueMin();break;case $.ui.keyCode.END:newVal=self._valueMax();break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal==self._valueMax())return;newVal=curVal+step;break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal==self._valueMin())return;newVal=curVal-step;break;}
self._slide(event,index,newVal);}).keyup(function(event){if(self._keySliding){self._stop(event);self._change(event);self._keySliding=false;$(this).removeClass("ui-state-active");}});this._refreshValue();},destroy:function(){this.handles.remove();this.element.removeClass("ui-slider"
+" ui-slider-horizontal"
+" ui-slider-vertical"
+" ui-slider-disabled"
+" ui-widget"
+" ui-widget-content"
+" ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();},reset:function(){if(this.options.range){this.options.values=[this._valueMin(),this._valueMax()];this._refreshValue();}else
this._setData("value",this._valueMin());this._change();this._stop();},_mouseCapture:function(event){var o=this.options;if(o.disabled)
return false;this._start(event);this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);var distance=this._valueMax()+1,closestHandle;var self=this,index;this.handles.each(function(i){var thisDistance=Math.abs(normValue-self.values(i));if(distance>thisDistance){distance=thisDistance;closestHandle=$(this);index=i;}});if(o.range&&(this.values(0)+this.values(1))==0){closestHandle=$(this.handles[++index]);}
self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();var offset=closestHandle.offset();var mouseOverHandle=!$(event.target).parents().andSelf().is('.ui-slider-handle');this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left+(parseInt(closestHandle.css('marginLeft'),10)||0),top:event.pageY-offset.top+(parseInt(closestHandle.css('marginTop'),10)||0)};normValue=this._normValueFromMouse(position);this._slide(event,index,normValue);return true;},_mouseStart:function(event){return true;},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY};var normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false;},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._stop(event);this._change(event);this._handleIndex=null;this._clickOffset=null;return false;},_detectOrientation:function(){this.orientation=this.options.orientation=='auto'?(this.element[0].offsetWidth/this.element[0].offsetHeight>1?'horizontal':'vertical'):this.options.orientation;},_normValueFromMouse:function(position){var pixelTotal,pixelMouse;if('horizontal'==this.orientation){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);}
var percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1)percentMouse=1;if(percentMouse<0)percentMouse=0;if('vertical'==this.orientation)
percentMouse=1-percentMouse;var valueTotal=this._valueMax()-this._valueMin(),valueMouse=rangeFunc(percentMouse,this._valueMin(),this._valueMax()),valueMouseModStep=valueMouse%this.options.step,normValue=valueMouse-valueMouseModStep;if(valueMouseModStep>(this.options.step/2))
normValue+=this.options.step;return normValue;},_start:function(event){this._trigger("start",event,{value:this.value()});},_slide:function(event,index,newVal){var handle=this.handles[index];if(this.options.values&&this.options.values.length){var otherVal=this.values(index?0:1);if((index==0&&newVal>=otherVal)||(index==1&&newVal<=otherVal))
newVal=otherVal;if(newVal!=this.values(index)){var newValues=this.values();newValues[index]=newVal;var allowed=this._trigger("slide",event,{handle:handle,value:newVal,values:newValues});var otherVal=this.values(index?0:1);if(allowed!==false){this.values(index,newVal,!(event.type=='mousedown'&&this.options.animate));}}}else{if(newVal!=this.value()){var allowed=this._trigger("slide",event,{handle:handle,value:newVal});if(allowed!==false){this._setData('value',newVal,(event.type=='mousedown'&&this.options.animate));}}}},_stop:function(event){this._trigger("stop",event,{value:this.value()});},_change:function(event){this._trigger("change",event,{value:this.value()});},value:function(newValue){if(arguments.length){this._setData("value",newValue);this._change();}
return this._value();},values:function(index,newValue,noAnimation){if(!this.options.animate)noAnimation=true;if(arguments.length>1){this.options.values[index]=newValue;this._refreshValue(!noAnimation);this._change();}
if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(index);}else{return this.value();}}else{return this._values();}},moveto:function(index,newValue,noAnimation){if(!this.options.animate)noAnimation=true;if(this.options.range){this.options.values[index]=newValue;this._refreshValue(!noAnimation);this._change();this._stop();}else
this.value(newValue);},_setData:function(key,value){$.widget.prototype._setData.apply(this,arguments);switch(key){case'orientation':this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case'value':this._refreshValue();break;}},_step:function(){var step=this.options.step;return step;},_value:function(){var val=this.options.value;if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;},_values:function(index){if(arguments.length){var val=this.options.values[index];if(val<this._valueMin())val=this._valueMin();if(val>this._valueMax())val=this._valueMax();return val;}else{return this.options.values;}},_valueMin:function(){var valueMin=this.options.min;return valueMin;},_valueMax:function(){var valueMax=this.options.max;return valueMax;},_refreshValue:function(animate){var oRange=this.options.range,o=this.options,self=this;if(this.options.values&&this.options.values.length){var vp0,vp1;this.handles.each(function(i,j){var valPercent=antiRangeFunc(self.values(i),self._valueMin(),self._valueMax())*(self.orientation=='horizontal'?(self.element.outerWidth()-$(this).width()/2+2):100);var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'px';$(this).stop(1,1)[animate?'animate':'css'](_set,o.animate);if(self.options.range===true){if(self.orientation=='horizontal'){(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({left:valPercent+'px'},o.animate);(i==1)&&self.range[animate?'animate':'css']({width:(valPercent-lastValPercent)+'px'},{queue:false,duration:o.animate});}else{(i==0)&&self.range.stop(1,1)[animate?'animate':'css']({bottom:(valPercent)+'%'},o.animate);(i==1)&&self.range[animate?'animate':'css']({height:(valPercent-lastValPercent)+'%'},{queue:false,duration:o.animate});}}
lastValPercent=valPercent;});}else{var valPercent=(this.value()-this._valueMin())/(this._valueMax()-this._valueMin())*100;var _set={};_set[self.orientation=='horizontal'?'left':'bottom']=valPercent+'%';this.handle.stop(1,1)[animate?'animate':'css'](_set,o.animate);(oRange=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[animate?'animate':'css']({left:0,width:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="horizontal")&&this.range[animate?'animate':'css']({left:valPercent+'%',width:(100-valPercent)+'%'},{queue:false,duration:o.animate});(oRange=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[animate?'animate':'css']({top:(100-valPercent)+'%',height:valPercent+'%'},o.animate);(oRange=="max")&&(this.orientation=="vertical")&&this.range[animate?'animate':'css']({bottom:valPercent+'%',height:(100-valPercent)+'%'},{queue:false,duration:o.animate});}}}));$.extend($.ui.slider,{getter:"value values moveto",version:"1.6rc6",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:'auto',range:false,step:1,value:0,values:null}});})(jQuery);
jQuery.extend({historyCurrentHash:undefined,historyCallback:undefined,historyInit:function(callback){jQuery.historyCallback=callback;if(location.href.indexOf('#')>=0){var current_hash='#'+location.href.split('#')[1];}else{var current_hash='#';}
jQuery.historyCurrentHash=current_hash;if(jQuery.browser.msie){if(jQuery.historyCurrentHash==''){jQuery.historyCurrentHash='#';}
$("body").prepend('<iframe id="jQuery_history" style="display: none;"></iframe>');var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=current_hash;}
else if($.browser.safari){jQuery.historyBackStack=[];jQuery.historyBackStack.length=history.length;jQuery.historyForwardStack=[];jQuery.isFirst=true;}
jQuery.historyCallback(current_hash.replace(/^#/,''));setInterval(jQuery.historyCheck,100);},historyAddHistory:function(hash){jQuery.historyBackStack.push(hash);jQuery.historyForwardStack.length=0;this.isFirst=true;},historyCheck:function(){if(jQuery.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentDocument||ihistory.contentWindow.document;if(location.href.indexOf('#')>=0){var current_hash='#'+iframe.location.href.split('#')[1];}else{var current_hash='#';}
if(current_hash!=jQuery.historyCurrentHash){location.hash=current_hash;jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''));}}else if($.browser.safari){if(!jQuery.dontCheck){var historyDelta=history.length-jQuery.historyBackStack.length;if(historyDelta){jQuery.isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++)jQuery.historyForwardStack.unshift(jQuery.historyBackStack.pop());}else{for(var i=0;i<historyDelta;i++)jQuery.historyBackStack.push(jQuery.historyForwardStack.shift());}
var cachedHash=jQuery.historyBackStack[jQuery.historyBackStack.length-1];if(cachedHash!=undefined){jQuery.historyCurrentHash=location.hash;jQuery.historyCallback(cachedHash);}}else if(jQuery.historyBackStack[jQuery.historyBackStack.length-1]==undefined&&!jQuery.isFirst){if(document.URL.indexOf('#')>=0){jQuery.historyCallback(document.URL.split('#')[1]);}else{var current_hash=location.hash;jQuery.historyCallback('');}
jQuery.isFirst=true;}}}else{if(location.href.indexOf('#')>=0){var current_hash='#'+location.href.split('#')[1];}else{var current_hash='#';}
if(current_hash!=jQuery.historyCurrentHash){jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''));}}},historyLoad:function(hash){var newhash;if(jQuery.browser.safari){newhash=hash;}
else{newhash='#'+hash;location.hash=newhash;}
jQuery.historyCurrentHash=newhash;if(jQuery.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=newhash;jQuery.historyCallback(hash);}
else if(jQuery.browser.safari){jQuery.dontCheck=true;this.historyAddHistory(hash);var fn=function(){jQuery.dontCheck=false;};window.setTimeout(fn,200);jQuery.historyCallback(hash);location.hash=newhash;}
else{jQuery.historyCallback(hash);}}});
$(document).ready(function(){if($("div#price_slider").length){$("#price_slider").ifixpng('/images/site2/pixel.gif');$("#price_slider").slider({range:true,min:slide_price_min,max:slide_price_max,values:[slide_price_from,slide_price_to],slide:priceSlide,stop:priceChange});$("#price_from").val(parseInt($("#price_slider").slider("values",0)));$("#price_to").val(parseInt($("#price_slider").slider("values",1)));$("#price_from").keyup(function(event){if(parseInt($(this).val())&&parseInt($(this).val())<$('#price_slider').slider("values",1))
$('#price_slider').slider("moveto",0,parseInt($(this).val()));});$("#price_to").keyup(function(event){if(parseInt($(this).val())&&parseInt($(this).val())>$('#price_slider').slider("values",0))
$('#price_slider').slider("moveto",1,parseInt($(this).val()));});$("a#x-close-price").click(function(){$('#price_slider').slider("reset");reload_prod_list(0,1,0,0,0,-1,-1,'');$(this).hide();});$("div.prc").show();}
setTimeout(queryChange,500);if(ar_match=location.hash.match(/q=([^&]+)/))
$("#q").val(ar_match[1]);$.historyInit(pageload);});Array.prototype.remove_el=function(s){for(i=0;i<this.length;i++)
if(this[i]==s)
this.splice(i,1);}
Array.prototype.unique=function(){tmp=new Array(0);for(i=0;i<this.length;i++){if(!tmp.contains(this[i])){tmp.length+=1;tmp[tmp.length-1]=this[i];}}
return tmp;}
Array.prototype.contains=function(e){for(j=0;j<this.length;j++)if(this[j]==e)return true;return false;}
function priceSlide(e,ui){$("#price_from").val(parseInt(ui.values[0]));$("#price_to").val(parseInt(ui.values[1]));}
function priceChange(){var price_from=$("#price_slider").slider("values",0);var price_to=$("#price_slider").slider("values",1);if(price_from>slide_price_min||price_to<slide_price_max){reload_prod_list(0,1,0,0,0,price_from,price_to)}
$("#price_from").val(price_from);$("#price_to").val(price_to);}
var prevQuery="";function queryChange(){if(prevQuery!=$("#q").val()&&$("#q").val().length>1){reload_prod_list(0,1,0,0,0,0,0,$("#q").val());prevQuery=$("#q").val();}else setTimeout(queryChange, 500);}
var ar_filter_ids=new Array();var ar_path=location.pathname.split("/");var lang_dir='/';if(ar_path[1]=='ukr'){lang_dir='/'+ar_path[1]+'/';ar_path.shift();}
if(ar_path[4]==''){need_reload=false;}else{ar_match=location.pathname.match(/f-((\d+-?)+)/);ar_filter_ids=ar_match[1].split("-");need_reload=true;}
ajax_dir=ar_path[1]+"_ajax";function get_qs(params){var qstring='';var counter=0;var amp='';for(var k in params){if(typeof params[k]=='function'||!params[k])continue;amp=(counter)?'&':'';qstring=qstring+amp+k+'='+params[k];counter++;}
return qstring;}
function del_filter(filter_id){var parent_li=$("li#"+filter_id);if(parent_li.length){var parent_div=$("li#"+filter_id+" div.del-filter");$("li#"+filter_id+" a.x-filter").remove();f_link=parent_div.find("a");parent_div.remove();f_link.prependTo(parent_li);}
ar_filter_ids.remove_el(filter_id);}
function unset_filters(){var ar_buf_filter_ids=ar_filter_ids.slice(0);for(var i=0;i<ar_buf_filter_ids.length;i++){del_filter(ar_buf_filter_ids[i]);}}
function add_filter(filter_id){var parent_li=$("li#"+filter_id);if(parent_li.find("a.x-filter").length)return;parent_li.removeClass("hidden");parent_li.find("a").wrap("<div class=\"del-filter\"><div class=\"i1\"><div class=\"i2\"><div class=\"i3\"></div></div></div></div>");$("li#"+filter_id+" .i3").prepend("<a href=\"#\" onclick=\"reload_prod_list("+filter_id+", 1, 0, 0); return false\" class=\"x-filter\"><img src=\"/images/site2/x-close.gif\" alt=\"\" /></a>");parent_li.find("div").click(function(){$("li#"+filter_id+" a.x-filter").click()});ar_filter_ids[ar_filter_ids.length]=filter_id;ar_filter_ids=ar_filter_ids.unique().sort();}
function reload_prod_list(filter_id,page,sortby,sortdir,city_id,price_from,price_to,q){if(filter_id>0){var parent_li=$("li#"+filter_id);if(parent_li.find("a.x-filter").length){del_filter(filter_id);}else{add_filter(filter_id);}}
else if(filter_id==-1)
unset_filters();filter_path=ar_filter_ids.join("-");var params=new Array();if(location.href.indexOf('#')>=0){var current_hash='#'+location.href.split('#')[1];}else{var current_hash='#';}
if(ar_match=current_hash.match(/sortby=(\d+)/))
_sortby=ar_match[1];else
_sortby=0;if(ar_match=current_hash.match(/sortdir=(\d+)/))
_sortdir=ar_match[1];else
_sortdir=0;if(ar_match=current_hash.match(/f_city_id=(\d+)/))
_city_id=ar_match[1];else
_city_id=0;if(ar_match=current_hash.match(/price_from=(\d+)/))
_price_from=ar_match[1];else
_price_from=0;if(ar_match=current_hash.match(/price_to=(\d+)/))
_price_to=ar_match[1];else
_price_to=0;if(ar_match=current_hash.match(/q=([^&]+)/))
_qq=ar_match[1];else
_qq='';params["f_city_id"]=city_id==-1?0:city_id||_city_id;params["page"]=page||1;params["sortby"]=sortby||_sortby;params["sortdir"]=sortdir||_sortdir;params["price_from"]=price_from==-1?0:price_from||_price_from;params["price_to"]=price_to==-1?0:price_to||_price_to;params["q"]=q==-1?0:q||_qq;if(filter_path){qs=get_qs(params);new_hash="f-"+filter_path+"/"+(qs?"?"+qs:"");if($.historyCurrentHash!='#'+new_hash){$.historyLoad(new_hash);}}else{qs=get_qs(params);new_hash=qs?"?"+qs:"";if($.historyCurrentHash!='#'+new_hash){$.historyLoad(new_hash);}}
return false;}
function loadpage(data){setTimeout(queryChange, 500);$('#centercol').remove();$('<div></div>').attr("id","centercol").html(data.list).insertAfter("#rightcol");if($('#ajax_header').length)$('#ajax_header').html(data.list_header);$('#centercol, #ajax_header').css("opacity",1);$('#loading').hide();window.scrollTo(0,0);cities_init();sort_init();}
function pageload(hash){if(hash){unset_filters();$('#centercol, #ajax_header').css("opacity",0.33);$('#loading').center().show();filter_path="";if(ar_match=hash.match(/f-((\d+-?)+)/)){filter_path=ar_match[1];}
if(hash.match(/price_/)){$("a#x-close-price").show();}else{$("a#x-close-price").hide();$('#price_slider').slider("reset");}
if(hash.match(/q=/)){$("a#x-close-query").show();}else{$("a#x-close-query").hide();$("#q").val('');}
if(filter_path){var ar_buf_filter_ids=filter_path.split("-");var f_items_cnt=ar_buf_filter_ids.length;for(j=0;j<f_items_cnt;j++){add_filter(ar_buf_filter_ids[j]);}}
if(need_reload){location.href=lang_dir+ar_path[1]+'/'+ar_path[2]+'/'+ar_path[3]+'/#'+hash;}else{$.getJSON(lang_dir+ajax_dir+'/'+ar_path[2]+'/'+ar_path[3]+'/'+(hash?hash:''),{},loadpage);}}else{if(location.href.match(/#$/)){$('#centercol, #ajax_header').css("opacity",0.33);$('#loading').center().show();unset_filters();if(need_reload){location.href=lang_dir+ar_path[1]+'/'+ar_path[2]+'/'+ar_path[3]+'/#';}else{$.getJSON(lang_dir+ajax_dir+'/'+ar_path[2]+'/'+ar_path[3]+'/',{},loadpage);}}}}