var iframeEl;jQuery.fn.extend({formtips:function(options){return this.each(function(){var el=this;el.config={input:jQuery(options.input,this),tips:options.tips,left:options.left?options.left:$(el).width()+$(el).position().left}
var tips=el.config.tips;el.config.input.focus(function(){$(this).nextAll(tips).show().css("left",el.config.left);}).blur(function(){$(this).nextAll(tips).hide();})})},defaultvalue:function(options){return this.each(function(){var el=this;el.config={msg:jQuery(options.message,this),input:jQuery(options.input,this)}
el.config.msg.click(function(){$(this).hide().next(el.config.input).focus();})
el.config.input.each(function(){$(this).existvalue(el.config.msg);}).blur(function(){$(this).existvalue(el.config.msg);}).keyup(function(){$(this).existvalue(el.config.msg);})})},existvalue:function(option){var e=this.prev(option);if(this[0].value){e.hide();}else{e.css("display","inline");}},overrow:function(options){return this.each(function(){var el=this;el.config={obj:jQuery(options.obj,this),po:options.po,onEvent:options.on,offEvent:options.off}
el.config.obj.bind(el.config.onEvent,function(){$(this).parents(el.config.po).addClass("over");}).bind(el.config.offEvent,function(){$(this).parents(el.config.po).removeClass("over");})})},checkboxSwitch:function(option){var el=this;var switcher=el.filter(":checkbox[name="+option+"]");switcher.click(function(){var e=this;el.each(function(){this.checked=e.checked;})})
this.not(switcher).click(function(){var o=(el.length==el.is(":checked").length)?true:false;switcher.each(function(){this.checked=o;})})},IEoverlap:function(v){if(jQuery.browser.msie&&jQuery.browser.version<7){if(!iframeEl){iframeEl=document.createElement("IFRAME");iframeEl.frameBorder=0;iframeEl.src="javascript:false";iframeEl.style.display="none";iframeEl.style.position="absolute";iframeEl.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";document.getElementsByTagName("body")[0].appendChild(iframeEl);}
if(v!="hidden"){var e=this;$(iframeEl).css({left:e.offset().left,top:e.offset().top,width:e.outerWidth(),height:e.outerHeight(),display:"block"})}else{$(iframeEl).hide();}}},poplocation:function(options,e){return this.each(function(){var el=this;el.config={container:jQuery(options.container),obj:jQuery(options.obj,jQuery(options.container)),shadow:jQuery(options.shadow,jQuery(options.container)),speaker:jQuery(options.speaker,jQuery(options.container)),direction:options.direction,motion:options.motion}
$(".activepop").hide();el.config.container.css({display:"inline",visibility:"hidden"}).addClass("activepop");var oW=el.config.obj.outerWidth(),oH=el.config.obj.outerHeight(),e=$(el),win=$(window),doc=$(document),tempLeft=parseInt(e.position().left),tempTop=parseInt(e.position().top),objLeft,objTop,objWidth=0,objHeight=0,toward,prefix="pop";var sw=el.config.speaker.length?12:0;switch(el.config.direction){case 1:if(win.width()-tempLeft-e.outerWidth()+doc.scrollLeft()>oW){objLeft=tempLeft+e.outerWidth()+sw;toward="w";el.config.speaker.css("left",-sw+"px");}else{objLeft=tempLeft-oW-sw;toward="e";el.config.speaker.css("right",-sw+"px");}
if(win.height()-tempTop+doc.scrollTop()>oH){objTop=tempTop;el.config.speaker.addClass(prefix+toward+"a");}else{objTop=tempTop-oH+e.outerHeight();el.config.speaker.addClass(prefix+toward+"b").css("bottom",el.config.obj.css("padding-bottom"));}
setlocation();break;case 2:if(win.width()-tempLeft+doc.scrollLeft()>oW){objLeft=tempLeft;toward="a";}else{objLeft=tempLeft-oW+e.outerWidth();toward="b";el.config.speaker.css("right",el.config.obj.css("padding-right"));}
if(win.height()-tempTop-e.outerHeight()+doc.scrollTop()>oH){objTop=tempTop+e.outerHeight()+sw
el.config.speaker.addClass(prefix+"n"+toward).css("top",-sw+"px");}else{objTop=tempTop-oH-sw
el.config.speaker.addClass(prefix+"s"+toward).css("bottom",-sw+"px");}
setlocation();break;default:e.mousemove(tipmove=function(ev){el.config.speaker.addClass(prefix+"wa").css("left",-sw+"px");objLeft=ev.pageX-e.offset().left+e.position().left+sw*2,objTop=ev.pageY-e.offset().top+e.position().top;setlocation();})}
function setdimension(){if(!objWidth||!objHeight){objWidth=el.config.obj.width(),objHeight=el.config.obj.height();}
el.config.obj.css({width:$.browser.msie?oW:objWidth,height:$.browser.msie?oH:objHeight})}
function setlocation(){setdimension();el.config.shadow.css({width:el.config.obj.outerWidth(),height:el.config.obj.outerHeight()}).add(el.config.obj).css({position:"absolute",left:objLeft+"px",top:objTop+"px",zIndex:"100"}).IEoverlap();if(el.config.motion){el.config.container.css({visibility:"visible",display:"none"}).slideDown();}else{el.config.container.css("visibility","visible");}}})},elastic:function(options){return this.each(function(){var el=this;el.config={buttons:jQuery(options.buttons,this),content:jQuery(options.content,this),limitedHeight:options.limitedHeight,collapseAll:options.collapseAll}
var oHeight=el.config.content.outerHeight();var dHeight=oHeight-el.config.limitedHeight;if(oHeight>el.config.limitedHeight&&dHeight>el.config.limitedHeight/2){el.config.content.height(el.config.limitedHeight).find(".brandimg").hide();el.config.buttons.css("display","block").click(function(){if($(this).hasClass("onread")){el.config.content.css("overflow","hidden").animate({height:(el.config.collapseAll?0:el.config.limitedHeight)},oHeight,function(){if(el.config.collapseAll)$(this).hide()});}else{el.config.content.show().animate({height:oHeight},dHeight,function(){$(this).css("overflow","visible")}).find(".brandimg").show();}
$(this).toggleClass("onread");return false;});}})},scaleUp:function(options){return this.filter("img").each(function(){var el=this;el.config={magnifier:options.magnifier,fixWidth:options.fixWidth?options.fixWidth:"auto",fixHeight:options.fixHeight?options.fixHeight:"auto",offset:options.offset}
$(el).wrap("<span></span>").after("<span class=\""+el.config.magnifier+"\" style=\"position:absolute; margin:"+el.config.offset+"\"></span>").after("<span class=\"shadow\" style=\"display:none\"></span><img src=\""+el.src+"\" class=\"scaledUpImage\" style=\"position:absolute; visibility:hidden; display:none; z-index:2\" />").add($("."+el.config.magnifier,this.parentNode)).click(function(){var ell=$(this).siblings("img.scaledUpImage");ell.css("display","block");var tw=ell.width(),th=ell.height(),elLeft=$(el).position().left,elTop=$(el).position().top;ell.add(ell.prev(".shadow")).css({left:elLeft,top:elTop,width:el.config.fixWidth,height:el.config.fixHeight,visibility:"visible",zIndex:"100"})
var ellLeft=elLeft-(tw-ell[0].scrollWidth)/2;if(ellLeft+tw>$(window).width()){var aLeft=(tw-$(window).width())*-1;}else if($(el).offset().left-elLeft<ellLeft*-1){var aLeft=($(el).offset().left-elLeft);}else{var aLeft=ellLeft;}
ell.add(ell.prev(".shadow")).animate({width:tw,height:th,left:aLeft+"px",top:elTop-(th-ell[0].scrollHeight)/2+"px"},500,function(){ell.IEoverlap()}).mouseout(function(){$(this).add(ell.prev(".shadow")).css({visibility:"hidden",display:"none"}).IEoverlap("hidden");})});})},ascroll:function(){if(this.length){var targetOffset=this.offset().top;$('html,body').animate({scrollTop:targetOffset},1000,"swing");}},hoverIntent:function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}
if(p==this){return false;}
var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}
if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);},rating:function(instanceSettings){if(this.length==0)return this;instanceSettings=$.extend({},$.rating,instanceSettings||{});this.each(function(i){var settings=$.extend({},instanceSettings||{},($.metadata?$(this).metadata():($.meta?$(this).data():null))||{});var n=(this.name||'unnamed-rating').replace(/\[|\]+/g,"_");if(!$.rating.groups[n])$.rating.groups[n]={count:0};i=$.rating.groups[n].count;$.rating.groups[n].count++;$.rating.groups[n].readOnly=$.rating.groups[n].readOnly||settings.readOnly||$(this).attr('disabled');if(i==0){$.rating.groups[n].valueElem=$('<input type="hidden" name="'+n+'" value=""'+(settings.readOnly?' disabled="disabled"':'')+'/>');$(this).before($.rating.groups[n].valueElem);if($.rating.groups[n].readOnly||settings.required){}
else{$(this).before($('<div class="cancel"><a title="'+settings.cancel+'">'+settings.cancelValue+'</a></div>').mouseover(function(){$.rating.event.drain(n,this,settings);$(this).addClass('star_on');}).mouseout(function(){$.rating.event.reset(n,this,settings);$(this).removeClass('star_on');}).click(function(){$.rating.event.click(n,this,settings);}));}};eStar=$('<div class="star"><a title="'+(this.title||this.value)+'">'+this.value+'</a></div>');$(this).after(eStar);if(settings.half)settings.split=2;if(typeof settings.split=='number'&&settings.split>0){var stw=($.fn.width?$(eStar).width():0)||settings.starWidth;var spi=(i%settings.split),spw=Math.floor(stw/settings.split);$(eStar).width(spw).find('a').css({'margin-left':'-'+(spi*spw)+'px'})};$(eStar).addClass('star_group_'+n);if($.rating.groups[n].readOnly)
$(eStar).addClass('star_readonly');else
$(eStar).addClass('star_live').mouseover(function(){$.rating.event.drain(n,this,settings);$.rating.event.fill(n,this,settings,'hover');}).mouseout(function(){$.rating.event.drain(n,this,settings);$.rating.event.reset(n,this,settings);}).click(function(){$.rating.event.click(n,this,settings);});if(this.checked)$.rating.groups[n].current=eStar;$(this).remove();if(i+1==this.length)$.rating.event.reset(n,this,settings);});for(n in $.rating.groups)
(function(c,v,n){if(!c)return;$.rating.event.fill(n,c,instanceSettings||{},'on');$(v).val($(c).children('a').text());})
($.rating.groups[n].current,$.rating.groups[n].valueElem,n);return this;}});function searchkey(obj){var k=obj.value;if(k.match(/\S/)){var word=k.split(/[\s,\?]+/);$(obj).next(".brandselection").find("li a").each(function(){this.innerHTML=this.innerHTML.replace(/<\/?[^>]+(>|$)/g,"");var key=this.innerHTML;var matched=0;var newText="";for(w=0;w<word.length;w++){if(word[w]){var str=new RegExp(word[w],"gi");if(key.search(str)>-1){matched=1;while(key.search(str)>-1){var io=key.search(str);if(key.lastIndexOf(">",io)>=key.lastIndexOf("<",io)){newText+=key.substring(0,io)+"<font class='matchedkey'>"+key.substr(io,word[w].length)+"</font>";key=key.substr(io+word[w].length);this.innerHTML=newText+key;}}}else{matched=0;break;}}}
if(matched){this.parentNode.style.display="block";}else{if(!$(this).hasClass("on")){this.parentNode.style.display="none";}}})}else{$(".brandselection li a").each(function(){this.parentNode.style.display="block";this.innerHTML=this.innerHTML.replace(/<\/?[^>]+(>|$)/g,"");})}
if($.browser.msie)panelHeight();}
function panelHeight(){$("ul.brandselection, ul.sizeselection").each(function(){var e=this;e.style.height="auto";e.style.height=(e.offsetHeight>200)?"200px":"auto";})}
function showAjaxLoading(){var al=$("#ajaxloading");al.css({left:(($("body").width()-al.width())/2)+"px",top:$.browser.msie?$(document).scrollTop()+"px":0});}
function hideAjaxLoading(){var al=$("#ajaxloading");al.css({left:(($("body").width()-al.width())/2)+"px",top:"-30px"});}
function promptAlert(){$("#promptmessage").slideDown();}
function exclusiveitem(ei){var ei=$(ei);$(".exclusive",ei).parents("a").hover(function(){$(".item",this).stop().animate({top:0},100);},function(){$(".item",this).stop().animate({top:"15px"},100);})}
$(document).ready(function(){$("a[href*='#']").not(".alphafilter a").click(function(){var fregment=this.href.substring(this.href.indexOf("#")+1);if(fregment){var a=$("a[name="+fregment+"]");if(a.length){a.ascroll();return false;}}})
$(".scaledImage").scaleUp({magnifier:"magnifier",fixHeight:"70px",offset:"54px 0 0 -16px"})
var tmpcookie=new Date();chkcookie=(tmpcookie.getTime()+'');document.cookie="chkcookie="+chkcookie+"; path=/";if(document.cookie.indexOf(chkcookie,0)<0){$("#noCookie").show();}
if($.browser.msie)try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}
$("img[src$=.png]").ifixpng();});function initBrowsePanel(e){var target=e?$(e):$("#leftmenu");$("ul li>a",target).not(".filter li>a:not(.disabled)").click(function(){$(this).addClass("on").parent("li").siblings("li").children("a:not(.disabled)").removeClass("on");return false;}).end().filter(".filter li>a:not(.disabled)").click(function(){$(this).toggleClass("on");var f=$(this).parents(".filter");if(f.find("li>a.on").length){f.children("a.empty").show();}else{f.children("a.empty").hide();}
return false;})
$("a.empty",target).click(function(){$(this).hide().siblings("ul").find("li>a:not(.disabled)").removeClass("on");})
if($.browser.msie&&self.panelHeight){panelHeight();}}
jQuery.rating={cancel:'Cancel Rating',cancelValue:'',split:0,starWidth:16,groups:{},event:{fill:function(n,el,settings,state){this.drain(n);$(el).prevAll('.star_group_'+n).andSelf().addClass('star_'+(state||'hover'));var lnk=$(el).children('a');val=lnk.text();if(settings.focus)settings.focus.apply($.rating.groups[n].valueElem[0],[val,lnk[0]]);},drain:function(n,el,settings){$.rating.groups[n].valueElem.siblings('.star_group_'+n).removeClass('star_on').removeClass('star_hover');},reset:function(n,el,settings){if(!$($.rating.groups[n].current).is('.cancel'))
$($.rating.groups[n].current).prevAll('.star_group_'+n).andSelf().addClass('star_on');var lnk=$(el).children('a');val=lnk.text();if(settings.blur)settings.blur.apply($.rating.groups[n].valueElem[0],[val,lnk[0]]);},click:function(n,el,settings){$.rating.groups[n].current=el;var lnk=$(el).children('a');val=lnk.text();$.rating.groups[n].valueElem.val(val);$.rating.event.drain(n,el,settings);$.rating.event.reset(n,el,settings);if(settings.callback)settings.callback.apply($.rating.groups[n].valueElem[0],[val,lnk[0]]);}}};$.ifixpng=function(customPixel){$.ifixpng.pixel=customPixel;};$.ifixpng.getPixel=function(){var pixelHost=(("https:"==document.location.protocol)?"/assets":"http://i.ysi.bz");return $.ifixpng.pixel||(pixelHost+'/imgs/buffer.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'});}});};