/*! ** Global JS file for ricardo.ch global.js 	V. 1.26 16.02.2012 10:58  **** */
qxlSite={host_main:["www.ricardo.ch","www.fr.ricardo.ch"],host_beta:["www.ch.betaqxl.com","www.fr.ch.betaqxl.com"],special_links:["kurz-vor-ende","ab-1-franken","beliebteste","neue-angebote"],classifieds:["46822","48906","43930","48423","63804"]};qV={href:location.href.toLowerCase(),host:location.hostname.toLowerCase(),path:(location.pathname+location.search+location.hash).toLowerCase(),segm:location.pathname.toLowerCase().match(/\/[^\/\#\?\&]*/)[0].substring(1)};qxlVars={is_http:(location.protocol=="http:"),is_https:(location.protocol=="https:"),is_beta:($.inArray(qV.host,qxlSite.host_beta)>-1),is_search:(qV.path.indexOf("/search/search.asp")==0)||(qV.path.indexOf("/carsandbikes/search.aspx")==0),is_special_search:($.inArray(decodeURIComponent(unescape(qV.segm)),qxlSite.special_links)>-1),is_category_top:(qV.path=="/"+qxlSite.segment_buy+"/"),is_category_index:(qV.href.indexOf("/c/cn")>-1),is_category_listing:((qV.href.indexOf("/l/cn")>-1)||(qV.href.indexOf("/b/cn")>-1)),is_french:(qV.href.indexOf(".fr.")>-1)};$.getScript=function(b,c,a){$.ajax({type:"GET",url:b,success:c,dataType:"script",cache:true})};(function(a){a.fn.extend({outerHTML:function(c){if(typeof c==="string"){var e=a(this),d=e.parent();var b=function(){var g=e.find("img");if(g.length>0){g.remove()}var f;a(c).map(function(){f=a(this);e.replaceWith(f)});return f};return b()}else{return a("<div />").append(a(this).clone()).html()}}})})(jQuery);var JSON;if(!JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());var jaaulde=window.jaaulde||{};jaaulde.utils=jaaulde.utils||{};jaaulde.utils.cookies=(function(){var e,d,c,b,a={expiresAt:null,path:"/",domain:null,secure:false};e=function(g){var h,f;if(typeof g!=="object"||g===null){h=a}else{h={expiresAt:a.expiresAt,path:a.path,domain:a.domain,secure:a.secure};if(typeof g.expiresAt==="object"&&g.expiresAt instanceof Date){h.expiresAt=g.expiresAt}else{if(typeof g.hoursToLive==="number"&&g.hoursToLive!==0){f=new Date();f.setTime(f.getTime()+(g.hoursToLive*60*60*1000));h.expiresAt=f}}if(typeof g.path==="string"&&g.path!==""){h.path=g.path}if(typeof g.domain==="string"&&g.domain!==""){h.domain=g.domain}if(g.secure===true){h.secure=g.secure}}return h};d=function(f){f=e(f);return((typeof f.expiresAt==="object"&&f.expiresAt instanceof Date?"; expires="+f.expiresAt.toGMTString():"")+"; path="+f.path+(typeof f.domain==="string"?"; domain="+f.domain:"")+(f.secure===true?"; secure":""))};c=function(){var o={},h,g,f,n,k=document.cookie.split(";"),j;for(h=0;h<k.length;h=h+1){g=k[h].split("=");f=g[0].replace(/^\s*/,"").replace(/\s*$/,"");try{n=decodeURIComponent(g[1])}catch(m){n=g[1]}if(typeof JSON==="object"&&JSON!==null&&typeof JSON.parse==="function"){try{j=n;n=JSON.parse(n)}catch(l){n=j}}o[f]=n}return o};b=function(){};b.prototype.get=function(i){var f,h,g=c();if(typeof i==="string"){f=(typeof g[i]!=="undefined")?g[i]:null}else{if(typeof i==="object"&&i!==null){f={};for(h in i){if(typeof g[i[h]]!=="undefined"){f[i[h]]=g[i[h]]}else{f[i[h]]=null}}}else{f=g}}return f};b.prototype.filter=function(f){var i,g={},h=c();if(typeof f==="string"){f=new RegExp(f)}for(i in h){if(i.match(f)){g[i]=h[i]}}return g};b.prototype.set=function(i,g,f){if(typeof f!=="object"||f===null){f={}}if(typeof g==="undefined"||g===null){g="";f.hoursToLive=-8760}else{if(typeof g!=="string"){if(typeof JSON==="object"&&JSON!==null&&typeof JSON.stringify==="function"){g=JSON.stringify(g)}else{throw new Error("cookies.set() received non-string value and could not serialize.")}}}var h=d(f);document.cookie=i+"="+encodeURIComponent(g)+h};b.prototype.del=function(i,h){var f={},g;if(typeof h!=="object"||h===null){h={}}if(typeof i==="boolean"&&i===true){f=this.get()}else{if(typeof i==="string"){f[i]=true}}for(g in f){if(typeof g==="string"&&g!==""){this.set(g,null,h)}}};b.prototype.test=function(){var g=false,f="cT",h="data";this.set(f,h);if(this.get(f)===h){this.del(f);g=true}return g};b.prototype.setOptions=function(f){if(typeof f!=="object"){f=null}a=e(f)};return new b()})();(function(){if(window.jQuery){(function(b){b.cookies=jaaulde.utils.cookies;var a={cookify:function(c){return this.each(function(){var e,g=["name","id"],d,h=b(this),f;for(e in g){if(!isNaN(e)){d=h.attr(g[e]);if(typeof d==="string"&&d!==""){if(h.is(":checkbox, :radio")){if(h.attr("checked")){f=h.val()}}else{if(h.is(":input")){f=h.val()}else{f=h.html()}}if(typeof f!=="string"||f===""){f=null}b.cookies.set(d,f,c);break}}}})},cookieFill:function(){return this.each(function(){var h,c,f=["name","id"],d,g=b(this),e;c=function(){h=f.pop();return !!h};while(c()){d=g.attr(h);if(typeof d==="string"&&d!==""){e=b.cookies.get(d);if(e!==null){if(g.is(":checkbox, :radio")){if(g.val()===e){g.attr("checked","checked")}else{g.removeAttr("checked")}}else{if(g.is(":input")){g.val(e)}else{g.html(e)}}}break}}})},cookieBind:function(c){return this.each(function(){var d=b(this);d.cookieFill().change(function(){d.cookify(c)})})}};b.each(a,function(c){b.fn[c]=this})})(window.jQuery)}})();(function(f,d,g){var c=g(f),h=g(d),e=g.fancybox=function(){e.open.apply(this,arguments)},b=false,a=null;g.extend(e,{version:"2.0.4",defaults:{padding:15,margin:20,width:800,height:600,minWidth:200,minHeight:200,maxWidth:9999,maxHeight:9999,autoSize:true,fitToView:true,aspectRatio:false,topRatio:0.5,fixed:!g.browser.msie||g.browser.version>6||!d.documentElement.hasOwnProperty("ontouchstart"),scrolling:"auto",wrapCSS:"fancybox-default",arrows:true,closeBtn:true,closeClick:false,nextClick:false,mouseWheel:true,autoPlay:false,playSpeed:3000,modal:false,loop:true,ajax:{},keys:{next:[13,32,34,39,40],prev:[8,33,37,38],close:[27]},index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe class="fancybox-iframe" name="fancybox-frame{rnd}" frameborder="0" hspace="0" '+(g.browser.msie?'allowtransparency="true""':"")+' scrolling="{scrolling}" src="{href}"></iframe>',swf:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{href}" /><embed src="{href}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%" wmode="transparent"></embed></object>',error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<div title="Close" class="fancybox-item fancybox-close"></div>',next:'<a title="Next" class="fancybox-item fancybox-next"><span></span></a>',prev:'<a title="Previous" class="fancybox-item fancybox-prev"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:true,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:true,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:300,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:300,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:300,opacity:0.8,css:{cursor:"pointer"},closeClick:true},title:{type:"float"}},onCancel:g.noop,beforeLoad:g.noop,afterLoad:g.noop,beforeShow:g.noop,afterShow:g.noop,beforeClose:g.noop,afterClose:g.noop},group:{},opts:{},coming:null,current:null,isOpen:false,isOpened:false,wrap:null,outer:null,inner:null,player:{timer:null,isActive:false},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(j,i){if(!g.isArray(j)){j=[j]}if(!j.length){return}e.close(true);e.opts=g.extend(true,{},e.defaults,i);e.group=j;e._start(e.opts.index||0)},cancel:function(){if(e.coming&&false===e.trigger("onCancel")){return}e.coming=null;e.hideLoading();if(e.ajaxLoad){e.ajaxLoad.abort()}e.ajaxLoad=null;if(e.imgPreload){e.imgPreload.onload=e.imgPreload.onabort=e.imgPreload.onerror=null}},close:function(i){e.cancel();if(!e.current||false===e.trigger("beforeClose")){return}e.unbindEvents();if(!e.isOpen||(i&&i[0]===true)){g(".fancybox-wrap").stop().trigger("onReset").remove();e._afterZoomOut()}else{e.isOpen=e.isOpened=false;g(".fancybox-item").remove();e.wrap.stop(true).removeClass("fancybox-opened");e.inner.css("overflow","hidden");e.transitions[e.current.closeMethod]()}},play:function(j){var i=function(){clearTimeout(e.player.timer)},m=function(){i();if(e.current&&e.player.isActive){e.player.timer=setTimeout(e.next,e.current.playSpeed)}},k=function(){i();g("body").unbind(".player");e.player.isActive=false;e.trigger("onPlayEnd")},l=function(){if(e.current&&(e.current.loop||e.current.index<e.group.length-1)){e.player.isActive=true;g("body").bind({"afterShow.player onUpdate.player":m,"onCancel.player beforeClose.player":k,"beforeLoad.player":i});m();e.trigger("onPlayStart")}};if(e.player.isActive||(j&&j[0]===false)){k()}else{l()}},next:function(){if(e.current){e.jumpto(e.current.index+1)}},prev:function(){if(e.current){e.jumpto(e.current.index-1)}},jumpto:function(i){if(!e.current){return}i=parseInt(i,10);if(e.group.length>1&&e.current.loop){if(i>=e.group.length){i=0}else{if(i<0){i=e.group.length-1}}}if(typeof e.group[i]!=="undefined"){e.cancel();e._start(i)}},reposition:function(i){if(e.isOpen){e.wrap.css(e._getPosition(i))}},update:function(){if(e.isOpen){if(!b){a=setInterval(function(){if(b){b=false;clearTimeout(a);if(e.current){if(e.current.autoSize){e.inner.height("auto");e.current.height=e.inner.height()}e._setDimension();if(e.current.canGrow){e.inner.height("auto")}e.reposition();e.trigger("onUpdate")}}},100)}b=true}},toggle:function(){if(e.isOpen){e.current.fitToView=!e.current.fitToView;e.update()}},hideLoading:function(){g("#fancybox-loading").remove()},showLoading:function(){e.hideLoading();g('<div id="fancybox-loading"></div>').click(e.cancel).appendTo("body")},getViewport:function(){return{x:c.scrollLeft(),y:c.scrollTop(),w:c.width(),h:c.height()}},unbindEvents:function(){if(e.wrap){e.wrap.unbind(".fb")}h.unbind(".fb");c.unbind(".fb")},bindEvents:function(){var j=e.current,i=j.keys;if(!j){return}c.bind("resize.fb, orientationchange.fb",e.update);if(i){h.bind("keydown.fb",function(l){var k;if(!l.ctrlKey&&!l.altKey&&!l.shiftKey&&!l.metaKey&&g.inArray(l.target.tagName.toLowerCase(),["input","textarea","select","button"])<0){k=l.keyCode;if(g.inArray(k,i.close)>-1){e.close();l.preventDefault()}else{if(g.inArray(k,i.next)>-1){e.next();l.preventDefault()}else{if(g.inArray(k,i.prev)>-1){e.prev();l.preventDefault()}}}}})}if(g.fn.mousewheel&&j.mouseWheel&&e.group.length>1){e.wrap.bind("mousewheel.fb",function(l,m){var k=g(l.target).get(0);if(k.clientHeight===0||k.scrollHeight===k.clientHeight){l.preventDefault();e[m>0?"prev":"next"]()}})}},trigger:function(j){var i,k=e[g.inArray(j,["onCancel","beforeLoad","afterLoad"])>-1?"coming":"current"];if(!k){return}if(g.isFunction(k[j])){i=k[j].apply(k,Array.prototype.slice.call(arguments,1))}if(i===false){return false}if(k.helpers){g.each(k.helpers,function(m,l){if(l&&typeof e.helpers[m]!=="undefined"&&g.isFunction(e.helpers[m][j])){e.helpers[m][j](l,k)}})}g.event.trigger(j+".fb")},isImage:function(i){return i&&i.match(/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i)},isSWF:function(i){return i&&i.match(/\.(swf)(.*)?$/i)},_start:function(j){var m={},l=e.group[j]||null,k,i,n,o;if(typeof l==="object"&&(l.nodeType||l instanceof g)){k=true;if(g.metadata){m=g(l).metadata()}}m=g.extend(true,{},e.opts,{index:j,element:l},(g.isPlainObject(l)?l:m));g.each(["href","title","content","type"],function(q,p){m[p]=e.opts[p]||(k&&g(l).attr(p))||m[p]||null});if(typeof m.margin==="number"){m.margin=[m.margin,m.margin,m.margin,m.margin]}if(m.modal){g.extend(true,m,{closeBtn:false,closeClick:false,nextClick:false,arrows:false,mouseWheel:false,keys:null,helpers:{overlay:{css:{cursor:"auto"},closeClick:false}}})}e.coming=m;if(false===e.trigger("beforeLoad")){e.coming=null;return}n=m.type;i=m.href;if(!n){if(k){o=g(l).data("fancybox-type");if(!o&&l.className){o=l.className.match(/fancybox\.(\w+)/);n=o?o[1]:null}}if(!n&&i){if(e.isImage(i)){n="image"}else{if(e.isSWF(i)){n="swf"}else{if(i.match(/^#/)){n="inline"}}}}if(!n){n=k?"inline":"html"}m.type=n}if(n==="inline"||n==="html"){m.content=m.content||(n==="inline"&&i?g(i):l);if(!m.content.length){n=null}}else{m.href=i||l;if(!m.href){n=null}}m.group=e.group;if(n==="image"){e._loadImage()}else{if(n==="ajax"){e._loadAjax()}else{if(n){e._afterLoad()}else{e._error("type")}}}},_error:function(i){g.extend(e.coming,{type:"html",autoSize:true,minHeight:"0",hasError:i,content:e.coming.tpl.error});e._afterLoad()},_loadImage:function(){e.imgPreload=new Image();e.imgPreload.onload=function(){this.onload=this.onerror=null;e.coming.width=this.width;e.coming.height=this.height;e._afterLoad()};e.imgPreload.onerror=function(){this.onload=this.onerror=null;e._error("image")};e.imgPreload.src=e.coming.href;if(!e.imgPreload.complete){e.showLoading()}},_loadAjax:function(){e.showLoading();e.ajaxLoad=g.ajax(g.extend({},e.coming.ajax,{url:e.coming.href,error:function(i,j){if(j!=="abort"){e._error("ajax",i)}else{e.hideLoading()}},success:function(i,j){if(j==="success"){e.coming.content=i;e._afterLoad()}}}))},_preload:function(){var k=e.group,i=e.current.index,j=function(l){if(l&&e.isImage(l)){new Image().src=l}};if(k.length>1){j(g(k[i+1]||k[0]).attr("href"));j(g(k[i-1]||k[k.length-1]).attr("href"))}},_afterLoad:function(){e.hideLoading();if(!e.coming||false===e.trigger("afterLoad",e.current)){e.coming=false;return}if(e.isOpened){g(".fancybox-item").remove();e.wrap.stop(true).removeClass("fancybox-opened");e.inner.css("overflow","hidden");e.transitions[e.current.prevMethod]()}else{g(".fancybox-wrap").stop().trigger("onReset").remove();e.trigger("afterClose")}e.unbindEvents();e.isOpen=false;e.current=e.coming;e.coming=false;e.wrap=g(e.current.tpl.wrap).addClass("fancybox-tmp "+e.current.wrapCSS).appendTo("body");e.outer=g(".fancybox-outer",e.wrap).css("padding",e.current.padding+"px");e.inner=g(".fancybox-inner",e.wrap);e._setContent();e.trigger("beforeShow");e._setDimension();e.wrap.hide().removeClass("fancybox-tmp");e.bindEvents();e._preload();e.transitions[e.isOpened?e.current.nextMethod:e.current.openMethod]()},_setContent:function(){var j,k,l=e.current,i=l.type;switch(i){case"inline":case"ajax":case"html":j=l.content;if(i==="inline"&&j instanceof g){j=j.show().detach();if(j.parent().hasClass("fancybox-inner")){j.parents(".fancybox-wrap").trigger("onReset").remove()}g(e.wrap).bind("onReset",function(){j.appendTo("body").hide()})}if(l.autoSize){k=g('<div class="fancybox-tmp"></div>').appendTo(g("body")).append(j);l.width=k.outerWidth();l.height=k.outerHeight(true);j=k.contents().detach();k.remove()}break;case"image":j=l.tpl.image.replace("{href}",l.href);l.aspectRatio=true;break;case"swf":j=l.tpl.swf.replace(/\{width\}/g,l.width).replace(/\{height\}/g,l.height).replace(/\{href\}/g,l.href);break;case"iframe":j=l.tpl.iframe.replace("{href}",l.href).replace("{scrolling}",l.scrolling).replace("{rnd}",new Date().getTime());break}if(g.inArray(i,["image","swf","iframe"])>-1){l.autoSize=false;l.scrolling=false}e.inner.append(j)},_setDimension:function(){var l=e.wrap,w=e.outer,x=e.inner,p=e.current,q=e.getViewport(),n=p.margin,j=p.padding*2,m=p.width+j,v=p.height+j,r=p.width/p.height,t=p.maxWidth,s=p.maxHeight,k=p.minWidth,u=p.minHeight,o,i;q.w-=(n[1]+n[3]);q.h-=(n[0]+n[2]);if(m.toString().indexOf("%")>-1){m=((q.w*parseFloat(m))/100)}if(v.toString().indexOf("%")>-1){v=((q.h*parseFloat(v))/100)}if(p.fitToView){t=Math.min(q.w,t);s=Math.min(q.h,s)}k=Math.min(m,k);u=Math.min(m,u);t=Math.max(k,t);s=Math.max(u,s);if(p.aspectRatio){if(m>t){m=t;v=((m-j)/r)+j}if(v>s){v=s;m=((v-j)*r)+j}if(m<k){m=k;v=((m-j)/r)+j}if(v<u){v=u;m=((v-j)*r)+j}}else{m=Math.max(k,Math.min(m,t));v=Math.max(u,Math.min(v,s))}m=Math.round(m);v=Math.round(v);g(l.add(w).add(x)).width("auto").height("auto");x.width(m-j).height(v-j);l.width(m);o=l.height();if(m>t||o>s){while((m>t||o>s)&&m>k&&o>u){v=v-10;if(p.aspectRatio){m=Math.round(((v-j)*r)+j);if(m<k){m=k;v=((m-j)/r)+j}}else{m=m-10}x.width(m-j).height(v-j);l.width(m);o=l.height()}}p.dim={width:m,height:o};p.canGrow=p.autoSize&&v>u&&v<s;p.canShrink=false;p.canExpand=false;if((m-j)<p.width||(v-j)<p.height){p.canExpand=true}else{if((m>q.w||o>q.h)&&m>k&&v>u){p.canShrink=true}}i=o-j;e.innerSpace=i-x.height();e.outerSpace=i-w.height()},_getPosition:function(k){var o=e.current,j=e.getViewport(),m=o.margin,l=e.wrap.width()+m[1]+m[3],i=e.wrap.height()+m[0]+m[2],n={position:"absolute",top:m[0]+j.y,left:m[3]+j.x};if(o.fixed&&(!k||k[0]===false)&&i<=j.h&&l<=j.w){n={position:"fixed",top:m[0],left:m[3]}}n.top=Math.ceil(Math.max(n.top,n.top+((j.h-i)*o.topRatio)))+"px";n.left=Math.ceil(Math.max(n.left,n.left+((j.w-l)*0.5)))+"px";return n},_afterZoomIn:function(){var i=e.current;e.isOpen=e.isOpened=true;e.wrap.addClass("fancybox-opened").css("overflow","visible");e.update();e.inner.css("overflow",i.scrolling==="auto"?"auto":(i.scrolling==="yes"?"scroll":"hidden"));if(i.closeClick||i.nextClick){e.inner.css("cursor","pointer").bind("click.fb",i.nextClick?e.next:e.close)}if(i.closeBtn){g(i.tpl.closeBtn).appendTo(e.wrap).bind("click.fb",e.close)}if(i.arrows&&e.group.length>1){if(i.loop||i.index>0){g(i.tpl.prev).appendTo(e.wrap).bind("click.fb",e.prev)}if(i.loop||i.index<e.group.length-1){g(i.tpl.next).appendTo(e.wrap).bind("click.fb",e.next)}}e.trigger("afterShow");if(e.opts.autoPlay&&!e.player.isActive){e.opts.autoPlay=false;e.play()}},_afterZoomOut:function(){e.trigger("afterClose");e.wrap.trigger("onReset").remove();g.extend(e,{group:{},opts:{},current:null,isOpened:false,isOpen:false,wrap:null,outer:null,inner:null})}});e.transitions={getOrigPosition:function(){var k=e.current.element,n={},l=50,j=50,m,i;if(k&&k.nodeName&&g(k).is(":visible")){m=g(k).find("img:first");if(m.length){n=m.offset();l=m.outerWidth();j=m.outerHeight()}else{n=g(k).offset()}}else{i=e.getViewport();n.top=i.y+(i.h-j)*0.5;n.left=i.x+(i.w-l)*0.5}n={top:Math.ceil(n.top)+"px",left:Math.ceil(n.left)+"px",width:Math.ceil(l)+"px",height:Math.ceil(j)+"px"};return n},step:function(j,l){var k,i,m;if(l.prop==="width"||l.prop==="height"){i=m=Math.ceil(j-(e.current.padding*2));if(l.prop==="height"){k=(j-l.start)/(l.end-l.start);if(l.start>l.end){k=1-k}i-=e.innerSpace*k;m-=e.outerSpace*k}e.inner[l.prop](i);e.outer[l.prop](m)}},zoomIn:function(){var k=e.wrap,m=e.current,j,i,l=m.dim;if(m.openEffect==="elastic"){i=g.extend({},l,e._getPosition(true));delete i.position;j=this.getOrigPosition();if(m.openOpacity){j.opacity=0;i.opacity=1}k.css(j).show().animate(i,{duration:m.openSpeed,easing:m.openEasing,step:this.step,complete:e._afterZoomIn})}else{k.css(g.extend({},l,e._getPosition()));if(m.openEffect==="fade"){k.fadeIn(m.openSpeed,e._afterZoomIn)}else{k.show();e._afterZoomIn()}}},zoomOut:function(){var j=e.wrap,k=e.current,i;if(k.closeEffect==="elastic"){if(j.css("position")==="fixed"){j.css(e._getPosition(true))}i=this.getOrigPosition();if(k.closeOpacity){i.opacity=0}j.animate(i,{duration:k.closeSpeed,easing:k.closeEasing,step:this.step,complete:e._afterZoomOut})}else{j.fadeOut(k.closeEffect==="fade"?k.closeSpeed:0,e._afterZoomOut)}},changeIn:function(){var j=e.wrap,k=e.current,i;if(k.nextEffect==="elastic"){i=e._getPosition(true);i.opacity=0;i.top=(parseInt(i.top,10)-200)+"px";j.css(i).show().animate({opacity:1,top:"+=200px"},{duration:k.nextSpeed,complete:e._afterZoomIn})}else{j.css(e._getPosition());if(k.nextEffect==="fade"){j.hide().fadeIn(k.nextSpeed,e._afterZoomIn)}else{j.show();e._afterZoomIn()}}},changeOut:function(){var i=e.wrap,k=e.current,j=function(){g(this).trigger("onReset").remove()};i.removeClass("fancybox-opened");if(k.prevEffect==="elastic"){i.animate({opacity:0,top:"+=200px"},{duration:k.prevSpeed,complete:j})}else{i.fadeOut(k.prevEffect==="fade"?k.prevSpeed:0,j)}}};e.helpers.overlay={overlay:null,update:function(){var k,i,j;this.overlay.width(0).height(0);if(g.browser.msie){i=Math.max(d.documentElement.scrollWidth,d.body.scrollWidth);j=Math.max(d.documentElement.offsetWidth,d.body.offsetWidth);k=i<j?c.width():i}else{k=h.width()}this.overlay.width(k).height(h.height())},beforeShow:function(i){if(this.overlay){return}this.overlay=g('<div id="fancybox-overlay"></div>').css(i.css||{background:"black"}).appendTo("body");this.update();if(i.closeClick){this.overlay.bind("click.fb",e.close)}c.bind("resize.fb",g.proxy(this.update,this));this.overlay.fadeTo(i.speedIn||"fast",i.opacity||1)},onUpdate:function(){this.update()},afterClose:function(i){if(this.overlay){this.overlay.fadeOut(i.speedOut||"fast",function(){g(this).remove()})}this.overlay=null}};e.helpers.title={beforeShow:function(i){var k,j=e.current.title;if(j){k=g('<div class="fancybox-title fancybox-title-'+i.type+'-wrap">'+j+"</div>").appendTo("body");if(i.type==="float"){k.width(k.width());k.wrapInner('<span class="child"></span>');e.current.margin[2]+=Math.abs(parseInt(k.css("margin-bottom"),10))}k.appendTo(i.type==="over"?e.inner:(i.type==="outside"?e.wrap:e.outer))}}};g.fn.fancybox=function(j){var k=j||{},i=this.selector||"";function l(p){var o=[],n,q,m=this.rel;if(!(p.ctrlKey||p.altKey||p.shiftKey||p.metaKey)){p.preventDefault();q=g(this).data("fancybox-group");if(typeof q!=="undefined"){n=q?"data-fancybox-group":false}else{if(m&&m!==""&&m!=="nofollow"){q=m;n="rel"}}if(n){o=i.length?g(i).filter("["+n+'="'+q+'"]'):g("["+n+'="'+q+'"]')}if(o.length){k.index=o.index(this);e.open(o.get(),k)}else{e.open(this,k)}}}if(i){h.undelegate(i,"click.fb-start").delegate(i,"click.fb-start",l)}else{g(this).unbind("click.fb-start").bind("click.fb-start",l)}return this}}(window,document,jQuery));(function(e,b){function d(){}function t(C){c=[C]}function m(C){f.insertBefore(C,f.firstChild)}function l(E,C,D){return E&&E.apply(C.context||C,D)}function k(C){return/\?/.test(C)?"&":"?"}var n="async",s="charset",q="",A="error",r="_jqjsp",w="on",o=w+"click",p=w+A,a=w+"load",i=w+"readystatechange",z="removeChild",g="<script/>",v="success",y="timeout",x=e.browser,f=e("head")[0]||document.documentElement,u={},j=0,c,h={callback:r,url:location.href};function B(C){C=e.extend({},h,C);var Q=C.complete,E=C.dataFilter,M=C.callbackParameter,R=C.callback,G=C.cache,J=C.pageCache,I=C.charset,D=C.url,L=C.data,P=C.timeout,O,K=0,H=d;C.abort=function(){!K++&&H()};if(l(C.beforeSend,C,[C])===false||K){return C}D=D||q;L=L?((typeof L)=="string"?L:e.param(L,C.traditional)):q;D+=L?(k(D)+L):q;M&&(D+=k(D)+encodeURIComponent(M)+"=?");!G&&!J&&(D+=k(D)+"_"+(new Date()).getTime()+"=");D=D.replace(/=\?(&|$)/,"="+R+"$1");function N(S){!K++&&b(function(){H();J&&(u[D]={s:[S]});E&&(S=E.apply(C,[S]));l(C.success,C,[S,v]);l(Q,C,[C,v])},0)}function F(S){!K++&&b(function(){H();J&&S!=y&&(u[D]=S);l(C.error,C,[C,S]);l(Q,C,[C,S])},0)}J&&(O=u[D])?(O.s?N(O.s[0]):F(O)):b(function(T,S,U){if(!K){U=P>0&&b(function(){F(y)},P);H=function(){U&&clearTimeout(U);T[i]=T[o]=T[a]=T[p]=null;f[z](T);S&&f[z](S)};window[R]=t;T=e(g)[0];T.id=r+j++;if(I){T[s]=I}function V(W){(T[o]||d)();W=c;c=undefined;W?N(W[0]):F(A)}if(x.msie){T.event=o;T.htmlFor=T.id;T[i]=function(){/loaded|complete/.test(T.readyState)&&V()}}else{T[p]=T[a]=V;x.opera?((S=e(g)[0]).text="jQuery('#"+T.id+"')[0]."+p+"()"):T[n]=n}T.src=D;m(T);S&&m(S)}},0);return C}B.setup=function(C){e.extend(h,C)};e.jsonp=B})(jQuery,setTimeout);var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var a=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,e=aB.userAgent.toLowerCase(),c=aB.platform.toLowerCase(),h=c?/win/.test(c):/win/.test(e),j=c?/mac/.test(c):/mac/.test(e),g=/webkit/.test(e)?parseFloat(e.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,d=!+"\v1",f=[0,0,0],k=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){k=aB.plugins[ab].description;if(k&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;d=false;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1");f[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10);f[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10);f[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var i=new ActiveXObject(X);if(i){k=i.GetVariable("$version");if(k){d=true;k=k.split(" ")[1].split(",");f=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]}}}catch(b){}}}return{w3:a,pv:f,wk:g,ie:d,win:h,mac:j}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var b=aL.getElementsByTagName("body")[0].appendChild(ar("span"));b.parentNode.removeChild(b)}catch(a){return}ak=true;var d=Z.length;for(var c=0;c<d;c++){Z[c]()}}function aj(a){if(ak){a()}else{Z[Z.length]=a}}function aC(a){if(typeof af.addEventListener!=aq){af.addEventListener("load",a,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",a,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",a)}else{if(typeof af.onload=="function"){var b=af.onload;af.onload=function(){b();a()}}else{af.onload=a}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var d=aL.getElementsByTagName("body")[0];var b=ar(aD);b.setAttribute("type",aE);var a=d.appendChild(b);if(a){var c=0;(function(){if(typeof a.GetVariable!=aq){var e=a.GetVariable("$version");if(e){e=e.split(" ")[1].split(",");ah.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)]}}else{if(c<10){c++;setTimeout(arguments.callee,10);return}}d.removeChild(b);a=null;am()})()}else{am()}}function am(){var g=aG.length;if(g>0){for(var h=0;h<g;h++){var c=aG[h].id;var l=aG[h].callbackFn;var a={success:false,id:c};if(ah.pv[0]>0){var i=aS(c);if(i){if(ao(aG[h].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(c,true);if(l){a.success=true;a.ref=av(c);l(a)}}else{if(aG[h].expressInstall&&au()){var e={};e.data=aG[h].expressInstall;e.width=i.getAttribute("width")||"0";e.height=i.getAttribute("height")||"0";if(i.getAttribute("class")){e.styleclass=i.getAttribute("class")}if(i.getAttribute("align")){e.align=i.getAttribute("align")}var f={};var d=i.getElementsByTagName("param");var k=d.length;for(var j=0;j<k;j++){if(d[j].getAttribute("name").toLowerCase()!="movie"){f[d[j].getAttribute("name")]=d[j].getAttribute("value")}}ae(e,f,c,l)}else{aF(i);if(l){l(a)}}}}}else{ay(c,true);if(l){var b=av(c);if(b&&typeof b.SetVariable!=aq){a.success=true;a.ref=b}l(a)}}}}}function av(b){var d=null;var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(typeof c.SetVariable!=aq){d=c}else{var a=c.getElementsByTagName(aD)[0];if(a){d=a}}}return d}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(f,d,h,e){aU=true;ap=e||null;at={success:false,id:h};var a=aS(h);if(a){if(a.nodeName=="OBJECT"){aJ=aO(a);ad=null}else{aJ=a;ad=h}f.id=ac;if(typeof f.width==aq||(!/%$/.test(f.width)&&parseInt(f.width,10)<310)){f.width="310"}if(typeof f.height==aq||(!/%$/.test(f.height)&&parseInt(f.height,10)<137)){f.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var b=ah.ie&&ah.win?"ActiveX":"PlugIn",c="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+b+"&MMdoctitle="+aL.title;if(typeof d.flashvars!=aq){d.flashvars+="&"+c}else{d.flashvars=c}if(ah.ie&&ah.win&&a.readyState!=4){var g=ar("div");h+="SWFObjectNew";g.setAttribute("id",h);a.parentNode.insertBefore(g,a);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}aA(f,d,h)}}function aF(a){if(ah.ie&&ah.win&&a.readyState!=4){var b=ar("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(aO(a),b);a.style.display="none";(function(){if(a.readyState==4){a.parentNode.removeChild(a)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.replaceChild(aO(a),a)}}function aO(b){var d=ar("div");if(ah.win&&ah.ie){d.innerHTML=b.innerHTML}else{var e=b.getElementsByTagName(aD)[0];if(e){var a=e.childNodes;if(a){var f=a.length;for(var c=0;c<f;c++){if(!(a[c].nodeType==1&&a[c].nodeName=="PARAM")&&!(a[c].nodeType==8)){d.appendChild(a[c].cloneNode(true))}}}}}return d}function aA(e,g,c){var d,a=aS(c);if(ah.wk&&ah.wk<312){return d}if(a){if(typeof e.id==aq){e.id=c}if(ah.ie&&ah.win){var f="";for(var i in e){if(e[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){g.movie=e[i]}else{if(i.toLowerCase()=="styleclass"){f+=' class="'+e[i]+'"'}else{if(i.toLowerCase()!="classid"){f+=" "+i+'="'+e[i]+'"'}}}}}var h="";for(var j in g){if(g[j]!=Object.prototype[j]){h+='<param name="'+j+'" value="'+g[j]+'" />'}}a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+f+">"+h+"</object>";ag[ag.length]=e.id;d=aS(e.id)}else{var b=ar(aD);b.setAttribute("type",aE);for(var k in e){if(e[k]!=Object.prototype[k]){if(k.toLowerCase()=="styleclass"){b.setAttribute("class",e[k])}else{if(k.toLowerCase()!="classid"){b.setAttribute(k,e[k])}}}}for(var l in g){if(g[l]!=Object.prototype[l]&&l.toLowerCase()!="movie"){aQ(b,l,g[l])}}a.parentNode.replaceChild(b,a);d=b}}return d}function aQ(b,d,c){var a=ar("param");a.setAttribute("name",d);a.setAttribute("value",c);b.appendChild(a)}function aw(a){var b=aS(a);if(b&&b.nodeName=="OBJECT"){if(ah.ie&&ah.win){b.style.display="none";(function(){if(b.readyState==4){aT(a)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.removeChild(b)}}}function aT(a){var b=aS(a);if(b){for(var c in b){if(typeof b[c]=="function"){b[c]=null}}b.parentNode.removeChild(b)}}function aS(a){var c=null;try{c=aL.getElementById(a)}catch(b){}return c}function ar(a){return aL.createElement(a)}function aM(a,c,b){a.attachEvent(c,b);al[al.length]=[a,c,b]}function ao(a){var b=ah.pv,c=a.split(".");c[0]=parseInt(c[0],10);c[1]=parseInt(c[1],10)||0;c[2]=parseInt(c[2],10)||0;return(b[0]>c[0]||(b[0]==c[0]&&b[1]>c[1])||(b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]))?true:false}function az(b,f,a,c){if(ah.ie&&ah.mac){return}var e=aL.getElementsByTagName("head")[0];if(!e){return}var g=(a&&typeof a=="string")?a:"screen";if(c){aH=null;an=null}if(!aH||an!=g){var d=ar("style");d.setAttribute("type","text/css");d.setAttribute("media",g);aH=e.appendChild(d);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=g}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(b,f)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(b+" {"+f+"}"))}}}function ay(a,c){if(!aI){return}var b=c?"visible":"hidden";if(ak&&aS(a)){aS(a).style.visibility=b}else{az("#"+a,"visibility:"+b)}}function ai(b){var a=/[\\\"<>\.;]/;var c=a.exec(b)!=null;return c&&typeof encodeURIComponent!=aq?encodeURIComponent(b):b}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var a=al.length;for(var b=0;b<a;b++){al[b][0].detachEvent(al[b][1],al[b][2])}var d=ag.length;for(var c=0;c<d;c++){aw(ag[c])}for(var e in ah){ah[e]=null}ah=null;for(var f in swfobject){swfobject[f]=null}swfobject=null})}}();return{registerObject:function(a,e,c,b){if(ah.w3&&a&&e){var d={};d.id=a;d.swfVersion=e;d.expressInstall=c;d.callbackFn=b;aG[aG.length]=d;ay(a,false)}else{if(b){b({success:false,id:a})}}},getObjectById:function(a){if(ah.w3){return av(a)}},embedSWF:function(k,e,h,f,c,a,b,i,g,j){var d={success:false,id:e};if(ah.w3&&!(ah.wk&&ah.wk<312)&&k&&e&&h&&f&&c){ay(e,false);aj(function(){h+="";f+="";var q={};if(g&&typeof g===aD){for(var o in g){q[o]=g[o]}}q.data=k;q.width=h;q.height=f;var n={};if(i&&typeof i===aD){for(var p in i){n[p]=i[p]}}if(b&&typeof b===aD){for(var l in b){if(typeof n.flashvars!=aq){n.flashvars+="&"+l+"="+b[l]}else{n.flashvars=l+"="+b[l]}}}if(ao(c)){var m=aA(q,n,e);if(q.id==e){ay(e,true)}d.success=true;d.ref=m}else{if(a&&au()){q.data=a;ae(q,n,e,j);return}else{ay(e,true)}}if(j){j(d)}})}else{if(j){j(d)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(a,b,c){if(ah.w3){return aA(a,b,c)}else{return undefined}},showExpressInstall:function(b,a,d,c){if(ah.w3&&au()){ae(b,a,d,c)}},removeSWF:function(a){if(ah.w3){aw(a)}},createCSS:function(b,a,c,d){if(ah.w3){az(b,a,c,d)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(b){var a=aL.location.search||aL.location.hash;if(a){if(/\?/.test(a)){a=a.split("?")[1]}if(b==null){return ai(a)}var c=a.split("&");for(var d=0;d<c.length;d++){if(c[d].substring(0,c[d].indexOf("="))==b){return ai(c[d].substring((c[d].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var a=aS(ac);if(a&&aJ){a.parentNode.replaceChild(aJ,a);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();function flexBox(klickBox,addLines,addPix,klickDuration,addFunction,startFunction){var klickBoxSwitch=klickBox.children(":first");if(typeof klickDuration=="undefined"){var klickDuration=0}klickBox.addClass("flexBox");klickBoxSwitch.addClass("flexBoxBtn");if(klickBoxSwitch.length>0){if(typeof addLines=="undefined"){addLines=0}else{klickBox.append('<div class="blindOverlay"></div>')}if(typeof addPix=="undefined"||addPix==""){addPix=0}var line=addLines*klickBox.css("line-height").replace("px","")+addPix;var fopen=klickBox.height();var fclosed=klickBoxSwitch.outerHeight(true)+line;function switchBox(sDuration,sFunction){(klickBox.height()==fclosed)?klickBox.animate({height:fopen},sDuration,function(){eval(addFunction)}):klickBox.animate({height:fclosed},sDuration,function(){eval(addFunction);eval(sFunction)});klickBoxSwitch.toggleClass("closed");klickBox.toggleClass("closed");if(typeof(window.setAdHeight)=="function"){setAdHeight()}}switchBox(0,startFunction);klickBoxSwitch.click(function(){switchBox(klickDuration)})}}(function(b){function a(d){this.input=d;if(d.attr("type")=="password"){this.handlePassword()}b(d[0].form).submit(function(){if(d.hasClass("placeholder")&&d[0].value==d.attr("placeholder")){d[0].value=""}})}a.prototype={show:function(f){if(this.input[0].value===""||(f&&this.valueIsPlaceholder())){if(this.isPassword){try{this.input[0].setAttribute("type","text")}catch(d){this.input.before(this.fakePassword.show()).hide()}}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")){this.input.removeClass("placeholder");this.input[0].value="";if(this.isPassword){try{this.input[0].setAttribute("type","password")}catch(d){}this.input.show();this.input[0].focus()}}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var d=this.input;d.attr("realType","password");this.isPassword=true;if(b.browser.msie&&d[0].outerHTML){var e=b(d[0].outerHTML.replace(/type=(['"])?password\1/gi,"type=$1text$1"));this.fakePassword=e.val(d.attr("placeholder")).addClass("placeholder").focus(function(){d.trigger("focus");b(this).hide()});b(d[0].form).submit(function(){e.remove();d.show()})}}};var c=!!("placeholder" in document.createElement("input"));b.fn.placeholder=function(){return c?this:this.each(function(){var d=b(this);var e=new a(d);e.show(true);d.focus(function(){e.hide()});d.blur(function(){e.show(false)});if(b.browser.msie){b(window).load(function(){if(d.val()){d.removeClass("placeholder")}e.show(true)});d.focus(function(){if(this.value==""){var f=this.createTextRange();f.collapse(true);f.moveStart("character",0);f.select()}})}})}})(jQuery);function tracelog(a){try{console.log(a)}catch(b){}}function GetRandom(b,a){if(b>a){return(-1)}if(b==a){return(b)}return(b+parseInt(Math.random()*(a-b+1)))}function doTrack(b,a,c){if("pageTracker" in window&&pageTracker){pageTracker._trackEvent(b,a,c)}else{if("_gaq" in window&&_gaq){_gaq.push(["_trackEvent",b,a,c])}}}function SetFrameHeightFavorites(){}$(document).ready(function(){if(window.location.href=="http://www.ricardo.ch/"||window.location.href=="http://wwwfr.ricardo.ch/"||window.location.href=="http://auto.ricardo.ch/"||window.location.href=="http://auto.fr.ricardo.ch/"){$("#txtSearch").focus()}if($("#txtSearch").val()!=""){$("#txtSearch").addClass("active")}$("#txtSearch").keyup(function(){if($(this).attr("value").length>=1){$("#txtSearch").addClass("active")}else{$("#txtSearch").removeClass("active")}})});var lang="de";var urlstring=(location.href).toLowerCase();if(urlstring.indexOf(".fr.")!=-1){lang="fr"}else{}var openSelect=null;$(function(){$("header select, .topinfo select").each(function(){var d=$(this);var g=[];var b="";d.children().each(function(){var j=String($(this)[0].tagName).toUpperCase();if(j=="OPTION"){g.push($(this))}else{if(j=="OPTGROUP"){var i={label:$(this).attr("label"),img:$(this).attr("img"),children:$(this).children()};g.push(i)}}});var h=$(this).attr("name");var c='<div class="select span-5" >';c+='<input type="hidden" name="'+h+'" value="'+g[0].val()+'" />';c+='<div class="label" ></div>';c+='<div class="button" ></div>';c+='<div class="list hide" >';for(var f in g){if(g[f].label!=undefined){var a="";if(g[f].img!=undefined){a='<img src="'+g[f].img+'" />'}c+='<div class="optgroup span-5 last" >'+a+g[f].label+"</div>";g[f].children.each(function(){var i="";if($(this).attr("img")){i='<img src="'+$(this).attr("img")+'" />'}var j="";if($(this).attr("selected")){j='selected="selected"';b=i+$(this).html();$("#search").append('<input class="setselect" type="hidden" Name="'+h+'" value="'+$(this).val()+'"/>')}c+='<div class="option span-5 last" '+j+' val="'+$(this).val()+'">'+i+$(this).html()+"</div>";$(".select").css("border","1px dotted #900");listItemW=$(this).innerWidth()})}else{var a="";if(g[f].attr("img")!=undefined){a='<img src="'+g[f].attr("img")+'" />'}var e="";if(g[f].attr("selected")){e='selected="selected"';b=a+g[f].html();$("#search").append('<input class="setselect" type="hidden" Name="'+h+'" value="'+$(this).val()+'"/>')}c+='<div class="option span-5 last" '+e+' val="'+g[f].val()+'"><span>'+a+g[f].html()+"</span></div>"}}c+="</div>";c+="</div>";c=$(c);d.replaceWith(c);c.data("state","close");var g=c.children(".list");if(!b){b=g.children().first().html()}g.children(".option").last().addClass("bottom");c.children(".label").html(b);g.children(".option").click(function(){c.children("input[name='"+h+"']").val($(this).attr("val"));c.children(".label").html($(this).html())});c.click(function(i){if($(this).data("state")=="close"){$(this).children(".button").addClass("active");g.slideDown(125,function(){c.data("state","open")});$(this).addClass("activeSelect")}else{$(this).removeClass("activeSelect")}});$(document).click(function(i){if(c.data("state")=="open"){$(c).children(".button").removeClass("active");$(".select").removeClass("activeSelect");g.hide();c.data("state","close")}})})});$(document).ready(function(){$("header .select, .topinfo .select").each(function(){if($(this).width()==$(this).children("div:first").outerWidth()){minWidth=$(this).children(".label").width();$(this).children(".list").css("display","block");$(this).children(".list").children(".option").children("span").each(function(){if($(this).width()>minWidth){minWidth=$(this).width()}});$(this).children(".label").css("width",minWidth+1);$(this).children(".list").css("display","none")}});$("#search .select input").each(function(){selectField=$(this);selectName=selectField.attr("name");selectField.attr("id",selectName);$("#search .setselect").each(function(){if($(this).attr("name")==selectName){selectField.attr("value",$(this).attr("value"));$(this).remove()}})});if($("#MyPagesFunction").length>0){$("#search #txtSearch, #search .select").wrapAll('<div id="MyPageSelect" />')}else{$("#search #txtSearch, #search .select").wrapAll('<div id="CatSelect" />')}});$(document).ready(function(){$(".seoFlex").each(function(){flexBox($(this),0,0,500)});$(".n_BuyCatFooter, .n_ListFooter").each(function(){flexBox($(this),2,0,500)})});function selectBox(a){isSelected=a+" input:checked";$(isSelected).parent().addClass("selected");$(a).click(function(b){if(b.target.type!=="checkbox"){$(":checkbox",this).trigger("click")}}).find(":checkbox").click(function(b){if(!$(this).is(":disabled")){$(this).parents("li").toggleClass("selected")}})}function setFieldValue(a,b){try{$("#"+a+":checkbox").each(function(){$(this).attr("checked",b);return true});$('[name$="'+a+'"]:checkbox').each(function(){$(this).attr("checked",b)});$('[name$="'+a+'"]:radio').each(function(){$("input[name='"+a+"'][value='"+b+"']").attr("checked","checked")});if($("#"+a+" option:selected").val()!=null){b=JSON.parse(b);$("#"+a+" option[value='"+b.field+"']").attr("selected","selected");return true}if($("#"+a+":input")!=null){$("#"+a+":input").val(b);return true}if($("[name$='"+a+"']:input")!=null){$("[name$='"+a+"']:input").val(b);return true}return false}catch(c){tracelog(c)}}function getFieldValue(a,c){try{var b=new Object();formnameadd="";if(c!=""){formnameadd="#"+c+" "}b.result="";b.fieldIS="";b.fieldName=a;b.formName=c;$(formnameadd+"#"+a+":checkbox").each(function(){b.result=$(this).attr("checked");b.fieldIS="checkbox";b.fieldName=a;return b});if(b.fieldIS!=""){return b}$(formnameadd+'[name$="'+a+'"]:checkbox').each(function(){b.result=$(this).attr("checked");b.fieldIS="checkbox";b.fieldName=a;return b});if(b.fieldIS!=""){return b}$(formnameadd+'[name$="'+a+'"]:radio').each(function(){a="Radio_Box";b.result=$(formnameadd+"[name$='"+a+"']:checked").val();b.fieldIS="radiobox";b.fieldName=a;return b});if(b.fieldIS!=""){return b}if($(formnameadd+"#"+a+" option:selected").val()!=null){b.result=new Object();b.fieldIS="selectbox";b.fieldName=a;$(formnameadd+"#"+a+" option:selected").each(function(){var e=new Object();e.text=$(this).text();e.field=$(this).val();b.result=JSON.stringify(e)});return b}if(b.fieldIS!=""){return b}if($(formnameadd+"[name$='"+a+"'] :selected").val()!=null){b.result=new Object();b.fieldIS="selectbox";b.fieldName=a;$(formnameadd+"[name$='"+a+"'] :selected").each(function(){var e=new Object();e.text=$(this).text();e.field=$(this).val();b.result=JSON.stringify(e)});return b}if(b.fieldIS!=""){return b}if($(formnameadd+"#"+a+":input").val()){b.result=$("#"+a+":input").val();if($(formnameadd+"#"+a+":input").text()==""){b.fieldIS="textbox"}else{b.fieldIS="textarea"}b.fieldName=a;return b}if(b.fieldIS!=""){return b}if($(formnameadd+"[name$='"+a+"']:input").val()){b.result=$("[name$='"+a+"']:input").val();if($(formnameadd+"[name$='"+a+"']:input").text()==""){b.fieldIS="textbox"}else{b.fieldIS="textarea"}b.fieldName=a;return b}b.fieldIS="textbox";return b}catch(d){tracelog(d)}}$(document).ready(function(){var i=null;try{if($("#pathCats a").length>=3&&i==null){i=$("#pathCats span:first a").attr("href").match("/cn([0-9]*)")[1]}}catch(g){}try{if($("#pathCats a").length==2&&i==null){i=$("#channels span a").attr("href").match("/cn([0-9]*)")[1]}}catch(g){}try{if($("#BreadCrump1").length==1&&i==null){i=$("#BreadCrump1 span:eq(1) a").attr("href").match("/cn([0-9]*)")[1]}}catch(g){}try{if(document.URL.length>=1&&i==null){i=document.URL.match("/cn([0-9]*)")[1]}}catch(g){}try{if(i!==null){var a=$.cookies.get("mycats");if(a===null){var d=new Date().getTime();a={cats:[],updated:d,displayed:0}}var f=false;for(var b in a.cats){if(a.cats[b].i==i){a.cats[b].v++;f=true}}if(!f){a.cats.push({i:i,v:1})}a.updated=new Date().getTime();var h={hoursToLive:240,domain:".ricardo.ch"};$.cookies.set("mycats",a,h)}}catch(g){}linkAdvSearch=$(".n_advsearch").outerHTML();$(".n_advsearch").remove();var c="";if(lang=="fr"){c='<a href="javascript:void(0)" class="hpcButton" style="display: block!important;" id="btnFavoriteslink">Mes liens</a>';c=c+'<div id="favoritesLinks" style="display: none;">';c=c+'<span class="favoriteBuy">';c=c+"<h3>Mes achats</h3>";c=c+'<a title="Offen" href="https://www.fr.ricardo.ch/MyPages/Mybuying/MyBuying.asp">Mes achats</a>';c=c+'<a title="Gekauft" href="https://www.fr.ricardo.ch/MyPages/Mybuying/WonAuctions.asp">Articles achetés</a>';c=c+"</span>";c=c+'<span class="favoriteSell">';c=c+"<h3>Mes ventes</h3>";c=c+'<a title="Offene" href="https://www.fr.ricardo.ch/MyPages/MySelling/MySelling.asp">Articles en cours</a>';c=c+'<a title="Verkauft" href="https://www.fr.ricardo.ch/MyPages/MySelling/SoldAuctions.asp">Articles vendus</a>';c=c+'<a title="nicht verkauft" href="https://www.fr.ricardo.ch/MyPages/MySelling/UnsoldAuctions.asp">Articles non vendus</a>';c=c+"</span>";c=c+'<span class="favoriteOther">';c=c+"<h3>Autres</h3>";c=c+'<a title="Acheter" href="http://www.fr.ricardo.ch/acheter/">Acheter</a>';c=c+'<a title="Beobachter" href="https://www.fr.ricardo.ch/MyPages/Favorite/Observer.asp?SSL=ON">Observateur</a>';c=c+'<a title="SuchauftrÃ¤ge" href="https://www.fr.ricardo.ch/MyPages/Favorite/NewSearch.asp">Demandes de recherche</a>';c=c+'<a title="Bewertung" href="https://www.fr.ricardo.ch/Accdb/ViewUser.asp">Evaluations</a>';c=c+'<a title="Postfach" href="https://www.fr.ricardo.ch/MyPages/MyInbox/Inbox.asp">Boîte aux lettres</a>';c=c+'<a id="favortieMerkliste" class="iframe fancybox.iframe" title="Merkliste" href="/Usability/CH/MyFavorites.aspx">Liste des favoris</a>';c=c+"</span>";c=c+"</div>"}else{c='<a href="javascript:void(0)" class="hpcButton" style="display: block!important;" id="btnFavoriteslink">Meine Links</a>';c=c+'<div id="favoritesLinks" style="display: none;">';c=c+'<span class="favoriteBuy">';c=c+"<h3>Mein Kaufen</h3>";c=c+'<a title="Offen" href="https://www.ricardo.ch/MyPages/Mybuying/MyBuying.asp">Offen</a>';c=c+'<a title="Gekauft" href="https://www.ricardo.ch/MyPages/Mybuying/WonAuctions.asp">Gekauft</a>';c=c+"</span>";c=c+'<span class="favoriteSell">';c=c+"<h3>Mein Verkaufen</h3>";c=c+'<a title="Offene" href="https://www.ricardo.ch/MyPages/MySelling/MySelling.asp">Offene</a>';c=c+'<a title="Verkauft" href="https://www.ricardo.ch/MyPages/MySelling/SoldAuctions.asp">Verkauft</a>';c=c+'<a title="nicht verkauft" href="https://www.ricardo.ch/MyPages/MySelling/UnsoldAuctions.asp">Nicht verkauft</a>';c=c+"</span>";c=c+'<span class="favoriteOther">';c=c+"<h3>Andere</h3>";c=c+'<a title="Kaufen" href="http://www.ricardo.ch/kaufen/">Kaufen</a>';c=c+'<a title="Beobachter" href="https://www.ricardo.ch/MyPages/Favorite/Observer.asp">Beobachter</a>';c=c+'<a title="SuchauftrÃ¤ge" href="https://www.ricardo.ch/MyPages/Favorite/NewSearch.asp">Suchaufträge</a>';c=c+'<a title="Bewertung" href="https://www.ricardo.ch/Accdb/ViewUser.asp">Bewertung</a>';c=c+'<a title="Postfach" href="https://www.ricardo.ch/MyPages/MyInbox/Inbox.asp">Postfach</a>';c=c+'<a id="favortieMerkliste" class="iframe fancybox.iframe" title="Merkliste" href="/Usability/CH/MyFavorites.aspx">Merkliste</a>';c=c+"</span>";c=c+"</div>"}$("#FormNav").append(linkAdvSearch+c)});$("#channels a").live("click",function(){var e=$(this).parent().attr("class");if(e!==null){var g=$.cookies.get("mychannels");if(g===null){var f=new Date().getTime();g={channels:[],updated:f,displayed:0}}var d=false;for(var c in g.channels){if(g.channels[c].i==e){g.channels[c].v++;d=true}}if(!d){g.channels.push({i:e,v:1})}g.updated=new Date().getTime();var a=30;var b=new Date();b.setTime(b.getTime()+a*24*60*60*1000);var h={expiresAt:b};var h={domain:".ricardo.ch",hoursToLive:240};$.cookies.set("mychannels",g,h)}window.location.href=$(this).attr("href");return false});function favorites_init(){$("#btnFavoriteslink").click(function(){$("#favoritesLinks").slideToggle()})}function it_ManageFavoritesLink(){if($("a#favortieMerkliste").length>0){if($.cookies.get("QXLRicardoMyFavorites")!=null&&$.cookies.get("QXLRicardoMyFavorites")!=""){$("a#favortieMerkliste").show();$("a#favortieMerkliste").fancybox({width:900,height:450,beforeShow:function(){doTrack("header","link_favorites","v1")}})}else{$("a#favortieMerkliste").hide()}}}function getLoginStatus(){try{if($("#it_toLogout").html()!=null){if($.cookies.get("login_information")){$.cookies.del("login_information")}var a={hoursToLive:2160};$.cookies.set("login_information",1,a)}}catch(b){}}$.fn.fancyHelp2=function(a){var b="#"+$(this).data("section");return $(this).fancybox({type:"ajax",autoSize:false,width:650,height:400,ajax:{dataFilter:function(c){return $(c).find("#"+b)[0]}},wrapCSS:"fancyHelp"})};$(document).ready(function(){$(".fancyhelplink").each(function(a){$(this).fancyHelp2()});favorites_init();it_ManageFavoritesLink();$('[name="CategoryAndLevel"]').attr("id","CategoryAndLevel");getLoginStatus()});
