(function($){$.address=(function(){var _trigger=function(name){$($.address).trigger($.extend($.Event(name),(function(){var parameters={},parameterNames=$.address.parameterNames();for(var i=0,l=parameterNames.length;i<l;i++){parameters[parameterNames[i]]=$.address.parameter(parameterNames[i])}return{value:$.address.value(),path:$.address.path(),pathNames:$.address.pathNames(),parameterNames:parameterNames,parameters:parameters,queryString:$.address.queryString()}}).call($.address)))},_bind=function(value,data,fn){$($.address).bind(value,data,fn);return $.address},_hash=function(){var index=_l.href.indexOf("#");return index!=-1?_ec(_dc(_crawl(_l.href.substr(index+1),FALSE))):""},_window=function(){try{return top.document!==undefined?top:window}catch(e){return window}},_js=function(){return"javascript"},_strict=function(value,force){if(_opts.strict){value=force?(value.substr(0,1)!="/"?"/"+value:value):(value==""?"/":value)}return value},_local=function(value,direction){return(_msie&&_l.protocol=="file:")?(direction?_value.replace(/\?/,"%3F"):_value.replace(/%253F/,"?")):value},_crawl=function(value,direction){if(_opts.crawlable&&direction){return(value!=""?"!":"")+value}return value.replace(/^\!/,"")},_cssint=function(el,value){return parseInt(el.css(value),10)},_search=function(el){var url,s;for(var i=0,l=el.childNodes.length;i<l;i++){if(el.childNodes[i].src){url=String(el.childNodes[i].src)}s=_search(el.childNodes[i]);if(s){url=s}}return url},_listen=function(){if(!_silent){var hash=_hash(),diff=_value!=hash;if(_safari&&_version<523){if(_length!=_h.length){_length=_h.length;if(typeof _stack[_length-1]!=UNDEFINED){_value=_stack[_length-1]}_update(FALSE)}}else{if(_msie&&_version<7&&diff){_l.reload()}else{if(diff){_value=hash;_update(FALSE)}}}}},_update=function(internal){_trigger(CHANGE);_trigger(internal?INTERNAL_CHANGE:EXTERNAL_CHANGE);_st(_track,10)},_track=function(){var value=(_l.pathname+(/\/$/.test(_l.pathname)?"":"/")+($.address?$.address.value():"")).replace(/\/\//,"/").replace(/^\/$/,""),fn=_t[_opts.tracker];if(typeof fn==FUNCTION){fn(value)}else{if(typeof urchinTracker==FUNCTION){urchinTracker(value)}else{if(typeof pageTracker!=UNDEFINED&&typeof pageTracker._trackPageview==FUNCTION){pageTracker._trackPageview(value)}else{if(typeof _gaq!=UNDEFINED&&typeof _gaq.push==FUNCTION){_gaq.push(["_trackPageview",value])}}}}},_html=function(){var doc=_frame.contentWindow.document;doc.open();doc.write("<html><head><title>"+_d.title+"</title><script>var "+ID+' = "'+_hash()+'";</script></head></html>');doc.close()},_load=function(){if(!_loaded){_loaded=TRUE;var body=$("body").ajaxComplete(function(){_unescape.call(this)}).trigger("ajaxComplete");if(_opts.wrap){var wrap=$("body > *").wrapAll('<div style="padding:'+(_cssint(body,"marginTop")+_cssint(body,"paddingTop"))+"px "+(_cssint(body,"marginRight")+_cssint(body,"paddingRight"))+"px "+(_cssint(body,"marginBottom")+_cssint(body,"paddingBottom"))+"px "+(_cssint(body,"marginLeft")+_cssint(body,"paddingLeft"))+'px;" />').parent().wrap('<div id="'+ID+'" style="height:100%; overflow:auto;'+(_safari?(window.statusbar.visible&&!/chrome/i.test(_agent)?"":" resize:both;"):"")+'" />');$("html, body").css({height:"100%",margin:0,padding:0,overflow:"hidden"});if(_safari){$('<style type="text/css" />').appendTo("head").text("#"+ID+"::-webkit-resizer { background-color: #fff; }")}}if(_msie&&_version<8){var frameset=_d.getElementsByTagName("frameset")[0];_frame=_d.createElement((frameset?"":"i")+"frame");if(frameset){frameset.insertAdjacentElement("beforeEnd",_frame);frameset[frameset.cols?"cols":"rows"]+=",0";_frame.src=_js()+":"+FALSE;_frame.noResize=TRUE;_frame.frameBorder=_frame.frameSpacing=0}else{_frame.src=_js()+":"+FALSE;_frame.style.display="none";_d.body.insertAdjacentElement("afterBegin",_frame)}_st(function(){$(_frame).bind("load",function(){var win=_frame.contentWindow;var src=win.location.href;_value=(typeof win[ID]!=UNDEFINED?win[ID]:"");if(_value!=_hash()){_update(FALSE);_l.hash=_local(_crawl(_value,TRUE),TRUE)}});if(typeof _frame.contentWindow[ID]==UNDEFINED){_html()}},50)}else{if(_safari){if(_version<418){$(_d.body).append('<form id="'+ID+'" style="position:absolute;top:-9999px;" method="get"></form>');_form=_d.getElementById(ID)}if(typeof _l[ID]==UNDEFINED){_l[ID]={}}if(typeof _l[ID][_l.pathname]!=UNDEFINED){_stack=_l[ID][_l.pathname].split(",")}}}_st(function(){_trigger("init");_update(FALSE)},1);if((_msie&&_version>7)||(!_msie&&("on"+HASH_CHANGE) in _t)){if(_t.addEventListener){_t.addEventListener(HASH_CHANGE,_listen,false)}else{if(_t.attachEvent){_t.attachEvent("on"+HASH_CHANGE,_listen)}}}else{_si(_listen,50)}$("a").filter("[rel*=address:]").address()}},_unload=function(){if(_t.removeEventListener){_t.removeEventListener(HASH_CHANGE,_listen,false)}else{if(_t.detachEvent){_t.detachEvent("on"+HASH_CHANGE,_listen)}}},_unescape=function(){var base=_l.pathname.replace(/\/$/,""),fragment="_escaped_fragment_";if($("body").html().indexOf(fragment)!=-1){$("a[href]:not([href^=http])",this).each(function(){var href=$(this).attr("href").replace(new RegExp(base+"/?$"),"");if(href==""||href.indexOf(fragment)!=-1){$(this).attr("href","#"+decodeURIComponent(href.replace(new RegExp("/(.*)\\?"+fragment+"=(.*)$"),"!$2")))}})}},ID="jQueryAddress",FUNCTION="function",UNDEFINED="undefined",HASH_CHANGE="hashchange",INIT="init",CHANGE="change",INTERNAL_CHANGE="internalChange",EXTERNAL_CHANGE="externalChange",TRUE=true,FALSE=false,_opts={autoUpdate:TRUE,crawlable:FALSE,history:TRUE,strict:TRUE,wrap:FALSE},_browser=$.browser,_version=parseFloat($.browser.version),_mozilla=_browser.mozilla,_msie=_browser.msie,_opera=_browser.opera,_safari=_browser.safari,_supported=FALSE,_t=_window(),_d=_t.document,_h=_t.history,_l=_t.location,_si=setInterval,_st=setTimeout,_dc=decodeURI,_ec=encodeURI,_agent=navigator.userAgent,_frame,_form,_url=_search(document),_qi=_url?_url.indexOf("?"):-1,_title=_d.title,_length=_h.length,_silent=FALSE,_loaded=FALSE,_justset=TRUE,_juststart=TRUE,_updating=FALSE,_stack=[],_listeners={},_value=_hash();if(_msie){_version=parseFloat(_agent.substr(_agent.indexOf("MSIE")+4));if(_d.documentMode&&_d.documentMode!=_version){_version=_d.documentMode!=8?7:8}$(document).bind("propertychange",function(){if(_d.title!=_title&&_d.title.indexOf("#"+_hash())!=-1){_d.title=_title}})}_supported=(_mozilla&&_version>=1)||(_msie&&_version>=6)||(_opera&&_version>=9.5)||(_safari&&_version>=312);if(_supported){for(var i=1;i<_length;i++){_stack.push("")}_stack.push(_value);if(_msie&&_l.hash!=_value){_l.hash="#"+_local(_crawl(_value,TRUE),TRUE)}if(_opera){history.navigationMode="compatible"}if(_url&&_qi!=-1){var param,params=_url.substr(_qi+1).split("&");for(i=0;i<params.length;i++){param=params[i].split("=");if(/^(autoUpdate|crawlable|history|strict|wrap)$/.test(param[0])){_opts[param[0]]=(isNaN(param[1])?/^(true|yes)$/i.test(param[1]):(parseInt(param[1],10)!==0))}if(/^tracker$/.test(param[0])){_opts[param[0]]=param[1]}}}if(document.readyState=="complete"){_load()}$(_load);$(window).bind("unload",_unload)}else{if((!_supported&&_hash()!="")||(_safari&&_version<418&&_hash()!=""&&_l.search!="")){_d.open();_d.write('<html><head><meta http-equiv="refresh" content="0;url='+encodeURI(_l.href.substr(0,_l.href.indexOf("#")))+'" /></head></html>');_d.close()}else{_track()}}return{bind:function(type,data,fn){return _bind(type,data,fn)},init:function(fn){return _bind(INIT,fn)},change:function(fn){return _bind(CHANGE,fn)},internalChange:function(fn){return _bind(INTERNAL_CHANGE,fn)},externalChange:function(fn){return _bind(EXTERNAL_CHANGE,fn)},baseURL:function(){var url=_l.href;if(url.indexOf("#")!=-1){url=url.substr(0,url.indexOf("#"))}if(/\/$/.test(url)){url=url.substr(0,url.length-1)}return url},autoUpdate:function(value){if(value!==undefined){_opts.autoUpdate=value;return this}return _opts.autoUpdate},crawlable:function(value){if(value!==undefined){_opts.crawlable=value;return this}return _opts.crawlable},history:function(value){if(value!==undefined){_opts.history=value;return this}return _opts.history},strict:function(value){if(value!==undefined){_opts.strict=value;return this}return _opts.strict},tracker:function(value){if(value!==undefined){_opts.tracker=value;return this}return _opts.tracker},wrap:function(value){if(value!==undefined){_opts.wrap=value;return this}return _opts.wrap},update:function(){_updating=TRUE;this.value(_value);_updating=FALSE;return this},title:function(value){if(value!==undefined){value=_dc(value);_st(function(){_title=_d.title=value;if(_juststart&&_frame&&_frame.contentWindow&&_frame.contentWindow.document){_frame.contentWindow.document.title=value;_juststart=FALSE}if(!_justset&&_mozilla){_l.replace(_l.href.indexOf("#")!=-1?_l.href:_l.href+"#")}_justset=FALSE},50);return this}return _d.title},value:function(value){if(value!==undefined){value=_ec(_dc(_strict(value,TRUE)));if(value=="/"){value=""}if(_value==value&&!_updating){return}_justset=TRUE;_value=value;if(_opts.autoUpdate||_updating){_silent=TRUE;_update(TRUE);_stack[_h.length]=_value;if(_safari){if(_opts.history){_l[ID][_l.pathname]=_stack.toString();_length=_h.length+1;if(_version<418){if(_l.search==""){_form.action="#"+_crawl(_value,TRUE);_form.submit()}}else{if(_version<523||_value==""){var evt=_d.createEvent("MouseEvents");evt.initEvent("click",TRUE,TRUE);var anchor=_d.createElement("a");anchor.href="#"+_crawl(_value,TRUE);anchor.dispatchEvent(evt)}else{_l.hash="#"+_crawl(_value,TRUE)}}}else{_l.replace("#"+_crawl(_value,TRUE))}}else{if(_value!=_hash()){if(_opts.history){_l.hash="#"+_local(_crawl(_value,TRUE),TRUE)}else{_l.replace("#"+_crawl(_value,TRUE))}}}if((_msie&&_version<8)&&_opts.history){_st(_html,50)}if(_safari){_st(function(){_silent=FALSE},1)}else{_silent=FALSE}}return this}if(!_supported){return null}return _dc(_strict(_local(_value,FALSE),FALSE))},path:function(value){if(value!==undefined){var qs=this.queryString(),hash=this.hash();this.value(value+(qs?"?"+qs:"")+(hash?"#"+hash:""));return this}return this.value().split("#")[0].split("?")[0]},queryString:function(value){if(value!==undefined){var hash=this.hash();this.value(this.path()+(value?"?"+value:"")+(hash?"#"+hash:""));return this}var arr=this.value().split("?");return arr.slice(1,arr.length).join("?").split("#")[0]},parameter:function(name,value,append){var i,params;if(value!==undefined){var names=this.parameterNames();params=[];for(i=0;i<names.length;i++){var n=names[i],v=this.parameter(n);if(typeof v=="string"){v=[v]}if(n==name){v=(value===null||value==="")?[]:(append?v.concat([value]):[value])}for(var j=0;j<v.length;j++){params.push(n+"="+v[j])}}if($.inArray(name,names)==-1&&value!==null&&value!==""){params.push(name+"="+value)}this.queryString(params.join("&"));return this}value=this.queryString();if(value){params=value.split("&");var r=[];for(i=0;i<params.length;i++){var p=params[i].split("=");if(p[0]==name){r.push(p[1])}}if(r.length!==0){return r.length!=1?r:r[0]}}},pathNames:function(){var path=this.path(),names=path.replace(/\/{2,9}/g,"/").split("/");if(path.substr(0,1)=="/"||path.length===0){names.splice(0,1)}if(path.substr(path.length-1,1)=="/"){names.splice(names.length-1,1)}return names},parameterNames:function(){var qs=this.queryString(),names=[];if(qs&&qs.indexOf("=")!=-1){var params=qs.split("&");for(var i=0;i<params.length;i++){var name=params[i].split("=")[0];if($.inArray(name,names)==-1){names.push(name)}}}return names},hash:function(value){if(value!==undefined){this.value(this.value().split("#")[0]+(value?"#"+value:""));return this}var arr=this.value().split("#");return arr.slice(1,arr.length).join("#")}}})();$.fn.address=function(fn){var f=function(){if($(this).is("a")){var value=fn?fn.call(this):/address:/.test($(this).attr("rel"))?$(this).attr("rel").split("address:")[1].split(" ")[0]:$(this).attr("href").replace(/^#\!?/,"");$.address.value(value);return false}};$(this).click(f).live("click",f);$(this).live("submit",function(){if($(this).is("form")){var value=fn?fn.call(this):$(this).attr("action")+"?"+$(this).serialize();$.address.value(value);return false}});return this}}(jQuery));(function(jQuery){jQuery.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end)}fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")"}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3){return color}if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)){return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])]}if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)){return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55]}if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)){return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)]}if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)){return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)]}return colors[jQuery.trim(color).toLowerCase()]}function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=""&&color!="transparent"||jQuery.nodeName(elem,"body")){break}attr="backgroundColor"}while(elem=elem.parentNode);return getRGB(color)}})(jQuery);(function($){var colorbox="colorbox",hover="hover",TRUE=true,FALSE=false,cboxPublic,isIE=$.browser.msie&&!$.support.opacity,isIE6=isIE&&$.browser.version<7,cbox_open="cbox_open",cbox_load="cbox_load",cbox_complete="cbox_complete",cbox_cleanup="cbox_cleanup",cbox_closed="cbox_closed",cbox_resize="resize.cbox_resize",$overlay,$cbox,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$loadingGraphic,$title,$current,$slideshow,$next,$prev,$close,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,element,bookmark,index,settings,open,active,defaults={transition:"elastic",speed:350,width:FALSE,height:FALSE,innerWidth:FALSE,innerHeight:FALSE,initialWidth:"400",initialHeight:"400",maxWidth:FALSE,maxHeight:FALSE,scalePhotos:TRUE,scrolling:TRUE,inline:FALSE,html:FALSE,iframe:FALSE,photo:FALSE,href:FALSE,title:FALSE,rel:FALSE,opacity:0.9,preloading:TRUE,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:FALSE,overlayClose:TRUE,slideshow:FALSE,slideshowAuto:TRUE,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:FALSE,onLoad:FALSE,onComplete:FALSE,onCleanup:FALSE,onClosed:FALSE};function setSize(size,dimension){dimension=dimension==="x"?$window.width():$window.height();return(typeof size==="string")?Math.round((size.match(/%/)?(dimension/100)*parseInt(size,10):parseInt(size,10))):size}function isImage(url){url=$.isFunction(url)?url.call(element):url;return settings.photo||url.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function process(){for(var i in settings){if($.isFunction(settings[i])&&i.substring(0,2)!=="on"){settings[i]=settings[i].call(element)}}settings.rel=settings.rel||element.rel;settings.href=settings.href||element.href;settings.title=settings.title||element.title}function launch(elem){element=elem;settings=$.extend({},$(element).data(colorbox));process();if(settings.rel&&settings.rel!=="nofollow"){$related=$(".cboxElement").filter(function(){var relRelated=$(this).data(colorbox).rel||this.rel;return(relRelated===settings.rel)});index=$related.index(element);if(index<0){$related=$related.add(element);index=$related.length-1}}else{$related=$(element);index=0}if(!open){open=TRUE;active=TRUE;bookmark=element;bookmark.blur();$(document).bind("keydown.cbox_close",function(e){if(e.keyCode===27){e.preventDefault();cboxPublic.close()}}).bind("keydown.cbox_arrows",function(e){if($related.length>1){if(e.keyCode===37){e.preventDefault();$prev.click()}else{if(e.keyCode===39){e.preventDefault();$next.click()}}}});if(settings.overlayClose){$overlay.css({cursor:"pointer"}).one("click",cboxPublic.close)}$.event.trigger(cbox_open);if(settings.onOpen){settings.onOpen.call(element)}$overlay.css({opacity:settings.opacity}).show();settings.w=setSize(settings.initialWidth,"x");settings.h=setSize(settings.initialHeight,"y");cboxPublic.position(0);if(isIE6){$window.bind("resize.cboxie6 scroll.cboxie6",function(){$overlay.css({width:$window.width(),height:$window.height(),top:$window.scrollTop(),left:$window.scrollLeft()})}).trigger("scroll.cboxie6")}}$current.add($prev).add($next).add($slideshow).add($title).hide();$close.html(settings.close).show();cboxPublic.slideshow();cboxPublic.load()}cboxPublic=$.fn.colorbox=function(options,callback){var $this=this;if(!$this.length){if($this.selector===""){$this=$("<a/>");options.open=TRUE}else{return this}}$this.each(function(){var data=$.extend({},$(this).data(colorbox)?$(this).data(colorbox):defaults,options);$(this).data(colorbox,data).addClass("cboxElement");if(callback){$(this).data(colorbox).onComplete=callback}});if(options&&options.open){launch($this)}return this};cboxPublic.init=function(){function $div(id){return $('<div id="cbox'+id+'"/>')}$window=$(window);$cbox=$('<div id="colorbox"/>');$overlay=$div("Overlay").hide();$wrap=$div("Wrapper");$content=$div("Content").append($loaded=$div("LoadedContent").css({width:0,height:0}),$loadingOverlay=$div("LoadingOverlay"),$loadingGraphic=$div("LoadingGraphic"),$title=$div("Title"),$current=$div("Current"),$slideshow=$div("Slideshow"),$next=$div("Next"),$prev=$div("Previous"),$close=$div("Close"));$wrap.append($("<div/>").append($div("TopLeft"),$topBorder=$div("TopCenter"),$div("TopRight")),$("<div/>").append($leftBorder=$div("MiddleLeft"),$content,$rightBorder=$div("MiddleRight")),$("<div/>").append($div("BottomLeft"),$bottomBorder=$div("BottomCenter"),$div("BottomRight"))).children().children().css({"float":"left"});$loadingBay=$("<div style='position:absolute; top:0; left:0; width:9999px; height:0;'/>");$("body").prepend($overlay,$cbox.append($wrap,$loadingBay));if(isIE){$cbox.addClass("cboxIE");if(isIE6){$overlay.css("position","absolute")}}$content.children().bind("mouseover mouseout",function(){$(this).toggleClass(hover)}).addClass(hover);interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(TRUE)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(TRUE)-$content.width();loadedHeight=$loaded.outerHeight(TRUE);loadedWidth=$loaded.outerWidth(TRUE);$cbox.css({"padding-bottom":interfaceHeight,"padding-right":interfaceWidth}).hide();$next.click(cboxPublic.next);$prev.click(cboxPublic.prev);$close.click(cboxPublic.close);$content.children().removeClass(hover);$(".cboxElement").live("click",function(e){if(e.button!==0&&typeof e.button!=="undefined"){return TRUE}else{launch(this);return FALSE}})};cboxPublic.position=function(speed,loadedCallback){var animate_speed,winHeight=$window.height(),posTop=Math.max(winHeight-settings.h-loadedHeight-interfaceHeight,0)/2+$window.scrollTop(),posLeft=Math.max(document.documentElement.clientWidth-settings.w-loadedWidth-interfaceWidth,0)/2+$window.scrollLeft();animate_speed=($cbox.width()===settings.w+loadedWidth&&$cbox.height()===settings.h+loadedHeight)?0:speed;$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(that){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=that.style.width;$loadingGraphic[0].style.height=$loadingOverlay[0].style.height=$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=that.style.height}$cbox.dequeue().animate({width:settings.w+loadedWidth,height:settings.h+loadedHeight,top:posTop,left:posLeft},{duration:animate_speed,complete:function(){modalDimensions(this);active=FALSE;$wrap[0].style.width=(settings.w+loadedWidth+interfaceWidth)+"px";$wrap[0].style.height=(settings.h+loadedHeight+interfaceHeight)+"px";if(loadedCallback){loadedCallback()}},step:function(){modalDimensions(this)}})};cboxPublic.resize=function(object){if(!open){return}var topMargin,prev,prevSrc,next,nextSrc,photo,timeout,speed=settings.transition==="none"?0:settings.speed;$window.unbind(cbox_resize);if(!object){timeout=setTimeout(function(){var $child=$loaded.wrapInner("<div style='overflow:auto'></div>").children();settings.h=$child.height();$loaded.css({height:settings.h});$child.replaceWith($child.children());cboxPublic.position(speed)},1);return}$loaded.remove();$loaded=$('<div id="cboxLoadedContent"/>').html(object);function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw<settings.w?settings.mw:settings.w;return settings.w}function getHeight(){settings.h=settings.h||$loaded.height();settings.h=settings.mh&&settings.mh<settings.h?settings.mh:settings.h;return settings.h}$loaded.hide().appendTo($loadingBay).css({width:getWidth(),overflow:settings.scrolling?"auto":"hidden"}).css({height:getHeight()}).prependTo($content);$("#cboxPhoto").css({cssFloat:"none"});if(isIE6){$("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(cbox_cleanup,function(){this.style.visibility="inherit"})}function setPosition(s){cboxPublic.position(s,function(){if(!open){return}if(isIE){if(photo){$loaded.fadeIn(100)}$cbox[0].style.removeAttribute("filter")}if(settings.iframe){$loaded.append("<iframe id='cboxIframe'"+(settings.scrolling?" ":"scrolling='no'")+" name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+settings.href+"' "+(isIE?"allowtransparency='true'":"")+" />")}$loaded.show();$title.show().html(settings.title);if($related.length>1){$current.html(settings.current.replace(/\{current\}/,index+1).replace(/\{total\}/,$related.length)).show();$next.html(settings.next).show();$prev.html(settings.previous).show();if(settings.slideshow){$slideshow.show()}}$loadingOverlay.hide();$loadingGraphic.hide();$.event.trigger(cbox_complete);if(settings.onComplete){settings.onComplete.call(element)}if(settings.transition==="fade"){$cbox.fadeTo(speed,1,function(){if(isIE){$cbox[0].style.removeAttribute("filter")}})}$window.bind(cbox_resize,function(){cboxPublic.position(0)})})}if((settings.transition==="fade"&&$cbox.fadeTo(speed,0,function(){setPosition(0)}))||setPosition(speed)){}if(settings.preloading&&$related.length>1){prev=index>0?$related[index-1]:$related[$related.length-1];next=index<$related.length-1?$related[index+1]:$related[0];nextSrc=$(next).data(colorbox).href||next.href;prevSrc=$(prev).data(colorbox).href||prev.href;if(isImage(nextSrc)){$("<img />").attr("src",nextSrc)}if(isImage(prevSrc)){$("<img />").attr("src",prevSrc)}}};cboxPublic.load=function(){var href,img,setResize,resize=cboxPublic.resize;active=TRUE;element=$related[index];settings=$.extend({},$(element).data(colorbox));process();$.event.trigger(cbox_load);if(settings.onLoad){settings.onLoad.call(element)}settings.h=settings.height?setSize(settings.height,"y")-loadedHeight-interfaceHeight:settings.innerHeight?setSize(settings.innerHeight,"y"):FALSE;settings.w=settings.width?setSize(settings.width,"x")-loadedWidth-interfaceWidth:settings.innerWidth?setSize(settings.innerWidth,"x"):FALSE;settings.mw=settings.w;settings.mh=settings.h;if(settings.maxWidth){settings.mw=setSize(settings.maxWidth,"x")-loadedWidth-interfaceWidth;settings.mw=settings.w&&settings.w<settings.mw?settings.w:settings.mw}if(settings.maxHeight){settings.mh=setSize(settings.maxHeight,"y")-loadedHeight-interfaceHeight;settings.mh=settings.h&&settings.h<settings.mh?settings.h:settings.mh}href=settings.href;$loadingOverlay.show();$loadingGraphic.show();if(settings.inline){$('<div id="cboxInlineTemp" />').hide().insertBefore($(href)[0]).bind(cbox_load+" "+cbox_cleanup,function(){$(this).replaceWith($loaded.children())});resize($(href))}else{if(settings.iframe){resize(" ")}else{if(settings.html){resize(settings.html)}else{if(isImage(href)){img=new Image();img.onload=function(){var percent;img.onload=null;img.id="cboxPhoto";$(img).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(settings.scalePhotos){setResize=function(){img.height-=img.height*percent;img.width-=img.width*percent};if(settings.mw&&img.width>settings.mw){percent=(img.width-settings.mw)/img.width;setResize()}if(settings.mh&&img.height>settings.mh){percent=(img.height-settings.mh)/img.height;setResize()}}if(settings.h){img.style.marginTop=Math.max(settings.h-img.height,0)/2+"px"}resize(img);if($related.length>1){$(img).css({cursor:"pointer"}).click(cboxPublic.next)}if(isIE){img.style.msInterpolationMode="bicubic"}};img.src=href}else{$("<div />").appendTo($loadingBay).load(href,function(data,textStatus){if(textStatus==="success"){resize(this)}else{resize($("<p>Request unsuccessful.</p>"))}})}}}}};cboxPublic.next=function(){if(!active){index=index<$related.length-1?index+1:0;cboxPublic.load()}};cboxPublic.prev=function(){if(!active){index=index>0?index-1:$related.length-1;cboxPublic.load()}};cboxPublic.slideshow=function(){var stop,timeOut,className="cboxSlideshow_";$slideshow.bind(cbox_closed,function(){$slideshow.unbind();clearTimeout(timeOut);$cbox.removeClass(className+"off "+className+"on")});function start(){$slideshow.text(settings.slideshowStop).bind(cbox_complete,function(){timeOut=setTimeout(cboxPublic.next,settings.slideshowSpeed)}).bind(cbox_load,function(){clearTimeout(timeOut)}).one("click",function(){stop();$(this).removeClass(hover)});$cbox.removeClass(className+"off").addClass(className+"on")}stop=function(){clearTimeout(timeOut);$slideshow.text(settings.slideshowStart).unbind(cbox_complete+" "+cbox_load).one("click",function(){start();timeOut=setTimeout(cboxPublic.next,settings.slideshowSpeed);$(this).removeClass(hover)});$cbox.removeClass(className+"on").addClass(className+"off")};if(settings.slideshow&&$related.length>1){if(settings.slideshowAuto){start()}else{stop()}}};cboxPublic.close=function(){$.event.trigger(cbox_cleanup);if(settings.onCleanup){settings.onCleanup.call(element)}open=FALSE;$(document).unbind("keydown.cbox_close keydown.cbox_arrows");$window.unbind(cbox_resize+" resize.cboxie6 scroll.cboxie6");$overlay.css({cursor:"auto"}).fadeOut("fast");$cbox.stop(TRUE,FALSE).fadeOut("fast",function(){$("#colorbox iframe").attr("src","about:blank");$loaded.remove();$cbox.css({opacity:1});try{bookmark.focus()}catch(er){}$.event.trigger(cbox_closed);if(settings.onClosed){settings.onClosed.call(element)}})};cboxPublic.element=function(){return $(element)};cboxPublic.settings=defaults;$(cboxPublic.init)}(jQuery));jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return -c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b}return -c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t+b}return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b}return -c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t*t+b}return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return -c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return -c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0){return b}if(t==d){return b+c}if((t/=d/2)<1){return c/2*Math.pow(2,10*(t-1))+b}return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return -c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1){return -c/2*(Math.sqrt(1-t*t)-1)+b}return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d)==1){return b+c}if(!p){p=d*0.3}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0){return b}if((t/=d/2)==2){return b+c}if(!p){p=d*(0.3*1.5)}if(a<Math.abs(c)){a=c;var s=p/4}else{var s=p/(2*Math.PI)*Math.asin(c/a)}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined){s=1.70158}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b}}}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2){return jQuery.easing.easeInBounce(x,t*2,0,c,d)*0.5+b}return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*0.5+c*0.5+b}});(function($){$.fn.externalInterface=function(args){this.each(function(){if(typeof(args.method)!="undefined"){try{if(typeof(args.args)!="undefined"){var data=this[args.method](args.args)}else{var data=this[args.method]()}if(typeof(args.success)!="undefined"){args.success(data)}}catch(error){if(typeof(args.error)!="undefined"){args.error(error)}}}});return this}})(jQuery);(function($){$.fn.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 ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){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.bind("mouseenter",handleHover).bind("mouseleave",handleHover)}})(jQuery);/*
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */
(function($){var defaults={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},windowLoaded=false;$(window).bind("load.jcarousel",function(){windowLoaded=true});$.jcarousel=function(e,o){this.options=$.extend({},defaults,o||{});this.locked=false;this.autoStopped=false;this.container=null;this.clip=null;this.list=null;this.buttonNext=null;this.buttonPrev=null;this.buttonNextState=null;this.buttonPrevState=null;if(!o||o.rtl===undefined){this.options.rtl=($(e).attr("dir")||$("html").attr("dir")||"").toLowerCase()=="rtl"}this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?(this.options.rtl?"right":"left"):"top";var skin="",split=e.className.split(" ");for(var i=0;i<split.length;i++){if(split[i].indexOf("jcarousel-skin")!=-1){$(e).removeClass(split[i]);skin=split[i];break}}if(e.nodeName.toUpperCase()=="UL"||e.nodeName.toUpperCase()=="OL"){this.list=$(e);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container")){this.container=this.container.wrap("<div></div>")}this.container=this.container.parent()}else{if(!this.container.hasClass("jcarousel-container")){this.container=this.list.wrap("<div></div>").parent()}}}else{this.container=$(e);this.list=this.container.find("ul,ol").eq(0)}if(skin!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1){this.container.wrap('<div class=" '+skin+'"></div>')}this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip")){this.clip=this.list.wrap("<div></div>").parent()}this.buttonNext=$(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null){this.buttonNext=this.clip.after(this.options.buttonNextHTML).next()}this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=$(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null){this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next()}this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css((this.options.rtl?"right":"left"),0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});if(!this.options.vertical&&this.options.rtl){this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl")}var di=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;var li=this.list.children("li");var self=this;if(li.size()>0){var wh=0,j=this.options.offset;li.each(function(){self.format(this,j++);wh+=self.dimension(this,di)});this.list.css(this.wh,(wh+100)+"px");if(!o||o.size===undefined){this.options.size=li.size()}}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){self.next()};this.funcPrev=function(){self.prev()};this.funcResize=function(){self.reload()};if(this.options.initCallback!==null){this.options.initCallback(this,"init")}if(!windowLoaded&&$.browser.safari){this.buttons(false,false);$(window).bind("load.jcarousel",function(){self.setup()})}else{this.setup()}};var $jc=$.jcarousel;$jc.fn=$jc.prototype={jcarousel:"0.2.7"};$jc.fn.extend=$jc.extend=$.extend;$jc.fn.extend({setup:function(){this.first=null;this.last=null;this.prevFirst=null;this.prevLast=null;this.animating=false;this.timer=null;this.tail=null;this.inTail=false;if(this.locked){return}this.list.css(this.lt,this.pos(this.options.offset)+"px");var p=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(p,false);$(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)},reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");if(this.options.initCallback!==null){this.options.initCallback(this,"reset")}this.setup()},reload:function(){if(this.tail!==null&&this.inTail){this.list.css(this.lt,$jc.intval(this.list.css(this.lt))+this.tail)}this.tail=null;this.inTail=false;if(this.options.reloadCallback!==null){this.options.reloadCallback(this)}if(this.options.visible!==null){var self=this;var di=Math.ceil(this.clipping()/this.options.visible),wh=0,lt=0;this.list.children("li").each(function(i){wh+=self.dimension(this,di);if(i+1<self.first){lt=wh}});this.list.css(this.wh,wh+"px");this.list.css(this.lt,-lt+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(s){if(s!==undefined){this.options.size=s;if(!this.locked){this.buttons()}}return this.options.size},has:function(i,i2){if(i2===undefined||!i2){i2=i}if(this.options.size!==null&&i2>this.options.size){i2=this.options.size}for(var j=i;j<=i2;j++){var e=this.get(j);if(!e.length||e.hasClass("jcarousel-item-placeholder")){return false}}return true},get:function(i){return $(".jcarousel-item-"+i,this.list)},add:function(i,s){var e=this.get(i),old=0,n=$(s);if(e.length===0){var c,j=$jc.intval(i);e=this.create(i);while(true){c=this.get(--j);if(j<=0||c.length){if(j<=0){this.list.prepend(e)}else{c.after(e)}break}}}else{old=this.dimension(e)}if(n.get(0).nodeName.toUpperCase()=="LI"){e.replaceWith(n);e=n}else{e.empty().append(s)}this.format(e.removeClass(this.className("jcarousel-item-placeholder")),i);var di=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;var wh=this.dimension(e,di)-old;if(i>0&&i<this.first){this.list.css(this.lt,$jc.intval(this.list.css(this.lt))-wh+"px")}this.list.css(this.wh,$jc.intval(this.list.css(this.wh))+wh+"px");return e},remove:function(i){var e=this.get(i);if(!e.length||(i>=this.first&&i<=this.last)){return}var d=this.dimension(e);if(i<this.first){this.list.css(this.lt,$jc.intval(this.list.css(this.lt))+d+"px")}e.remove();this.list.css(this.wh,$jc.intval(this.list.css(this.wh))-d+"px")},next:function(){if(this.tail!==null&&!this.inTail){this.scrollTail(false)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size)?1:this.first+this.options.scroll)}},prev:function(){if(this.tail!==null&&this.inTail){this.scrollTail(true)}else{this.scroll(((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1)?this.options.size:this.first-this.options.scroll)}},scrollTail:function(b){if(this.locked||this.animating||!this.tail){return}this.pauseAuto();var pos=$jc.intval(this.list.css(this.lt));pos=!b?pos-this.tail:pos+this.tail;this.inTail=!b;this.prevFirst=this.first;this.prevLast=this.last;this.animate(pos)},scroll:function(i,a){if(this.locked||this.animating){return}this.pauseAuto();this.animate(this.pos(i),a)},pos:function(i,fv){var pos=$jc.intval(this.list.css(this.lt));if(this.locked||this.animating){return pos}if(this.options.wrap!="circular"){i=i<1?1:(this.options.size&&i>this.options.size?this.options.size:i)}var back=this.first>i;var f=this.options.wrap!="circular"&&this.first<=1?1:this.first;var c=back?this.get(f):this.get(this.last);var j=back?f:f-1;var e=null,l=0,p=false,d=0,g;while(back?--j>=i:++j<i){e=this.get(j);p=!e.length;if(e.length===0){e=this.create(j).addClass(this.className("jcarousel-item-placeholder"));c[back?"before":"after"](e);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(j<=0||j>this.options.size)){g=this.get(this.index(j));if(g.length){e=this.add(j,g.clone(true))}}}c=e;d=this.dimension(e);if(p){l+=d}if(this.first!==null&&(this.options.wrap=="circular"||(j>=1&&(this.options.size===null||j<=this.options.size)))){pos=back?pos+d:pos-d}}var clipping=this.clipping(),cache=[],visible=0,v=0;c=this.get(i-1);j=i;while(++visible){e=this.get(j);p=!e.length;if(e.length===0){e=this.create(j).addClass(this.className("jcarousel-item-placeholder"));if(c.length===0){this.list.prepend(e)}else{c[back?"before":"after"](e)}if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(j<=0||j>this.options.size)){g=this.get(this.index(j));if(g.length){e=this.add(j,g.clone(true))}}}c=e;d=this.dimension(e);if(d===0){throw new Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...")}if(this.options.wrap!="circular"&&this.options.size!==null&&j>this.options.size){cache.push(e)}else{if(p){l+=d}}v+=d;if(v>=clipping){break}j++}for(var x=0;x<cache.length;x++){cache[x].remove()}if(l>0){this.list.css(this.wh,this.dimension(this.list)+l+"px");if(back){pos-=l;this.list.css(this.lt,$jc.intval(this.list.css(this.lt))-l+"px")}}var last=i+visible-1;if(this.options.wrap!="circular"&&this.options.size&&last>this.options.size){last=this.options.size}if(j>last){visible=0;j=last;v=0;while(++visible){e=this.get(j--);if(!e.length){break}v+=this.dimension(e);if(v>=clipping){break}}}var first=last-visible+1;if(this.options.wrap!="circular"&&first<1){first=1}if(this.inTail&&back){pos+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&last==this.options.size&&(last-visible+1)>=1){var m=$jc.margin(this.get(last),!this.options.vertical?"marginRight":"marginBottom");if((v-m)>clipping){this.tail=v-clipping-m}}if(fv&&i===this.options.size&&this.tail){pos-=this.tail;this.inTail=true}while(i-->first){pos+=this.dimension(this.get(i))}this.prevFirst=this.first;this.prevLast=this.last;this.first=first;this.last=last;return pos},animate:function(p,a){if(this.locked||this.animating){return}this.animating=true;var self=this;var scrolled=function(){self.animating=false;if(p===0){self.list.css(self.lt,0)}if(!self.autoStopped&&(self.options.wrap=="circular"||self.options.wrap=="both"||self.options.wrap=="last"||self.options.size===null||self.last<self.options.size||(self.last==self.options.size&&self.tail!==null&&!self.inTail))){self.startAuto()}self.buttons();self.notify("onAfterAnimation");if(self.options.wrap=="circular"&&self.options.size!==null){for(var i=self.prevFirst;i<=self.prevLast;i++){if(i!==null&&!(i>=self.first&&i<=self.last)&&(i<1||i>self.options.size)){self.remove(i)}}}};this.notify("onBeforeAnimation");if(!this.options.animation||a===false){this.list.css(this.lt,p+"px");scrolled()}else{var o=!this.options.vertical?(this.options.rtl?{right:p}:{left:p}):{top:p};this.list.animate(o,this.options.animation,this.options.easing,scrolled)}},startAuto:function(s){if(s!==undefined){this.options.auto=s}if(this.options.auto===0){return this.stopAuto()}if(this.timer!==null){return}this.autoStopped=false;var self=this;this.timer=window.setTimeout(function(){self.next()},this.options.auto*1000)},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer===null){return}window.clearTimeout(this.timer);this.timer=null},buttons:function(n,p){if(n==null){n=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="first")||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap=="first")&&this.options.size!==null&&this.last>=this.options.size){n=this.tail!==null&&!this.inTail}}if(p==null){p=!this.locked&&this.options.size!==0&&((this.options.wrap&&this.options.wrap!="last")||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1){p=this.tail!==null&&this.inTail}}var self=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);if(n){this.buttonNext.bind(this.options.buttonNextEvent+".jcarousel",this.funcNext)}this.buttonNext[n?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",n?false:true);if(this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=n){this.buttonNext.each(function(){self.options.buttonNextCallback(self,this,n)}).data("jcarouselstate",n)}}else{if(this.options.buttonNextCallback!==null&&this.buttonNextState!=n){this.options.buttonNextCallback(self,null,n)}}if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);if(p){this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev)}this.buttonPrev[p?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",p?false:true);if(this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=p){this.buttonPrev.each(function(){self.options.buttonPrevCallback(self,this,p)}).data("jcarouselstate",p)}}else{if(this.options.buttonPrevCallback!==null&&this.buttonPrevState!=p){this.options.buttonPrevCallback(self,null,p)}}this.buttonNextState=n;this.buttonPrevState=p},notify:function(evt){var state=this.prevFirst===null?"init":(this.prevFirst<this.first?"next":"prev");this.callback("itemLoadCallback",evt,state);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",evt,state,this.first);this.callback("itemFirstOutCallback",evt,state,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",evt,state,this.last);this.callback("itemLastOutCallback",evt,state,this.prevLast)}this.callback("itemVisibleInCallback",evt,state,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",evt,state,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(cb,evt,state,i1,i2,i3,i4){if(this.options[cb]==null||(typeof this.options[cb]!="object"&&evt!="onAfterAnimation")){return}var callback=typeof this.options[cb]=="object"?this.options[cb][evt]:this.options[cb];if(!$.isFunction(callback)){return}var self=this;if(i1===undefined){callback(self,state,evt)}else{if(i2===undefined){this.get(i1).each(function(){callback(self,this,i1,state,evt)})}else{var call=function(i){self.get(i).each(function(){callback(self,this,i,state,evt)})};for(var i=i1;i<=i2;i++){if(i!==null&&!(i>=i3&&i<=i4)){call(i)}}}}},create:function(i){return this.format("<li></li>",i)},format:function(e,i){e=$(e);var split=e.get(0).className.split(" ");for(var j=0;j<split.length;j++){if(split[j].indexOf("jcarousel-")!=-1){e.removeClass(split[j])}}e.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+i)).css({"float":(this.options.rtl?"right":"left"),"list-style":"none"}).attr("jcarouselindex",i);return e},className:function(c){return c+" "+c+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(e,d){var el=e.jquery!==undefined?e[0]:e;var old=!this.options.vertical?(el.offsetWidth||$jc.intval(this.options.itemFallbackDimension))+$jc.margin(el,"marginLeft")+$jc.margin(el,"marginRight"):(el.offsetHeight||$jc.intval(this.options.itemFallbackDimension))+$jc.margin(el,"marginTop")+$jc.margin(el,"marginBottom");if(d==null||old==d){return old}var w=!this.options.vertical?d-$jc.margin(el,"marginLeft")-$jc.margin(el,"marginRight"):d-$jc.margin(el,"marginTop")-$jc.margin(el,"marginBottom");$(el).css(this.wh,w+"px");return this.dimension(el)},clipping:function(){return !this.options.vertical?this.clip[0].offsetWidth-$jc.intval(this.clip.css("borderLeftWidth"))-$jc.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-$jc.intval(this.clip.css("borderTopWidth"))-$jc.intval(this.clip.css("borderBottomWidth"))},index:function(i,s){if(s==null){s=this.options.size}return Math.round((((i-1)/s)-Math.floor((i-1)/s))*s)+1}});$jc.extend({defaults:function(d){return $.extend(defaults,d||{})},margin:function(e,p){if(!e){return 0}var el=e.jquery!==undefined?e[0]:e;if(p=="marginRight"&&$.browser.safari){var old={display:"block","float":"none",width:"auto"},oWidth,oWidth2;$.swap(el,old,function(){oWidth=el.offsetWidth});old.marginRight=0;$.swap(el,old,function(){oWidth2=el.offsetWidth});return oWidth2-oWidth}return $jc.intval($.css(el,p))},intval:function(v){v=parseInt(v,10);return isNaN(v)?0:v}});$.fn.jcarousel=function(o){if(typeof o=="string"){var instance=$(this).data("jcarousel"),args=Array.prototype.slice.call(arguments,1);return instance[o].apply(instance,args)}else{return this.each(function(){$(this).data("jcarousel",new $jc(this,o))})}}})(jQuery);(function($){$.toJSON=function(o){if(typeof(JSON)=="object"&&JSON.stringify){return JSON.stringify(o)}var type=typeof(o);if(o===null){return"null"}if(type=="undefined"){return undefined}if(type=="number"||type=="boolean"){return o+""}if(type=="string"){return $.quoteString(o)}if(type=="object"){if(typeof o.toJSON=="function"){return $.toJSON(o.toJSON())}if(o.constructor===Date){var month=o.getUTCMonth()+1;if(month<10){month="0"+month}var day=o.getUTCDate();if(day<10){day="0"+day}var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10){hours="0"+hours}var minutes=o.getUTCMinutes();if(minutes<10){minutes="0"+minutes}var seconds=o.getUTCSeconds();if(seconds<10){seconds="0"+seconds}var milli=o.getUTCMilliseconds();if(milli<100){milli="0"+milli}if(milli<10){milli="0"+milli}return'"'+year+"-"+month+"-"+day+"T"+hours+":"+minutes+":"+seconds+"."+milli+'Z"'}if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i])||"null")}return"["+ret.join(",")+"]"}var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number"){name='"'+k+'"'}else{if(type=="string"){name=$.quoteString(k)}else{continue}}if(typeof o[k]=="function"){continue}var val=$.toJSON(o[k]);pairs.push(name+":"+val)}return"{"+pairs.join(", ")+"}"}};$.evalJSON=function(src){if(typeof(JSON)=="object"&&JSON.parse){return JSON.parse(src)}return eval("("+src+")")};$.secureEvalJSON=function(src){if(typeof(JSON)=="object"&&JSON.parse){return JSON.parse(src)}var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,"@");filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,"");if(/^[\],:{}\s]*$/.test(filtered)){return eval("("+src+")")}else{throw new SyntaxError("Error parsing JSON, source is not valid.")}};$.quoteString=function(string){if(string.match(_escapeable)){return'"'+string.replace(_escapeable,function(a){var c=_meta[a];if(typeof c==="string"){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+string+'"'};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"}})(jQuery);jQuery.fn.extend({number_format:function(numero,params){var sDefaults={numberOfDecimals:2,decimalSeparator:",",thousandSeparator:".",symbol:""};var options=jQuery.extend(sDefaults,params);var number=numero;var decimals=options.numberOfDecimals;var dec_point=options.decimalSeparator;var thousands_sep=options.thousandSeparator;var currencySymbol=options.symbol;var exponent="";var numberstr=number.toString();var eindex=numberstr.indexOf("e");if(eindex>-1){exponent=numberstr.substring(eindex);number=parseFloat(numberstr.substring(0,eindex))}if(decimals!=null){var temp=Math.pow(10,decimals);number=Math.round(number*temp)/temp}var sign=number<0?"-":"";var integer=(number>0?Math.floor(number):Math.abs(Math.ceil(number))).toString();var fractional=number.toString().substring(integer.length+sign.length);dec_point=dec_point!=null?dec_point:".";fractional=decimals!=null&&decimals>0||fractional.length>1?(dec_point+fractional.substring(1)):"";if(decimals!=null&&decimals>0){for(i=fractional.length-1,z=decimals;i<z;++i){fractional+="0"}}thousands_sep=(thousands_sep!=dec_point||fractional.length==0)?thousands_sep:null;if(thousands_sep!=null&&thousands_sep!=""){for(i=integer.length-3;i>0;i-=3){integer=integer.substring(0,i)+thousands_sep+integer.substring(i)}}if(options.symbol==""){return sign+integer+fractional+exponent}else{return currencySymbol+" "+sign+integer+fractional+exponent}}});jQuery.fn.numeric=function(decimal,callback){decimal=decimal||".";callback=typeof callback=="function"?callback:function(){};this.keypress(function(e){var key=e.charCode?e.charCode:e.keyCode?e.keyCode:0;if(key==13&&this.nodeName.toLowerCase()=="input"){return true}else{if(key==13){return false}}var allow=false;if((e.ctrlKey&&key==97)||(e.ctrlKey&&key==65)){return true}if((e.ctrlKey&&key==120)||(e.ctrlKey&&key==88)){return true}if((e.ctrlKey&&key==99)||(e.ctrlKey&&key==67)){return true}if((e.ctrlKey&&key==122)||(e.ctrlKey&&key==90)){return true}if((e.ctrlKey&&key==118)||(e.ctrlKey&&key==86)||(e.shiftKey&&key==45)){return true}if(key<48||key>57){if(key==45&&this.value.length==0){return true}if(key==decimal.charCodeAt(0)&&this.value.indexOf(decimal)!=-1){allow=false}if(key!=8&&key!=9&&key!=13&&key!=35&&key!=36&&key!=37&&key!=39&&key!=46){allow=false}else{if(typeof e.charCode!="undefined"){if(e.keyCode==e.which&&e.which!=0){allow=true}else{if(e.keyCode!=0&&e.charCode==0&&e.which==0){allow=true}}}}if(key==decimal.charCodeAt(0)&&this.value.indexOf(decimal)==-1){allow=true}}else{allow=true}return allow}).blur(function(){var val=jQuery(this).val();if(val!=""){var re=new RegExp("^\\d+$|\\d*"+decimal+"\\d+");if(!re.exec(val)){callback.apply(this)}}});return this};/*
 * jQuery postMessage - v0.5 - 9/11/2009
 * http://benalman.com/projects/jquery-postmessage-plugin/
 *
 * Copyright (c) 2009 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($){var interval_id,last_hash,cache_bust=1,rm_callback,window=this,FALSE=!1,postMessage="postMessage",addEventListener="addEventListener",p_receiveMessage,has_postMessage=window[postMessage]&&!$.browser.opera;$.postMessage=function(message,target_url,target){if(!target_url){return}message=typeof message==="string"?message:$.param(message);target=target||parent;if(has_postMessage){target[postMessage](message,target_url.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))}else{if(target_url){target.location=target_url.replace(/#.*$/,"")+"#"+(+new Date)+(cache_bust++)+"&"+message}}};$.receiveMessage=p_receiveMessage=function(callback,source_origin,delay){if(has_postMessage){if(callback){rm_callback&&p_receiveMessage();rm_callback=function(e){if((typeof source_origin==="string"&&e.origin!==source_origin)||($.isFunction(source_origin)&&source_origin(e.origin)===FALSE)){return FALSE}callback(e)}}if(window[addEventListener]){window[callback?addEventListener:"removeEventListener"]("message",rm_callback,FALSE)}else{window[callback?"attachEvent":"detachEvent"]("onmessage",rm_callback)}}else{interval_id&&clearInterval(interval_id);interval_id=null;if(callback){delay=typeof source_origin==="number"?source_origin:typeof delay==="number"?delay:100;interval_id=setInterval(function(){var hash=document.location.hash,re=/^#?\d+&/;if(hash!==last_hash&&re.test(hash)){last_hash=hash;callback({data:hash.replace(re,"")})}},delay)}}}})(jQuery);(function($){$.fn.raty=function(settings){options=$.extend({},$.fn.raty.defaults,settings);if(this.attr("id")===undefined){debug("Invalid selector!");return}$this=$(this);if(options.number>20){options.number=20}if(options.path.substring(options.path.length-1,options.path.length)!="/"){options.path+="/"}var containerId=$this.attr("id"),path=options.path,cancelOff=options.cancelOff,cancelOn=options.cancelOn,showHalf=options.showHalf,starHalf=options.starHalf,starOff=options.starOff,starOn=options.starOn,starHover=options.starHover,onClick=options.onClick,start=0,hint="";if(!isNaN(options.start)&&options.start>0){start=(options.start>options.number)?options.number:options.start}for(var i=1;i<=options.number;i++){hint=(options.number<=options.hintList.length&&options.hintList[i-1]!==null)?options.hintList[i-1]:i;starFile=(start>=i)?starOn:starOff;$this.append('<img id="'+containerId+"-"+i+'" src="'+path+starFile+'" alt="'+i+'" title="'+hint+'" class="'+containerId+'"/>').append((i<options.number)?"&nbsp;":"")}$this.append('<input id="'+containerId+'-score" type="hidden" name="'+options.scoreName+'"/>');$("#"+containerId+"-score").val(start);if(showHalf){var score=$("input#"+containerId+"-score").val(),rounded=Math.ceil(score),diff=(rounded-score).toFixed(1);if(diff>=0.3&&diff<=0.7){rounded=rounded-0.5;$("img#"+containerId+"-"+Math.ceil(rounded)).attr("src",path+starHalf)}else{if(diff>=0.8){rounded--}else{$("img#"+containerId+"-"+rounded).attr("src",path+starOn)}}}if(!options.readOnly){if(options.showCancel){var cancel='<img src="'+path+options.cancelOff+'" alt="x" title="'+options.cancelHint+'" class="button-cancel"/>';if(options.cancelPlace=="left"){$this.prepend(cancel+"&nbsp;")}else{$this.append("&nbsp;").append(cancel)}$this.css("width",options.number*20+20);$("#"+containerId+" img.button-cancel").bind("mouseenter",function(){$(this).attr("src",path+cancelOn);$("img."+containerId).attr("src",path+starOff)}).bind("mouseleave",function(){$(this).attr("src",path+cancelOff);$("img."+containerId).trigger("mouseout")}).bind("click",function(){$("input#"+containerId+"-score").val(0);if(onClick){onClick(0)}})}else{$this.css("width",options.number*20)}$("img."+containerId).bind("mouseenter",function(){var qtyStar=$("img."+containerId).length;for(var i=1;i<=qtyStar;i++){if(i<=this.alt){$("img#"+containerId+"-"+i).attr("src",path+starHover)}else{$("img#"+containerId+"-"+i).attr("src",path+starOff)}}}).bind("click",function(){$("input#"+containerId+"-score").val(this.alt);if(onClick){onClick(this.alt)}});$this.bind("mouseleave",function(){var id=$(this).attr("id"),qtyStar=$("img."+id).length,score=$("input#"+id+"-score").val();for(var i=1;i<=qtyStar;i++){if(i<=score){$("img#"+id+"-"+i).attr("src",path+starOn)}else{$("img#"+id+"-"+i).attr("src",path+starOff)}}if(showHalf){var score=$("input#"+id+"-score").val(),rounded=Math.ceil(score),diff=(rounded-score).toFixed(1);if(diff>=0.3&&diff<=0.7){rounded=rounded-0.5;$("img#"+id+"-"+Math.ceil(rounded)).attr("src",path+starHalf)}else{if(diff>=0.8){rounded--}else{$("img#"+id+"-"+rounded).attr("src",path+starOn)}}}}).css("cursor","pointer")}else{$this.css("cursor","default")}return $this};$.fn.raty.defaults={cancelHint:"cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",hintList:["bad","poor","regular","good","gorgeous"],number:5,path:"img/",readOnly:false,scoreName:"score",showCancel:false,showHalf:false,starHalf:"star-half.png",start:0,starOff:"star-off.png",starOn:"star-on.png",starHover:"star-hover.png"};$.fn.raty.readOnly=function(boo){if(boo){$("img."+$this.attr("id")).die();$this.css("cursor","default").die()}else{liveEnter();liveLeave();liveClick();$this.css("cursor","pointer")}return $.fn.raty};$.fn.raty.start=function(start){initialize(start);return $.fn.raty};$.fn.raty.click=function(score){var star=(score>=options.number)?options.number:score;initialize(star);if(options.onClick){options.onClick(star)}else{debug('You should add the "onClick: function() {}" option.')}return $.fn.raty};function liveEnter(){var id=$this.attr("id");$("img."+id).bind("mouseenter",function(){var qtyStar=$("img."+id).length;for(var i=1;i<=qtyStar;i++){if(i<=this.alt){$("img#"+id+"-"+i).attr("src",options.path+options.starOn)}else{$("img#"+id+"-"+i).attr("src",options.path+options.starOff)}}})}function liveLeave(){$this.bind("mouseleave",function(){var id=$(this).attr("id");var qtyStar=$("img."+id).length;var score=$("input#"+id+"-score").val();for(var i=1;i<=qtyStar;i++){if(i<=score){$("img#"+id+"-"+i).attr("src",options.path+options.starOn)}else{$("img#"+id+"-"+i).attr("src",options.path+options.starOff)}}})}function liveClick(){var id=$this.attr("id");$("img."+id).bind("click",function(){$("input#"+id+"-score").val(this.alt)})}function initialize(start){var id=$this.attr("id"),qtyStar=$("img."+id).length;$("input#"+id+"-score").val(start);for(var i=1;i<=qtyStar;i++){if(i<=start){$("img#"+id+"-"+i).attr("src",options.path+options.starOn)}else{$("img#"+id+"-"+i).attr("src",options.path+options.starOff)}}}function debug(message){if(window.console&&window.console.log){window.console.log(message)}}})(jQuery);(function(){jQuery.parseUri=function(str,options){var settings=jQuery.extend({strictMode:false},options);var o=jQuery.parseUri.options;var m=o.parser[settings.strictMode?"strict":"loose"].exec(str);var uri={};var i=14;while(i--){uri[o.key[i]]=m[i]||""}uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){if($1){uri[o.q.name][$1]=$2}});return uri};jQuery.parseUri.options={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}}})();jQuery.tableDnD={currentTable:null,dragObject:null,mouseOffset:null,oldY:0,build:function(options){this.each(function(){this.tableDnDConfig=jQuery.extend({onDragStyle:null,onDropStyle:null,onDragClass:"tDnD_whileDrag",onDrop:null,onDragStart:null,scrollAmount:5,serializeRegexp:/[^\-]*$/,serializeParamName:null,dragHandle:null},options||{});jQuery.tableDnD.makeDraggable(this)});jQuery(document).bind("mousemove",jQuery.tableDnD.mousemove).bind("mouseup",jQuery.tableDnD.mouseup);return this},makeDraggable:function(table){var config=table.tableDnDConfig;if(table.tableDnDConfig.dragHandle){var cells=jQuery("td."+table.tableDnDConfig.dragHandle,table);cells.each(function(){jQuery(this).mousedown(function(ev){jQuery.tableDnD.dragObject=this.parentNode;jQuery.tableDnD.currentTable=table;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,ev);if(config.onDragStart){config.onDragStart(table,this)}return false})})}else{var rows=jQuery("tr",table);rows.each(function(){var row=jQuery(this);if(!row.hasClass("nodrag")){row.mousedown(function(ev){if(ev.target.tagName=="TD"){jQuery.tableDnD.dragObject=this;jQuery.tableDnD.currentTable=table;jQuery.tableDnD.mouseOffset=jQuery.tableDnD.getMouseOffset(this,ev);if(config.onDragStart){config.onDragStart(table,this)}return false}}).css("cursor","move")}})}},updateTables:function(){this.each(function(){if(this.tableDnDConfig){jQuery.tableDnD.makeDraggable(this)}})},mouseCoords:function(ev){if(ev.pageX||ev.pageY){return{x:ev.pageX,y:ev.pageY}}return{x:ev.clientX+document.body.scrollLeft-document.body.clientLeft,y:ev.clientY+document.body.scrollTop-document.body.clientTop}},getMouseOffset:function(target,ev){ev=ev||window.event;var docPos=this.getPosition(target);var mousePos=this.mouseCoords(ev);return{x:mousePos.x-docPos.x,y:mousePos.y-docPos.y}},getPosition:function(e){var left=0;var top=0;if(e.offsetHeight==0){e=e.firstChild}while(e.offsetParent){left+=e.offsetLeft;top+=e.offsetTop;e=e.offsetParent}left+=e.offsetLeft;top+=e.offsetTop;return{x:left,y:top}},mousemove:function(ev){if(jQuery.tableDnD.dragObject==null){return}var dragObj=jQuery(jQuery.tableDnD.dragObject);var config=jQuery.tableDnD.currentTable.tableDnDConfig;var mousePos=jQuery.tableDnD.mouseCoords(ev);var y=mousePos.y-jQuery.tableDnD.mouseOffset.y;var yOffset=window.pageYOffset;if(document.all){if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat"){yOffset=document.documentElement.scrollTop}else{if(typeof document.body!="undefined"){yOffset=document.body.scrollTop}}}if(mousePos.y-yOffset<config.scrollAmount){window.scrollBy(0,-config.scrollAmount)}else{var windowHeight=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;if(windowHeight-(mousePos.y-yOffset)<config.scrollAmount){window.scrollBy(0,config.scrollAmount)}}if(y!=jQuery.tableDnD.oldY){var movingDown=y>jQuery.tableDnD.oldY;jQuery.tableDnD.oldY=y;if(config.onDragClass){dragObj.addClass(config.onDragClass)}else{dragObj.css(config.onDragStyle)}var currentRow=jQuery.tableDnD.findDropTargetRow(dragObj,y);if(currentRow){if(movingDown&&jQuery.tableDnD.dragObject!=currentRow){jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,currentRow.nextSibling)}else{if(!movingDown&&jQuery.tableDnD.dragObject!=currentRow){jQuery.tableDnD.dragObject.parentNode.insertBefore(jQuery.tableDnD.dragObject,currentRow)}}}}return false},findDropTargetRow:function(draggedRow,y){var rows=jQuery.tableDnD.currentTable.rows;for(var i=0;i<rows.length;i++){var row=rows[i];var rowY=this.getPosition(row).y;var rowHeight=parseInt(row.offsetHeight)/2;if(row.offsetHeight==0){rowY=this.getPosition(row.firstChild).y;rowHeight=parseInt(row.firstChild.offsetHeight)/2}if((y>rowY-rowHeight)&&(y<(rowY+rowHeight))){if(row==draggedRow){return null}var config=jQuery.tableDnD.currentTable.tableDnDConfig;if(config.onAllowDrop){if(config.onAllowDrop(draggedRow,row)){return row}else{return null}}else{var nodrop=jQuery(row).hasClass("nodrop");if(!nodrop){return row}else{return null}}return row}}return null},mouseup:function(e){if(jQuery.tableDnD.currentTable&&jQuery.tableDnD.dragObject){var droppedRow=jQuery.tableDnD.dragObject;var config=jQuery.tableDnD.currentTable.tableDnDConfig;if(config.onDragClass){jQuery(droppedRow).removeClass(config.onDragClass)}else{jQuery(droppedRow).css(config.onDropStyle)}jQuery.tableDnD.dragObject=null;if(config.onDrop){config.onDrop(jQuery.tableDnD.currentTable,droppedRow)}jQuery.tableDnD.currentTable=null}},serialize:function(){if(jQuery.tableDnD.currentTable){return jQuery.tableDnD.serializeTable(jQuery.tableDnD.currentTable)}else{return"Error: No Table id set, you need to set an id on your table and every row"}},serializeTable:function(table){var result="";var tableId=table.id;var rows=table.rows;for(var i=0;i<rows.length;i++){if(result.length>0){result+="&"}var rowId=rows[i].id;if(rowId&&rowId&&table.tableDnDConfig&&table.tableDnDConfig.serializeRegexp){rowId=rowId.match(table.tableDnDConfig.serializeRegexp)[0]}result+=tableId+"[]="+rowId}return result},serializeTables:function(){var result="";this.each(function(){result+=jQuery.tableDnD.serializeTable(this)});return result}};jQuery.fn.extend({tableDnD:jQuery.tableDnD.build,tableDnDUpdate:jQuery.tableDnD.updateTables,tableDnDSerialize:jQuery.tableDnD.serializeTables});(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var validator=$.data(this[0],"validator");if(validator){return validator}validator=new $.validator(options,this[0]);$.data(this[0],"validator",validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true});this.submit(function(event){if(validator.settings.debug){event.preventDefault()}function handle(){if(validator.settings.submitHandler){validator.settings.submitHandler.call(validator,validator.currentForm);return false}return true}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle()}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false}return handle()}else{validator.focusInvalid();return false}})}return validator},valid:function(){if($(this[0]).is("form")){return this.validate().form()}else{var valid=false;var validator=$(this[0].form).validate();this.each(function(){valid|=validator.element(this)});return valid}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value)});return result},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,"validator").settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages){settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages)}break;case"remove":if(!argument){delete staticRules[element.name];return existingRules}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method]});return filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data)}return data}});$.extend($.expr[":"],{blank:function(a){return !$.trim(a.value)},filled:function(a){return !!$.trim(a.value)},unchecked:function(a){return !a.checked}});$.format=function(source,params){if(arguments.length==1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.format.apply(this,args)}}if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1)}if(params.constructor!=Array){params=[params]}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)});return source};$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init()};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass);this.errorsFor(element).hide()}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element)}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element)}},onclick:function(element){if(element.name in this.submitted){this.element(element)}},highlight:function(element,errorClass){$(element).addClass(errorClass)},unhighlight:function(element,errorClass){$(element).removeClass(errorClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"Detta f?lt ?r obligatoriskt.",remote:"?tg?rda detta omr?de.",email:"Du m?ste ange en giltig emailadress",url:"Ange en giltig webbadress.",date:"Ange ett giltigt datum.",dateISO:"Ange ett giltigt datum (ISO).",dateDE:"Bitte geben Sie ein g?ltiges Datum ein.",number:"Ange ett giltigt nummer.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Ange endast siffror",creditcard:"Ange ett giltigt kreditkortsnummer.",equalTo:"Fyll i samma v?rde igen.",accept:"Please enter a value with a valid extension.",maxlength:$.format("Fyll inte mer ?n {0} tecken."),minlength:$.format("Ange minst {0} tecken."),rangelength:$.format("Ange ett v?rde mellan {0} och {1} tecken."),range:$.format("Ange ett v?rde mellan {0} och {1}."),max:$.format("Ange ett v?rde mindre ?n eller lika med {0}."),min:$.format("Ange ett v?rde st?rre ?n eller lika med {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0])}$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler){$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()){$(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i])}return this.valid()},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name]}else{this.invalid[element.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]})}this.successList=$.grep(this.successList,function(element){return !(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0;for(var i in obj){count++}return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name}).length==1&&lastActive},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules())){return false}rulesCache[this.name]=true;return true})},clean:function(selector){return $(selector)[0]},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element)},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0]}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return}if(!result){this.formatAndAdd(element,rule);return false}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method");throw e}}if(dependencyMismatch){return}if(this.objectLength(rules)){this.successList.push(element)}return true},customMetaMessage:function(element,method){if(!$.metadata){return}var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined){return arguments[i]}}return undefined},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function"){message=message.call(this,rule.parameters,element)}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parents(this.settings.wrapper))}return toToggle},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass);this.showLabel(error.element,error.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i])}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message)}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(label).length){this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element)}}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label)}this.toShow=this.toShow.add(label)},errorsFor:function(element){return this.errors().filter("[for='"+this.idOrName(element)+"']")},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},checkable:function(element){return/radio|checkbox/i.test(element.type)},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null})},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length}}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return !!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){return !$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch"},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit()}else{if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},classRules:function(element){var rules={};var classes=$(element).attr("class");classes&&$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this])}});return rules},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength}return rules},metadataRules:function(element){if(!$.metadata){return{}}var meta=$.data(element.form,"validator").settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={};var validator=$.data(element.form,"validator");if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}}return rules},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break}if(keepRule){rules[prop]=val.param!==undefined?val.param:true}else{delete rules[prop]}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter});$.each(["minlength","maxlength","min","max"],function(){if(rules[this]){rules[this]=Number(rules[this])}});$.each(["rangelength","range"],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])]}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength}}if(rules.messages){delete rules.messages}return rules},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true});data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message;if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name))}},methods:{required:function(value,element,param){if(!this.depend(param,element)){return"dependency-mismatch"}switch(element.nodeName.toLowerCase()){case"select":var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes.value.specified)?options[0].text:options[0].value).length>0);case"input":if(this.checkable(element)){return this.getLength(value,element)>0}default:return $.trim(value).length>0}},remote:function(value,element,param){if(this.optional(element)){return"dependency-mismatch"}var previous=this.previousValue(element);if(!this.settings.messages[element.name]){this.settings.messages[element.name]={}}this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){if(response){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors()}else{var errors={};errors[element.name]=response||validator.defaultMessage(element,"remote");validator.showErrors(errors)}previous.valid=response;validator.stopRequest(element,response)}},param));return"pending"}else{if(this.pending[element.name]){return"pending"}}return previous.valid},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1])},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||value<=param},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1])},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value))},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value)},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value)},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element)){return"dependency-mismatch"}if(/[^0-9-]+/.test(value)){return false}var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9){nDigit-=9}}nCheck+=nDigit;bEven=!bEven}return(nCheck%10)==0},accept:function(value,element,param){param=typeof param=="string"?param:"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"))},equalTo:function(value,element,param){return value==$(param).val()}}})})(jQuery);(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort()}return(pendingRequests[port]=ajax.apply(this,arguments))}return ajax.apply(this,arguments)}})(jQuery);(function($){$.each({focus:"focusin",blur:"focusout"},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie){return false}this.addEventListener(original,$.event.special[fix].handler,true)},teardown:function(){if($.browser.msie){return false}this.removeEventListener(original,$.event.special[fix].handler,true)},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments)}}});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments)}})},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})])}})})(jQuery);/*
 * Raphael 1.4.7 - JavaScript Vector Library
 *
 * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
 * Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
 */
Raphael=(function(){function R(){if(R.is(arguments[0],array)){var a=arguments[0],cnv=create[apply](R,a.splice(0,3+R.is(a[0],nu))),res=cnv.set();for(var i=0,ii=a[length];i<ii;i++){var j=a[i]||{};elements.test(j.type)&&res[push](cnv[j.type]().attr(j))}return res}return create[apply](R,arguments)}R.version="1.4.7";var separator=/[, ]+/,elements=/^(circle|rect|path|ellipse|text|image)$/,proto="prototype",has="hasOwnProperty",doc=document,win=window,oldRaphael={was:Object[proto][has].call(win,"Raphael"),is:win.Raphael},Paper=function(){},appendChild="appendChild",apply="apply",concat="concat",supportsTouch="createTouch" in doc,E="",S=" ",Str=String,split="split",events="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend"[split](S),touchMap={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},join="join",length="length",lowerCase=String[proto].toLowerCase,math=Math,mmax=math.max,mmin=math.min,nu="number",string="string",array="array",toString="toString",fillString="fill",objectToString=Object[proto][toString],paper={},pow=math.pow,push="push",rg=/^(?=[\da-f]$)/,ISURL=/^url\(['"]?([^\)]+?)['"]?\)$/i,colourRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+(?:\s*,\s*[\d\.]+)?)\s*\)|rgba?\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%(?:\s*,\s*[\d\.]+%)?)\s*\)|hsb\(\s*([\d\.]+(?:deg|\xb0)?\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hsb\(\s*([\d\.]+(?:deg|\xb0|%)\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hsl\(\s*([\d\.]+(?:deg|\xb0)?\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hsl\(\s*([\d\.]+(?:deg|\xb0|%)\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i,round=math.round,setAttribute="setAttribute",toFloat=parseFloat,toInt=parseInt,ms=" progid:DXImageTransform.Microsoft",upperCase=String[proto].toUpperCase,availableAttrs={blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},availableAnimAttrs={along:"along",blur:nu,"clip-rect":"csv",cx:nu,cy:nu,fill:"colour","fill-opacity":nu,"font-size":nu,height:nu,opacity:nu,path:"path",r:nu,rotation:"csv",rx:nu,ry:nu,scale:"csv",stroke:"colour","stroke-opacity":nu,"stroke-width":nu,translation:"csv",width:nu,x:nu,y:nu},rp="replace";R.type=(win.SVGAngle||doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML");if(R.type=="VML"){var d=doc.createElement("div"),b;d.innerHTML='<v:shape adj="1"/>';b=d.firstChild;b.style.behavior="url(#default#VML)";if(!(b&&typeof b.adj=="object")){return R.type=null}d=null}R.svg=!(R.vml=R.type=="VML");Paper[proto]=R[proto];R._id=0;R._oid=0;R.fn={};R.is=function(o,type){type=lowerCase.call(type);return(type=="object"&&o===Object(o))||(type=="undefined"&&typeof o==type)||(type=="null"&&o==null)||(type=="array"&&Array.isArray&&Array.isArray(o))||lowerCase.call(objectToString.call(o).slice(8,-1))==type};R.setWindow=function(newwin){win=newwin;doc=win.document};var toHex=function(color){if(R.vml){var trim=/^\s+|\s+$/g;toHex=cacher(function(color){var bod;color=Str(color)[rp](trim,E);try{var docum=new win.ActiveXObject("htmlfile");docum.write("<body>");docum.close();bod=docum.body}catch(e){bod=win.createPopup().document.body}var range=bod.createTextRange();try{bod.style.color=color;var value=range.queryCommandValue("ForeColor");value=((value&255)<<16)|(value&65280)|((value&16711680)>>>16);return"#"+("000000"+value[toString](16)).slice(-6)}catch(e){return"none"}})}else{var i=doc.createElement("i");i.title="Rapha\xebl Colour Picker";i.style.display="none";doc.body[appendChild](i);toHex=cacher(function(color){i.style.color=color;return doc.defaultView.getComputedStyle(i,E).getPropertyValue("color")})}return toHex(color)},hsbtoString=function(){return"hsb("+[this.h,this.s,this.b]+")"},hsltoString=function(){return"hsl("+[this.h,this.s,this.l]+")"},rgbtoString=function(){return this.hex};R.hsb2rgb=function(h,s,b){if(R.is(h,"object")&&"h" in h&&"s" in h&&"b" in h){b=h.b;s=h.s;h=h.h}return R.hsl2rgb(h,s,b/2)};R.hsl2rgb=function(h,s,l){if(R.is(h,"object")&&"h" in h&&"s" in h&&"l" in h){l=h.l;s=h.s;h=h.h}var rgb={},channels=["r","g","b"],t2,t1,t3,r,g,b;if(!s){rgb={r:l,g:l,b:l}}else{if(l<0.5){t2=l*(1+s)}else{t2=l+s-l*s}t1=2*l-t2;for(var i=0,ii=channels.length;i<ii;i++){t3=h+1/3*-(i-1);t3<0&&t3++;t3>1&&t3--;if(t3*6<1){rgb[channels[i]]=t1+(t2-t1)*6*t3}else{if(t3*2<1){rgb[channels[i]]=t2}else{if(t3*3<2){rgb[channels[i]]=t1+(t2-t1)*(2/3-t3)*6}else{rgb[channels[i]]=t1}}}}}rgb.r*=255;rgb.g*=255;rgb.b*=255;r=(~~rgb.r)[toString](16);g=(~~rgb.g)[toString](16);b=(~~rgb.b)[toString](16);r=r[rp](rg,"0");g=g[rp](rg,"0");b=b[rp](rg,"0");rgb.hex="#"+r+g+b;rgb.toString=rgbtoString;return rgb};R.rgb2hsb=function(red,green,blue){if(green==null&&R.is(red,"object")&&"r" in red&&"g" in red&&"b" in red){blue=red.b;green=red.g;red=red.r}if(green==null&&R.is(red,string)){var clr=R.getRGB(red);red=clr.r;green=clr.g;blue=clr.b}if(red>1||green>1||blue>1){red/=255;green/=255;blue/=255}var max=mmax(red,green,blue),min=mmin(red,green,blue),hue,saturation,brightness=max;if(min==max){return{h:0,s:0,b:max,toString:hsbtoString}}else{var delta=(max-min);saturation=delta/max;if(red==max){hue=(green-blue)/delta}else{if(green==max){hue=2+((blue-red)/delta)}else{hue=4+((red-green)/delta)}}hue/=6;hue<0&&hue++;hue>1&&hue--}return{h:hue,s:saturation,b:brightness,toString:hsbtoString}};R.rgb2hsl=function(red,green,blue){if(green==null&&R.is(red,"object")&&"r" in red&&"g" in red&&"b" in red){blue=red.b;green=red.g;red=red.r}if(green==null&&R.is(red,string)){var clr=R.getRGB(red);red=clr.r;green=clr.g;blue=clr.b}if(red>1||green>1||blue>1){red/=255;green/=255;blue/=255}var max=mmax(red,green,blue),min=mmin(red,green,blue),h,s,l=(max+min)/2,hsl;if(min==max){hsl={h:0,s:0,l:l}}else{var delta=max-min;s=l<0.5?delta/(max+min):delta/(2-max-min);if(red==max){h=(green-blue)/delta}else{if(green==max){h=2+(blue-red)/delta}else{h=4+(red-green)/delta}}h/=6;h<0&&h++;h>1&&h--;hsl={h:h,s:s,l:l}}hsl.toString=hsltoString;return hsl};var p2s=/,?([achlmqrstvxz]),?/gi,commaSpaces=/\s*,\s*/,hsrg={hs:1,rg:1};R._path2string=function(){return this.join(",")[rp](p2s,"$1")};function cacher(f,scope,postprocessor){function newf(){var arg=Array[proto].slice.call(arguments,0),args=arg[join]("\u25ba"),cache=newf.cache=newf.cache||{},count=newf.count=newf.count||[];if(cache[has](args)){return postprocessor?postprocessor(cache[args]):cache[args]}count[length]>=1000&&delete cache[count.shift()];count[push](args);cache[args]=f[apply](scope,arg);return postprocessor?postprocessor(cache[args]):cache[args]}return newf}R.getRGB=cacher(function(colour){if(!colour||!!((colour=Str(colour)).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1}}if(colour=="none"){return{r:-1,g:-1,b:-1,hex:"none"}}!(hsrg[has](colour.substring(0,2))||colour.charAt()=="#")&&(colour=toHex(colour));var res,red,green,blue,opacity,t,rgb=colour.match(colourRegExp);if(rgb){if(rgb[2]){blue=toInt(rgb[2].substring(5),16);green=toInt(rgb[2].substring(3,5),16);red=toInt(rgb[2].substring(1,3),16)}if(rgb[3]){blue=toInt((t=rgb[3].charAt(3))+t,16);green=toInt((t=rgb[3].charAt(2))+t,16);red=toInt((t=rgb[3].charAt(1))+t,16)}if(rgb[4]){rgb=rgb[4][split](commaSpaces);red=toFloat(rgb[0]);green=toFloat(rgb[1]);blue=toFloat(rgb[2]);opacity=toFloat(rgb[3])}if(rgb[5]){rgb=rgb[5][split](commaSpaces);red=toFloat(rgb[0])*2.55;green=toFloat(rgb[1])*2.55;blue=toFloat(rgb[2])*2.55;opacity=toFloat(rgb[3])}if(rgb[6]){rgb=rgb[6][split](commaSpaces);red=toFloat(rgb[0]);green=toFloat(rgb[1]);blue=toFloat(rgb[2]);(rgb[0].slice(-3)=="deg"||rgb[0].slice(-1)=="\xb0")&&(red/=360);return R.hsb2rgb(red,green,blue)}if(rgb[7]){rgb=rgb[7][split](commaSpaces);red=toFloat(rgb[0])*2.55;green=toFloat(rgb[1])*2.55;blue=toFloat(rgb[2])*2.55;(rgb[0].slice(-3)=="deg"||rgb[0].slice(-1)=="\xb0")&&(red/=360*2.55);return R.hsb2rgb(red,green,blue)}if(rgb[8]){rgb=rgb[8][split](commaSpaces);red=toFloat(rgb[0]);green=toFloat(rgb[1]);blue=toFloat(rgb[2]);(rgb[0].slice(-3)=="deg"||rgb[0].slice(-1)=="\xb0")&&(red/=360);return R.hsl2rgb(red,green,blue)}if(rgb[9]){rgb=rgb[9][split](commaSpaces);red=toFloat(rgb[0])*2.55;green=toFloat(rgb[1])*2.55;blue=toFloat(rgb[2])*2.55;(rgb[0].slice(-3)=="deg"||rgb[0].slice(-1)=="\xb0")&&(red/=360*2.55);return R.hsl2rgb(red,green,blue)}rgb={r:red,g:green,b:blue};var r=(~~red)[toString](16),g=(~~green)[toString](16),b=(~~blue)[toString](16);r=r[rp](rg,"0");g=g[rp](rg,"0");b=b[rp](rg,"0");rgb.hex="#"+r+g+b;isFinite(toFloat(opacity))&&(rgb.o=opacity);return rgb}return{r:-1,g:-1,b:-1,hex:"none",error:1}},R);R.getColor=function(value){var start=this.getColor.start=this.getColor.start||{h:0,s:1,b:value||0.75},rgb=this.hsb2rgb(start.h,start.s,start.b);start.h+=0.075;if(start.h>1){start.h=0;start.s-=0.2;start.s<=0&&(this.getColor.start={h:0,s:1,b:start.b})}return rgb.hex};R.getColor.reset=function(){delete this.start};var pathCommand=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,pathValues=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig;R.parsePathString=cacher(function(pathString){if(!pathString){return null}var paramCounts={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},data=[];if(R.is(pathString,array)&&R.is(pathString[0],array)){data=pathClone(pathString)}if(!data[length]){Str(pathString)[rp](pathCommand,function(a,b,c){var params=[],name=lowerCase.call(b);c[rp](pathValues,function(a,b){b&&params[push](+b)});if(name=="m"&&params[length]>2){data[push]([b][concat](params.splice(0,2)));name="l";b=b=="m"?"l":"L"}while(params[length]>=paramCounts[name]){data[push]([b][concat](params.splice(0,paramCounts[name])));if(!paramCounts[name]){break}}})}data[toString]=R._path2string;return data});R.findDotsAtSegment=function(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,t){var t1=1-t,x=pow(t1,3)*p1x+pow(t1,2)*3*t*c1x+t1*3*t*t*c2x+pow(t,3)*p2x,y=pow(t1,3)*p1y+pow(t1,2)*3*t*c1y+t1*3*t*t*c2y+pow(t,3)*p2y,mx=p1x+2*t*(c1x-p1x)+t*t*(c2x-2*c1x+p1x),my=p1y+2*t*(c1y-p1y)+t*t*(c2y-2*c1y+p1y),nx=c1x+2*t*(c2x-c1x)+t*t*(p2x-2*c2x+c1x),ny=c1y+2*t*(c2y-c1y)+t*t*(p2y-2*c2y+c1y),ax=(1-t)*p1x+t*c1x,ay=(1-t)*p1y+t*c1y,cx=(1-t)*c2x+t*p2x,cy=(1-t)*c2y+t*p2y,alpha=(90-math.atan((mx-nx)/(my-ny))*180/math.PI);(mx>nx||my<ny)&&(alpha+=180);return{x:x,y:y,m:{x:mx,y:my},n:{x:nx,y:ny},start:{x:ax,y:ay},end:{x:cx,y:cy},alpha:alpha}};var pathDimensions=cacher(function(path){if(!path){return{x:0,y:0,width:0,height:0}}path=path2curve(path);var x=0,y=0,X=[],Y=[],p;for(var i=0,ii=path[length];i<ii;i++){p=path[i];if(p[0]=="M"){x=p[1];y=p[2];X[push](x);Y[push](y)}else{var dim=curveDim(x,y,p[1],p[2],p[3],p[4],p[5],p[6]);X=X[concat](dim.min.x,dim.max.x);Y=Y[concat](dim.min.y,dim.max.y);x=p[5];y=p[6]}}var xmin=mmin[apply](0,X),ymin=mmin[apply](0,Y);return{x:xmin,y:ymin,width:mmax[apply](0,X)-xmin,height:mmax[apply](0,Y)-ymin}}),pathClone=function(pathArray){var res=[];if(!R.is(pathArray,array)||!R.is(pathArray&&pathArray[0],array)){pathArray=R.parsePathString(pathArray)}for(var i=0,ii=pathArray[length];i<ii;i++){res[i]=[];for(var j=0,jj=pathArray[i][length];j<jj;j++){res[i][j]=pathArray[i][j]}}res[toString]=R._path2string;return res},pathToRelative=cacher(function(pathArray){if(!R.is(pathArray,array)||!R.is(pathArray&&pathArray[0],array)){pathArray=R.parsePathString(pathArray)}var res=[],x=0,y=0,mx=0,my=0,start=0;if(pathArray[0][0]=="M"){x=pathArray[0][1];y=pathArray[0][2];mx=x;my=y;start++;res[push](["M",x,y])}for(var i=start,ii=pathArray[length];i<ii;i++){var r=res[i]=[],pa=pathArray[i];if(pa[0]!=lowerCase.call(pa[0])){r[0]=lowerCase.call(pa[0]);switch(r[0]){case"a":r[1]=pa[1];r[2]=pa[2];r[3]=pa[3];r[4]=pa[4];r[5]=pa[5];r[6]=+(pa[6]-x).toFixed(3);r[7]=+(pa[7]-y).toFixed(3);break;case"v":r[1]=+(pa[1]-y).toFixed(3);break;case"m":mx=pa[1];my=pa[2];default:for(var j=1,jj=pa[length];j<jj;j++){r[j]=+(pa[j]-((j%2)?x:y)).toFixed(3)}}}else{r=res[i]=[];if(pa[0]=="m"){mx=pa[1]+x;my=pa[2]+y}for(var k=0,kk=pa[length];k<kk;k++){res[i][k]=pa[k]}}var len=res[i][length];switch(res[i][0]){case"z":x=mx;y=my;break;case"h":x+=+res[i][len-1];break;case"v":y+=+res[i][len-1];break;default:x+=+res[i][len-2];y+=+res[i][len-1]}}res[toString]=R._path2string;return res},0,pathClone),pathToAbsolute=cacher(function(pathArray){if(!R.is(pathArray,array)||!R.is(pathArray&&pathArray[0],array)){pathArray=R.parsePathString(pathArray)}var res=[],x=0,y=0,mx=0,my=0,start=0;if(pathArray[0][0]=="M"){x=+pathArray[0][1];y=+pathArray[0][2];mx=x;my=y;start++;res[0]=["M",x,y]}for(var i=start,ii=pathArray[length];i<ii;i++){var r=res[i]=[],pa=pathArray[i];if(pa[0]!=upperCase.call(pa[0])){r[0]=upperCase.call(pa[0]);switch(r[0]){case"A":r[1]=pa[1];r[2]=pa[2];r[3]=pa[3];r[4]=pa[4];r[5]=pa[5];r[6]=+(pa[6]+x);r[7]=+(pa[7]+y);break;case"V":r[1]=+pa[1]+y;break;case"H":r[1]=+pa[1]+x;break;case"M":mx=+pa[1]+x;my=+pa[2]+y;default:for(var j=1,jj=pa[length];j<jj;j++){r[j]=+pa[j]+((j%2)?x:y)}}}else{for(var k=0,kk=pa[length];k<kk;k++){res[i][k]=pa[k]}}switch(r[0]){case"Z":x=mx;y=my;break;case"H":x=r[1];break;case"V":y=r[1];break;case"M":mx=res[i][res[i][length]-2];my=res[i][res[i][length]-1];default:x=res[i][res[i][length]-2];y=res[i][res[i][length]-1]}}res[toString]=R._path2string;return res},null,pathClone),l2c=function(x1,y1,x2,y2){return[x1,y1,x2,y2,x2,y2]},q2c=function(x1,y1,ax,ay,x2,y2){var _13=1/3,_23=2/3;return[_13*x1+_23*ax,_13*y1+_23*ay,_13*x2+_23*ax,_13*y2+_23*ay,x2,y2]},a2c=function(x1,y1,rx,ry,angle,large_arc_flag,sweep_flag,x2,y2,recursive){var PI=math.PI,_120=PI*120/180,rad=PI/180*(+angle||0),res=[],xy,rotate=cacher(function(x,y,rad){var X=x*math.cos(rad)-y*math.sin(rad),Y=x*math.sin(rad)+y*math.cos(rad);return{x:X,y:Y}});if(!recursive){xy=rotate(x1,y1,-rad);x1=xy.x;y1=xy.y;xy=rotate(x2,y2,-rad);x2=xy.x;y2=xy.y;var cos=math.cos(PI/180*angle),sin=math.sin(PI/180*angle),x=(x1-x2)/2,y=(y1-y2)/2;var h=(x*x)/(rx*rx)+(y*y)/(ry*ry);if(h>1){h=math.sqrt(h);rx=h*rx;ry=h*ry}var rx2=rx*rx,ry2=ry*ry,k=(large_arc_flag==sweep_flag?-1:1)*math.sqrt(math.abs((rx2*ry2-rx2*y*y-ry2*x*x)/(rx2*y*y+ry2*x*x))),cx=k*rx*y/ry+(x1+x2)/2,cy=k*-ry*x/rx+(y1+y2)/2,f1=math.asin(((y1-cy)/ry).toFixed(7)),f2=math.asin(((y2-cy)/ry).toFixed(7));f1=x1<cx?PI-f1:f1;f2=x2<cx?PI-f2:f2;f1<0&&(f1=PI*2+f1);f2<0&&(f2=PI*2+f2);if(sweep_flag&&f1>f2){f1=f1-PI*2}if(!sweep_flag&&f2>f1){f2=f2-PI*2}}else{f1=recursive[0];f2=recursive[1];cx=recursive[2];cy=recursive[3]}var df=f2-f1;if(math.abs(df)>_120){var f2old=f2,x2old=x2,y2old=y2;f2=f1+_120*(sweep_flag&&f2>f1?1:-1);x2=cx+rx*math.cos(f2);y2=cy+ry*math.sin(f2);res=a2c(x2,y2,rx,ry,angle,0,sweep_flag,x2old,y2old,[f2,f2old,cx,cy])}df=f2-f1;var c1=math.cos(f1),s1=math.sin(f1),c2=math.cos(f2),s2=math.sin(f2),t=math.tan(df/4),hx=4/3*rx*t,hy=4/3*ry*t,m1=[x1,y1],m2=[x1+hx*s1,y1-hy*c1],m3=[x2+hx*s2,y2-hy*c2],m4=[x2,y2];m2[0]=2*m1[0]-m2[0];m2[1]=2*m1[1]-m2[1];if(recursive){return[m2,m3,m4][concat](res)}else{res=[m2,m3,m4][concat](res)[join]()[split](",");var newres=[];for(var i=0,ii=res[length];i<ii;i++){newres[i]=i%2?rotate(res[i-1],res[i],rad).y:rotate(res[i],res[i+1],rad).x}return newres}},findDotAtSegment=function(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,t){var t1=1-t;return{x:pow(t1,3)*p1x+pow(t1,2)*3*t*c1x+t1*3*t*t*c2x+pow(t,3)*p2x,y:pow(t1,3)*p1y+pow(t1,2)*3*t*c1y+t1*3*t*t*c2y+pow(t,3)*p2y}},curveDim=cacher(function(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y){var a=(c2x-2*c1x+p1x)-(p2x-2*c2x+c1x),b=2*(c1x-p1x)-2*(c2x-c1x),c=p1x-c1x,t1=(-b+math.sqrt(b*b-4*a*c))/2/a,t2=(-b-math.sqrt(b*b-4*a*c))/2/a,y=[p1y,p2y],x=[p1x,p2x],dot;math.abs(t1)>1000000000000&&(t1=0.5);math.abs(t2)>1000000000000&&(t2=0.5);if(t1>0&&t1<1){dot=findDotAtSegment(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,t1);x[push](dot.x);y[push](dot.y)}if(t2>0&&t2<1){dot=findDotAtSegment(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,t2);x[push](dot.x);y[push](dot.y)}a=(c2y-2*c1y+p1y)-(p2y-2*c2y+c1y);b=2*(c1y-p1y)-2*(c2y-c1y);c=p1y-c1y;t1=(-b+math.sqrt(b*b-4*a*c))/2/a;t2=(-b-math.sqrt(b*b-4*a*c))/2/a;math.abs(t1)>1000000000000&&(t1=0.5);math.abs(t2)>1000000000000&&(t2=0.5);if(t1>0&&t1<1){dot=findDotAtSegment(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,t1);x[push](dot.x);y[push](dot.y)}if(t2>0&&t2<1){dot=findDotAtSegment(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,t2);x[push](dot.x);y[push](dot.y)}return{min:{x:mmin[apply](0,x),y:mmin[apply](0,y)},max:{x:mmax[apply](0,x),y:mmax[apply](0,y)}}}),path2curve=cacher(function(path,path2){var p=pathToAbsolute(path),p2=path2&&pathToAbsolute(path2),attrs={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},attrs2={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},processPath=function(path,d){var nx,ny;if(!path){return["C",d.x,d.y,d.x,d.y,d.x,d.y]}!(path[0] in {T:1,Q:1})&&(d.qx=d.qy=null);switch(path[0]){case"M":d.X=path[1];d.Y=path[2];break;case"A":path=["C"][concat](a2c[apply](0,[d.x,d.y][concat](path.slice(1))));break;case"S":nx=d.x+(d.x-(d.bx||d.x));ny=d.y+(d.y-(d.by||d.y));path=["C",nx,ny][concat](path.slice(1));break;case"T":d.qx=d.x+(d.x-(d.qx||d.x));d.qy=d.y+(d.y-(d.qy||d.y));path=["C"][concat](q2c(d.x,d.y,d.qx,d.qy,path[1],path[2]));break;case"Q":d.qx=path[1];d.qy=path[2];path=["C"][concat](q2c(d.x,d.y,path[1],path[2],path[3],path[4]));break;case"L":path=["C"][concat](l2c(d.x,d.y,path[1],path[2]));break;case"H":path=["C"][concat](l2c(d.x,d.y,path[1],d.y));break;case"V":path=["C"][concat](l2c(d.x,d.y,d.x,path[1]));break;case"Z":path=["C"][concat](l2c(d.x,d.y,d.X,d.Y));break}return path},fixArc=function(pp,i){if(pp[i][length]>7){pp[i].shift();var pi=pp[i];while(pi[length]){pp.splice(i++,0,["C"][concat](pi.splice(0,6)))}pp.splice(i,1);ii=mmax(p[length],p2&&p2[length]||0)}},fixM=function(path1,path2,a1,a2,i){if(path1&&path2&&path1[i][0]=="M"&&path2[i][0]!="M"){path2.splice(i,0,["M",a2.x,a2.y]);a1.bx=0;a1.by=0;a1.x=path1[i][1];a1.y=path1[i][2];ii=mmax(p[length],p2&&p2[length]||0)}};for(var i=0,ii=mmax(p[length],p2&&p2[length]||0);i<ii;i++){p[i]=processPath(p[i],attrs);fixArc(p,i);p2&&(p2[i]=processPath(p2[i],attrs2));p2&&fixArc(p2,i);fixM(p,p2,attrs,attrs2,i);fixM(p2,p,attrs2,attrs,i);var seg=p[i],seg2=p2&&p2[i],seglen=seg[length],seg2len=p2&&seg2[length];attrs.x=seg[seglen-2];attrs.y=seg[seglen-1];attrs.bx=toFloat(seg[seglen-4])||attrs.x;attrs.by=toFloat(seg[seglen-3])||attrs.y;attrs2.bx=p2&&(toFloat(seg2[seg2len-4])||attrs2.x);attrs2.by=p2&&(toFloat(seg2[seg2len-3])||attrs2.y);attrs2.x=p2&&seg2[seg2len-2];attrs2.y=p2&&seg2[seg2len-1]}return p2?[p,p2]:p},null,pathClone),parseDots=cacher(function(gradient){var dots=[];for(var i=0,ii=gradient[length];i<ii;i++){var dot={},par=gradient[i].match(/^([^:]*):?([\d\.]*)/);dot.color=R.getRGB(par[1]);if(dot.color.error){return null}dot.color=dot.color.hex;par[2]&&(dot.offset=par[2]+"%");dots[push](dot)}for(i=1,ii=dots[length]-1;i<ii;i++){if(!dots[i].offset){var start=toFloat(dots[i-1].offset||0),end=0;for(var j=i+1;j<ii;j++){if(dots[j].offset){end=dots[j].offset;break}}if(!end){end=100;j=ii}end=toFloat(end);var d=(end-start)/(j-i+1);for(;i<j;i++){start+=d;dots[i].offset=start+"%"}}}return dots}),getContainer=function(x,y,w,h){var container;if(R.is(x,string)||R.is(x,"object")){container=R.is(x,string)?doc.getElementById(x):x;if(container.tagName){if(y==null){return{container:container,width:container.style.pixelWidth||container.offsetWidth,height:container.style.pixelHeight||container.offsetHeight}}else{return{container:container,width:y,height:w}}}}else{return{container:1,x:x,y:y,width:w,height:h}}},plugins=function(con,add){var that=this;for(var prop in add){if(add[has](prop)&&!(prop in con)){switch(typeof add[prop]){case"function":(function(f){con[prop]=con===that?f:function(){return f[apply](that,arguments)}})(add[prop]);break;case"object":con[prop]=con[prop]||{};plugins.call(this,con[prop],add[prop]);break;default:con[prop]=add[prop];break}}}},tear=function(el,paper){el==paper.top&&(paper.top=el.prev);el==paper.bottom&&(paper.bottom=el.next);el.next&&(el.next.prev=el.prev);el.prev&&(el.prev.next=el.next)},tofront=function(el,paper){if(paper.top===el){return}tear(el,paper);el.next=null;el.prev=paper.top;paper.top.next=el;paper.top=el},toback=function(el,paper){if(paper.bottom===el){return}tear(el,paper);el.next=paper.bottom;el.prev=null;paper.bottom.prev=el;paper.bottom=el},insertafter=function(el,el2,paper){tear(el,paper);el2==paper.top&&(paper.top=el);el2.next&&(el2.next.prev=el);el.next=el2.next;el.prev=el2;el2.next=el},insertbefore=function(el,el2,paper){tear(el,paper);el2==paper.bottom&&(paper.bottom=el);el2.prev&&(el2.prev.next=el);el.prev=el2.prev;el2.prev=el;el.next=el2},removed=function(methodname){return function(){throw new Error("Rapha\xebl: you are calling to method \u201c"+methodname+"\u201d of removed object")}},radial_gradient=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;R.pathToRelative=pathToRelative;if(R.svg){Paper[proto].svgns="http://www.w3.org/2000/svg";Paper[proto].xlink="http://www.w3.org/1999/xlink";round=function(num){return +num+(~~num===num)*0.5};var $=function(el,attr){if(attr){for(var key in attr){if(attr[has](key)){el[setAttribute](key,Str(attr[key]))}}}else{el=doc.createElementNS(Paper[proto].svgns,el);el.style.webkitTapHighlightColor="rgba(0,0,0,0)";return el}};R[toString]=function(){return"Your browser supports SVG.\nYou are running Rapha\xebl "+this.version};var thePath=function(pathString,SVG){var el=$("path");SVG.canvas&&SVG.canvas[appendChild](el);var p=new Element(el,SVG);p.type="path";setFillAndStroke(p,{fill:"none",stroke:"#000",path:pathString});return p};var addGradientFill=function(o,gradient,SVG){var type="linear",fx=0.5,fy=0.5,s=o.style;gradient=Str(gradient)[rp](radial_gradient,function(all,_fx,_fy){type="radial";if(_fx&&_fy){fx=toFloat(_fx);fy=toFloat(_fy);var dir=((fy>0.5)*2-1);pow(fx-0.5,2)+pow(fy-0.5,2)>0.25&&(fy=math.sqrt(0.25-pow(fx-0.5,2))*dir+0.5)&&fy!=0.5&&(fy=fy.toFixed(5)-1e-05*dir)}return E});gradient=gradient[split](/\s*\-\s*/);if(type=="linear"){var angle=gradient.shift();angle=-toFloat(angle);if(isNaN(angle)){return null}var vector=[0,0,math.cos(angle*math.PI/180),math.sin(angle*math.PI/180)],max=1/(mmax(math.abs(vector[2]),math.abs(vector[3]))||1);vector[2]*=max;vector[3]*=max;if(vector[2]<0){vector[0]=-vector[2];vector[2]=0}if(vector[3]<0){vector[1]=-vector[3];vector[3]=0}}var dots=parseDots(gradient);if(!dots){return null}var id=o.getAttribute(fillString);id=id.match(/^url\(#(.*)\)$/);id&&SVG.defs.removeChild(doc.getElementById(id[1]));var el=$(type+"Gradient");el.id="r"+(R._id++)[toString](36);$(el,type=="radial"?{fx:fx,fy:fy}:{x1:vector[0],y1:vector[1],x2:vector[2],y2:vector[3]});SVG.defs[appendChild](el);for(var i=0,ii=dots[length];i<ii;i++){var stop=$("stop");$(stop,{offset:dots[i].offset?dots[i].offset:!i?"0%":"100%","stop-color":dots[i].color||"#fff"});el[appendChild](stop)}$(o,{fill:"url(#"+el.id+")",opacity:1,"fill-opacity":1});s.fill=E;s.opacity=1;s.fillOpacity=1;return 1};var updatePosition=function(o){var bbox=o.getBBox();$(o.pattern,{patternTransform:R.format("translate({0},{1})",bbox.x,bbox.y)})};var setFillAndStroke=function(o,params){var dasharray={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},node=o.node,attrs=o.attrs,rot=o.rotate(),addDashes=function(o,value){value=dasharray[lowerCase.call(value)];if(value){var width=o.attrs["stroke-width"]||"1",butt={round:width,square:width,butt:0}[o.attrs["stroke-linecap"]||params["stroke-linecap"]]||0,dashes=[];var i=value[length];while(i--){dashes[i]=value[i]*width+((i%2)?1:-1)*butt}$(node,{"stroke-dasharray":dashes[join](",")})}};params[has]("rotation")&&(rot=params.rotation);var rotxy=Str(rot)[split](separator);if(!(rotxy.length-1)){rotxy=null}else{rotxy[1]=+rotxy[1];rotxy[2]=+rotxy[2]}toFloat(rot)&&o.rotate(0,true);for(var att in params){if(params[has](att)){if(!availableAttrs[has](att)){continue}var value=params[att];attrs[att]=value;switch(att){case"blur":o.blur(value);break;case"rotation":o.rotate(value,true);break;case"href":case"title":case"target":var pn=node.parentNode;if(lowerCase.call(pn.tagName)!="a"){var hl=$("a");pn.insertBefore(hl,node);hl[appendChild](node);pn=hl}pn.setAttributeNS(o.paper.xlink,att,value);break;case"cursor":node.style.cursor=value;break;case"clip-rect":var rect=Str(value)[split](separator);if(rect[length]==4){o.clip&&o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);var el=$("clipPath"),rc=$("rect");el.id="r"+(R._id++)[toString](36);$(rc,{x:rect[0],y:rect[1],width:rect[2],height:rect[3]});el[appendChild](rc);o.paper.defs[appendChild](el);$(node,{"clip-path":"url(#"+el.id+")"});o.clip=rc}if(!value){var clip=doc.getElementById(node.getAttribute("clip-path")[rp](/(^url\(#|\)$)/g,E));clip&&clip.parentNode.removeChild(clip);$(node,{"clip-path":E});delete o.clip}break;case"path":if(o.type=="path"){$(node,{d:value?attrs.path=pathToAbsolute(value):"M0,0"})}break;case"width":node[setAttribute](att,value);if(attrs.fx){att="x";value=attrs.x}else{break}case"x":if(attrs.fx){value=-attrs.x-(attrs.width||0)}case"rx":if(att=="rx"&&o.type=="rect"){break}case"cx":rotxy&&(att=="x"||att=="cx")&&(rotxy[1]+=value-attrs[att]);node[setAttribute](att,value);o.pattern&&updatePosition(o);break;case"height":node[setAttribute](att,value);if(attrs.fy){att="y";value=attrs.y}else{break}case"y":if(attrs.fy){value=-attrs.y-(attrs.height||0)}case"ry":if(att=="ry"&&o.type=="rect"){break}case"cy":rotxy&&(att=="y"||att=="cy")&&(rotxy[2]+=value-attrs[att]);node[setAttribute](att,value);o.pattern&&updatePosition(o);break;case"r":if(o.type=="rect"){$(node,{rx:value,ry:value})}else{node[setAttribute](att,value)}break;case"src":if(o.type=="image"){node.setAttributeNS(o.paper.xlink,"href",value)}break;case"stroke-width":node.style.strokeWidth=value;node[setAttribute](att,value);if(attrs["stroke-dasharray"]){addDashes(o,attrs["stroke-dasharray"])}break;case"stroke-dasharray":addDashes(o,value);break;case"translation":var xy=Str(value)[split](separator);xy[0]=+xy[0]||0;xy[1]=+xy[1]||0;if(rotxy){rotxy[1]+=xy[0];rotxy[2]+=xy[1]}translate.call(o,xy[0],xy[1]);break;case"scale":xy=Str(value)[split](separator);o.scale(+xy[0]||1,+xy[1]||+xy[0]||1,isNaN(toFloat(xy[2]))?null:+xy[2],isNaN(toFloat(xy[3]))?null:+xy[3]);break;case fillString:var isURL=Str(value).match(ISURL);if(isURL){el=$("pattern");var ig=$("image");el.id="r"+(R._id++)[toString](36);$(el,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});$(ig,{x:0,y:0});ig.setAttributeNS(o.paper.xlink,"href",isURL[1]);el[appendChild](ig);var img=doc.createElement("img");img.style.cssText="position:absolute;left:-9999em;top-9999em";img.onload=function(){$(el,{width:this.offsetWidth,height:this.offsetHeight});$(ig,{width:this.offsetWidth,height:this.offsetHeight});doc.body.removeChild(this);o.paper.safari()};doc.body[appendChild](img);img.src=isURL[1];o.paper.defs[appendChild](el);node.style.fill="url(#"+el.id+")";$(node,{fill:"url(#"+el.id+")"});o.pattern=el;o.pattern&&updatePosition(o);break}var clr=R.getRGB(value);if(!clr.error){delete params.gradient;delete attrs.gradient;!R.is(attrs.opacity,"undefined")&&R.is(params.opacity,"undefined")&&$(node,{opacity:attrs.opacity});!R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")&&$(node,{"fill-opacity":attrs["fill-opacity"]})}else{if((({circle:1,ellipse:1})[has](o.type)||Str(value).charAt()!="r")&&addGradientFill(node,value,o.paper)){attrs.gradient=value;attrs.fill="none";break}}clr[has]("o")&&$(node,{"fill-opacity":clr.o/100});case"stroke":clr=R.getRGB(value);node[setAttribute](att,clr.hex);att=="stroke"&&clr[has]("o")&&$(node,{"stroke-opacity":clr.o/100});break;case"gradient":(({circle:1,ellipse:1})[has](o.type)||Str(value).charAt()!="r")&&addGradientFill(node,value,o.paper);break;case"opacity":case"fill-opacity":if(attrs.gradient){var gradient=doc.getElementById(node.getAttribute(fillString)[rp](/^url\(#|\)$/g,E));if(gradient){var stops=gradient.getElementsByTagName("stop");stops[stops[length]-1][setAttribute]("stop-opacity",value)}break}default:att=="font-size"&&(value=toInt(value,10)+"px");var cssrule=att[rp](/(\-.)/g,function(w){return upperCase.call(w.substring(1))});node.style[cssrule]=value;node[setAttribute](att,value);break}}}tuneText(o,params);if(rotxy){o.rotate(rotxy.join(S))}else{toFloat(rot)&&o.rotate(rot,true)}};var leading=1.2,tuneText=function(el,params){if(el.type!="text"||!(params[has]("text")||params[has]("font")||params[has]("font-size")||params[has]("x")||params[has]("y"))){return}var a=el.attrs,node=el.node,fontSize=node.firstChild?toInt(doc.defaultView.getComputedStyle(node.firstChild,E).getPropertyValue("font-size"),10):10;if(params[has]("text")){a.text=params.text;while(node.firstChild){node.removeChild(node.firstChild)}var texts=Str(params.text)[split]("\n");for(var i=0,ii=texts[length];i<ii;i++){if(texts[i]){var tspan=$("tspan");i&&$(tspan,{dy:fontSize*leading,x:a.x});tspan[appendChild](doc.createTextNode(texts[i]));node[appendChild](tspan)}}}else{texts=node.getElementsByTagName("tspan");for(i=0,ii=texts[length];i<ii;i++){i&&$(texts[i],{dy:fontSize*leading,x:a.x})}}$(node,{y:a.y});var bb=el.getBBox(),dif=a.y-(bb.y+bb.height/2);dif&&isFinite(dif)&&$(node,{y:a.y+dif})},Element=function(node,svg){var X=0,Y=0;this[0]=node;this.id=R._oid++;this.node=node;node.raphael=this;this.paper=svg;this.attrs=this.attrs||{};this.transformations=[];this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1};!svg.bottom&&(svg.bottom=this);this.prev=svg.top;svg.top&&(svg.top.next=this);svg.top=this;this.next=null};Element[proto].rotate=function(deg,cx,cy){if(this.removed){return this}if(deg==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][join](S)}return this._.rt.deg}var bbox=this.getBBox();deg=Str(deg)[split](separator);if(deg[length]-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);if(cx!=null){this._.rt.deg=deg}else{this._.rt.deg+=deg}(cy==null)&&(cx=null);this._.rt.cx=cx;this._.rt.cy=cy;cx=cx==null?bbox.x+bbox.width/2:cx;cy=cy==null?bbox.y+bbox.height/2:cy;if(this._.rt.deg){this.transformations[0]=R.format("rotate({0} {1} {2})",this._.rt.deg,cx,cy);this.clip&&$(this.clip,{transform:R.format("rotate({0} {1} {2})",-this._.rt.deg,cx,cy)})}else{this.transformations[0]=E;this.clip&&$(this.clip,{transform:E})}$(this.node,{transform:this.transformations[join](S)});return this};Element[proto].hide=function(){!this.removed&&(this.node.style.display="none");return this};Element[proto].show=function(){!this.removed&&(this.node.style.display="");return this};Element[proto].remove=function(){if(this.removed){return}tear(this,this.paper);this.node.parentNode.removeChild(this.node);for(var i in this){delete this[i]}this.removed=true};Element[proto].getBBox=function(){if(this.removed){return this}if(this.type=="path"){return pathDimensions(this.attrs.path)}if(this.node.style.display=="none"){this.show();var hide=true}var bbox={};try{bbox=this.node.getBBox()}catch(e){}finally{bbox=bbox||{}}if(this.type=="text"){bbox={x:bbox.x,y:Infinity,width:0,height:0};for(var i=0,ii=this.node.getNumberOfChars();i<ii;i++){var bb=this.node.getExtentOfChar(i);(bb.y<bbox.y)&&(bbox.y=bb.y);(bb.y+bb.height-bbox.y>bbox.height)&&(bbox.height=bb.y+bb.height-bbox.y);(bb.x+bb.width-bbox.x>bbox.width)&&(bbox.width=bb.x+bb.width-bbox.x)}}hide&&this.hide();return bbox};Element[proto].attr=function(name,value){if(this.removed){return this}if(name==null){var res={};for(var i in this.attrs){if(this.attrs[has](i)){res[i]=this.attrs[i]}}this._.rt.deg&&(res.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(res.scale=this.scale());res.gradient&&res.fill=="none"&&(res.fill=res.gradient)&&delete res.gradient;return res}if(value==null&&R.is(name,string)){if(name=="translation"){return translate.call(this)}if(name=="rotation"){return this.rotate()}if(name=="scale"){return this.scale()}if(name==fillString&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient}return this.attrs[name]}if(value==null&&R.is(name,array)){var values={};for(var j=0,jj=name.length;j<jj;j++){values[name[j]]=this.attr(name[j])}return values}if(value!=null){var params={};params[name]=value;setFillAndStroke(this,params)}else{if(name!=null&&R.is(name,"object")){setFillAndStroke(this,name)}}return this};Element[proto].toFront=function(){if(this.removed){return this}this.node.parentNode[appendChild](this.node);var svg=this.paper;svg.top!=this&&tofront(this,svg);return this};Element[proto].toBack=function(){if(this.removed){return this}if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);toback(this,this.paper);var svg=this.paper}return this};Element[proto].insertAfter=function(element){if(this.removed){return this}var node=element.node||element[element.length].node;if(node.nextSibling){node.parentNode.insertBefore(this.node,node.nextSibling)}else{node.parentNode[appendChild](this.node)}insertafter(this,element,this.paper);return this};Element[proto].insertBefore=function(element){if(this.removed){return this}var node=element.node||element[0].node;node.parentNode.insertBefore(this.node,node);insertbefore(this,element,this.paper);return this};Element[proto].blur=function(size){var t=this;if(+size!==0){var fltr=$("filter"),blur=$("feGaussianBlur");t.attrs.blur=size;fltr.id="r"+(R._id++)[toString](36);$(blur,{stdDeviation:+size||1.5});fltr.appendChild(blur);t.paper.defs.appendChild(fltr);t._blur=fltr;$(t.node,{filter:"url(#"+fltr.id+")"})}else{if(t._blur){t._blur.parentNode.removeChild(t._blur);delete t._blur;delete t.attrs.blur}t.node.removeAttribute("filter")}};var theCircle=function(svg,x,y,r){var el=$("circle");svg.canvas&&svg.canvas[appendChild](el);var res=new Element(el,svg);res.attrs={cx:x,cy:y,r:r,fill:"none",stroke:"#000"};res.type="circle";$(el,res.attrs);return res};var theRect=function(svg,x,y,w,h,r){var el=$("rect");svg.canvas&&svg.canvas[appendChild](el);var res=new Element(el,svg);res.attrs={x:x,y:y,width:w,height:h,r:r||0,rx:r||0,ry:r||0,fill:"none",stroke:"#000"};res.type="rect";$(el,res.attrs);return res};var theEllipse=function(svg,x,y,rx,ry){var el=$("ellipse");svg.canvas&&svg.canvas[appendChild](el);var res=new Element(el,svg);res.attrs={cx:x,cy:y,rx:rx,ry:ry,fill:"none",stroke:"#000"};res.type="ellipse";$(el,res.attrs);return res};var theImage=function(svg,src,x,y,w,h){var el=$("image");$(el,{x:x,y:y,width:w,height:h,preserveAspectRatio:"none"});el.setAttributeNS(svg.xlink,"href",src);svg.canvas&&svg.canvas[appendChild](el);var res=new Element(el,svg);res.attrs={x:x,y:y,width:w,height:h,src:src};res.type="image";return res};var theText=function(svg,x,y,text){var el=$("text");$(el,{x:x,y:y,"text-anchor":"middle"});svg.canvas&&svg.canvas[appendChild](el);var res=new Element(el,svg);res.attrs={x:x,y:y,"text-anchor":"middle",text:text,font:availableAttrs.font,stroke:"none",fill:"#000"};res.type="text";setFillAndStroke(res,res.attrs);return res};var setSize=function(width,height){this.width=width||this.width;this.height=height||this.height;this.canvas[setAttribute]("width",this.width);this.canvas[setAttribute]("height",this.height);return this};var create=function(){var con=getContainer[apply](0,arguments),container=con&&con.container,x=con.x,y=con.y,width=con.width,height=con.height;if(!container){throw new Error("SVG container not found.")}var cnvs=$("svg");x=x||0;y=y||0;width=width||512;height=height||342;$(cnvs,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:width,height:height});if(container==1){cnvs.style.cssText="position:absolute;left:"+x+"px;top:"+y+"px";doc.body[appendChild](cnvs)}else{if(container.firstChild){container.insertBefore(cnvs,container.firstChild)}else{container[appendChild](cnvs)}}container=new Paper;container.width=width;container.height=height;container.canvas=cnvs;plugins.call(container,container,R.fn);container.clear();return container};Paper[proto].clear=function(){var c=this.canvas;while(c.firstChild){c.removeChild(c.firstChild)}this.bottom=this.top=null;(this.desc=$("desc"))[appendChild](doc.createTextNode("Created with Rapha\xebl"));c[appendChild](this.desc);c[appendChild](this.defs=$("defs"))};Paper[proto].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var i in this){this[i]=removed(i)}}}if(R.vml){var map={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},bites=/([clmz]),?([^clmz]*)/gi,val=/-?[^,\s-]+/g,coordsize=1000+S+1000,zoom=10,pathlike={path:1,rect:1},path2vml=function(path){var total=/[ahqstv]/ig,command=pathToAbsolute;Str(path).match(total)&&(command=path2curve);total=/[clmz]/g;if(command==pathToAbsolute&&!Str(path).match(total)){var res=Str(path)[rp](bites,function(all,command,args){var vals=[],isMove=lowerCase.call(command)=="m",res=map[command];args[rp](val,function(value){if(isMove&&vals[length]==2){res+=vals+map[command=="m"?"l":"L"];vals=[]}vals[push](round(value*zoom))});return res+vals});return res}var pa=command(path),p,r;res=[];for(var i=0,ii=pa[length];i<ii;i++){p=pa[i];r=lowerCase.call(pa[i][0]);r=="z"&&(r="x");for(var j=1,jj=p[length];j<jj;j++){r+=round(p[j]*zoom)+(j!=jj-1?",":E)}res[push](r)}return res[join](S)};R[toString]=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl "+this.version};thePath=function(pathString,vml){var g=createNode("group");g.style.cssText="position:absolute;left:0;top:0;width:"+vml.width+"px;height:"+vml.height+"px";g.coordsize=vml.coordsize;g.coordorigin=vml.coordorigin;var el=createNode("shape"),ol=el.style;ol.width=vml.width+"px";ol.height=vml.height+"px";el.coordsize=coordsize;el.coordorigin=vml.coordorigin;g[appendChild](el);var p=new Element(el,g,vml),attr={fill:"none",stroke:"#000"};pathString&&(attr.path=pathString);p.isAbsolute=true;p.type="path";p.path=[];p.Path=E;setFillAndStroke(p,attr);vml.canvas[appendChild](g);return p};setFillAndStroke=function(o,params){o.attrs=o.attrs||{};var node=o.node,a=o.attrs,s=node.style,xy,newpath=(params.x!=a.x||params.y!=a.y||params.width!=a.width||params.height!=a.height||params.r!=a.r)&&o.type=="rect",res=o;for(var par in params){if(params[has](par)){a[par]=params[par]}}if(newpath){a.path=rectPath(a.x,a.y,a.width,a.height,a.r);o.X=a.x;o.Y=a.y;o.W=a.width;o.H=a.height}params.href&&(node.href=params.href);params.title&&(node.title=params.title);params.target&&(node.target=params.target);params.cursor&&(s.cursor=params.cursor);"blur" in params&&o.blur(params.blur);if(params.path&&o.type=="path"||newpath){node.path=path2vml(a.path)}if(params.rotation!=null){o.rotate(params.rotation,true)}if(params.translation){xy=Str(params.translation)[split](separator);translate.call(o,xy[0],xy[1]);if(o._.rt.cx!=null){o._.rt.cx+=+xy[0];o._.rt.cy+=+xy[1];o.setBox(o.attrs,xy[0],xy[1])}}if(params.scale){xy=Str(params.scale)[split](separator);o.scale(+xy[0]||1,+xy[1]||+xy[0]||1,+xy[2]||null,+xy[3]||null)}if("clip-rect" in params){var rect=Str(params["clip-rect"])[split](separator);if(rect[length]==4){rect[2]=+rect[2]+(+rect[0]);rect[3]=+rect[3]+(+rect[1]);var div=node.clipRect||doc.createElement("div"),dstyle=div.style,group=node.parentNode;dstyle.clip=R.format("rect({1}px {2}px {3}px {0}px)",rect);if(!node.clipRect){dstyle.position="absolute";dstyle.top=0;dstyle.left=0;dstyle.width=o.paper.width+"px";dstyle.height=o.paper.height+"px";group.parentNode.insertBefore(div,group);div[appendChild](group);node.clipRect=div}}if(!params["clip-rect"]){node.clipRect&&(node.clipRect.style.clip=E)}}if(o.type=="image"&&params.src){node.src=params.src}if(o.type=="image"&&params.opacity){node.filterOpacity=ms+".Alpha(opacity="+(params.opacity*100)+")";s.filter=(node.filterMatrix||E)+(node.filterOpacity||E)}params.font&&(s.font=params.font);params["font-family"]&&(s.fontFamily='"'+params["font-family"][split](",")[0][rp](/^['"]+|['"]+$/g,E)+'"');params["font-size"]&&(s.fontSize=params["font-size"]);params["font-weight"]&&(s.fontWeight=params["font-weight"]);params["font-style"]&&(s.fontStyle=params["font-style"]);if(params.opacity!=null||params["stroke-width"]!=null||params.fill!=null||params.stroke!=null||params["stroke-width"]!=null||params["stroke-opacity"]!=null||params["fill-opacity"]!=null||params["stroke-dasharray"]!=null||params["stroke-miterlimit"]!=null||params["stroke-linejoin"]!=null||params["stroke-linecap"]!=null){node=o.shape||node;var fill=(node.getElementsByTagName(fillString)&&node.getElementsByTagName(fillString)[0]),newfill=false;!fill&&(newfill=fill=createNode(fillString));if("fill-opacity" in params||"opacity" in params){var opacity=((+a["fill-opacity"]+1||2)-1)*((+a.opacity+1||2)-1)*((+R.getRGB(params.fill).o+1||2)-1);opacity<0&&(opacity=0);opacity>1&&(opacity=1);fill.opacity=opacity}params.fill&&(fill.on=true);if(fill.on==null||params.fill=="none"){fill.on=false}if(fill.on&&params.fill){var isURL=params.fill.match(ISURL);if(isURL){fill.src=isURL[1];fill.type="tile"}else{fill.color=R.getRGB(params.fill).hex;fill.src=E;fill.type="solid";if(R.getRGB(params.fill).error&&(res.type in {circle:1,ellipse:1}||Str(params.fill).charAt()!="r")&&addGradientFill(res,params.fill)){a.fill="none";a.gradient=params.fill}}}newfill&&node[appendChild](fill);var stroke=(node.getElementsByTagName("stroke")&&node.getElementsByTagName("stroke")[0]),newstroke=false;!stroke&&(newstroke=stroke=createNode("stroke"));if((params.stroke&&params.stroke!="none")||params["stroke-width"]||params["stroke-opacity"]!=null||params["stroke-dasharray"]||params["stroke-miterlimit"]||params["stroke-linejoin"]||params["stroke-linecap"]){stroke.on=true}(params.stroke=="none"||stroke.on==null||params.stroke==0||params["stroke-width"]==0)&&(stroke.on=false);var strokeColor=R.getRGB(params.stroke);stroke.on&&params.stroke&&(stroke.color=strokeColor.hex);opacity=((+a["stroke-opacity"]+1||2)-1)*((+a.opacity+1||2)-1)*((+strokeColor.o+1||2)-1);var width=(toFloat(params["stroke-width"])||1)*0.75;opacity<0&&(opacity=0);opacity>1&&(opacity=1);params["stroke-width"]==null&&(width=a["stroke-width"]);params["stroke-width"]&&(stroke.weight=width);width&&width<1&&(opacity*=width)&&(stroke.weight=1);stroke.opacity=opacity;params["stroke-linejoin"]&&(stroke.joinstyle=params["stroke-linejoin"]||"miter");stroke.miterlimit=params["stroke-miterlimit"]||8;params["stroke-linecap"]&&(stroke.endcap=params["stroke-linecap"]=="butt"?"flat":params["stroke-linecap"]=="square"?"square":"round");if(params["stroke-dasharray"]){var dasharray={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};stroke.dashstyle=dasharray[has](params["stroke-dasharray"])?dasharray[params["stroke-dasharray"]]:E}newstroke&&node[appendChild](stroke)}if(res.type=="text"){s=res.paper.span.style;a.font&&(s.font=a.font);a["font-family"]&&(s.fontFamily=a["font-family"]);a["font-size"]&&(s.fontSize=a["font-size"]);a["font-weight"]&&(s.fontWeight=a["font-weight"]);a["font-style"]&&(s.fontStyle=a["font-style"]);res.node.string&&(res.paper.span.innerHTML=Str(res.node.string)[rp](/</g,"&#60;")[rp](/&/g,"&#38;")[rp](/\n/g,"<br>"));res.W=a.w=res.paper.span.offsetWidth;res.H=a.h=res.paper.span.offsetHeight;res.X=a.x;res.Y=a.y+round(res.H/2);switch(a["text-anchor"]){case"start":res.node.style["v-text-align"]="left";res.bbx=round(res.W/2);break;case"end":res.node.style["v-text-align"]="right";res.bbx=-round(res.W/2);break;default:res.node.style["v-text-align"]="center";break}}};addGradientFill=function(o,gradient){o.attrs=o.attrs||{};var attrs=o.attrs,fill,type="linear",fxfy=".5 .5";o.attrs.gradient=gradient;gradient=Str(gradient)[rp](radial_gradient,function(all,fx,fy){type="radial";if(fx&&fy){fx=toFloat(fx);fy=toFloat(fy);pow(fx-0.5,2)+pow(fy-0.5,2)>0.25&&(fy=math.sqrt(0.25-pow(fx-0.5,2))*((fy>0.5)*2-1)+0.5);fxfy=fx+S+fy}return E});gradient=gradient[split](/\s*\-\s*/);if(type=="linear"){var angle=gradient.shift();angle=-toFloat(angle);if(isNaN(angle)){return null}}var dots=parseDots(gradient);if(!dots){return null}o=o.shape||o.node;fill=o.getElementsByTagName(fillString)[0]||createNode(fillString);!fill.parentNode&&o.appendChild(fill);if(dots[length]){fill.on=true;fill.method="none";fill.color=dots[0].color;fill.color2=dots[dots[length]-1].color;var clrs=[];for(var i=0,ii=dots[length];i<ii;i++){dots[i].offset&&clrs[push](dots[i].offset+S+dots[i].color)}fill.colors&&(fill.colors.value=clrs[length]?clrs[join]():"0% "+fill.color);if(type=="radial"){fill.type="gradientradial";fill.focus="100%";fill.focussize=fxfy;fill.focusposition=fxfy}else{fill.type="gradient";fill.angle=(270-angle)%360}}return 1};Element=function(node,group,vml){var Rotation=0,RotX=0,RotY=0,Scale=1;this[0]=node;this.id=R._oid++;this.node=node;node.raphael=this;this.X=0;this.Y=0;this.attrs={};this.Group=group;this.paper=vml;this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};!vml.bottom&&(vml.bottom=this);this.prev=vml.top;vml.top&&(vml.top.next=this);vml.top=this;this.next=null};Element[proto].rotate=function(deg,cx,cy){if(this.removed){return this}if(deg==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][join](S)}return this._.rt.deg}deg=Str(deg)[split](separator);if(deg[length]-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);if(cx!=null){this._.rt.deg=deg}else{this._.rt.deg+=deg}cy==null&&(cx=null);this._.rt.cx=cx;this._.rt.cy=cy;this.setBox(this.attrs,cx,cy);this.Group.style.rotation=this._.rt.deg;return this};Element[proto].setBox=function(params,cx,cy){if(this.removed){return this}var gs=this.Group.style,os=(this.shape&&this.shape.style)||this.node.style;params=params||{};for(var i in params){if(params[has](i)){this.attrs[i]=params[i]}}cx=cx||this._.rt.cx;cy=cy||this._.rt.cy;var attr=this.attrs,x,y,w,h;switch(this.type){case"circle":x=attr.cx-attr.r;y=attr.cy-attr.r;w=h=attr.r*2;break;case"ellipse":x=attr.cx-attr.rx;y=attr.cy-attr.ry;w=attr.rx*2;h=attr.ry*2;break;case"image":x=+attr.x;y=+attr.y;w=attr.width||0;h=attr.height||0;break;case"text":this.textpath.v=["m",round(attr.x),", ",round(attr.y-2),"l",round(attr.x)+1,", ",round(attr.y-2)][join](E);x=attr.x-round(this.W/2);y=attr.y-this.H/2;w=this.W;h=this.H;break;case"rect":case"path":if(!this.attrs.path){x=0;y=0;w=this.paper.width;h=this.paper.height}else{var dim=pathDimensions(this.attrs.path);x=dim.x;y=dim.y;w=dim.width;h=dim.height}break;default:x=0;y=0;w=this.paper.width;h=this.paper.height;break}cx=(cx==null)?x+w/2:cx;cy=(cy==null)?y+h/2:cy;var left=cx-this.paper.width/2,top=cy-this.paper.height/2,t;gs.left!=(t=left+"px")&&(gs.left=t);gs.top!=(t=top+"px")&&(gs.top=t);this.X=pathlike[has](this.type)?-left:x;this.Y=pathlike[has](this.type)?-top:y;this.W=w;this.H=h;if(pathlike[has](this.type)){os.left!=(t=-left*zoom+"px")&&(os.left=t);os.top!=(t=-top*zoom+"px")&&(os.top=t)}else{if(this.type=="text"){os.left!=(t=-left+"px")&&(os.left=t);os.top!=(t=-top+"px")&&(os.top=t)}else{gs.width!=(t=this.paper.width+"px")&&(gs.width=t);gs.height!=(t=this.paper.height+"px")&&(gs.height=t);os.left!=(t=x-left+"px")&&(os.left=t);os.top!=(t=y-top+"px")&&(os.top=t);os.width!=(t=w+"px")&&(os.width=t);os.height!=(t=h+"px")&&(os.height=t)}}};Element[proto].hide=function(){!this.removed&&(this.Group.style.display="none");return this};Element[proto].show=function(){!this.removed&&(this.Group.style.display="block");return this};Element[proto].getBBox=function(){if(this.removed){return this}if(pathlike[has](this.type)){return pathDimensions(this.attrs.path)}return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}};Element[proto].remove=function(){if(this.removed){return}tear(this,this.paper);this.node.parentNode.removeChild(this.node);this.Group.parentNode.removeChild(this.Group);this.shape&&this.shape.parentNode.removeChild(this.shape);for(var i in this){delete this[i]}this.removed=true};Element[proto].attr=function(name,value){if(this.removed){return this}if(name==null){var res={};for(var i in this.attrs){if(this.attrs[has](i)){res[i]=this.attrs[i]}}this._.rt.deg&&(res.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(res.scale=this.scale());res.gradient&&res.fill=="none"&&(res.fill=res.gradient)&&delete res.gradient;return res}if(value==null&&R.is(name,string)){if(name=="translation"){return translate.call(this)}if(name=="rotation"){return this.rotate()}if(name=="scale"){return this.scale()}if(name==fillString&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient}return this.attrs[name]}if(this.attrs&&value==null&&R.is(name,array)){var ii,values={};for(i=0,ii=name[length];i<ii;i++){values[name[i]]=this.attr(name[i])}return values}var params;if(value!=null){params={};params[name]=value}value==null&&R.is(name,"object")&&(params=name);if(params){if(params.text&&this.type=="text"){this.node.string=params.text}setFillAndStroke(this,params);if(params.gradient&&(({circle:1,ellipse:1})[has](this.type)||Str(params.gradient).charAt()!="r")){addGradientFill(this,params.gradient)}(!pathlike[has](this.type)||this._.rt.deg)&&this.setBox(this.attrs)}return this};Element[proto].toFront=function(){!this.removed&&this.Group.parentNode[appendChild](this.Group);this.paper.top!=this&&tofront(this,this.paper);return this};Element[proto].toBack=function(){if(this.removed){return this}if(this.Group.parentNode.firstChild!=this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild);toback(this,this.paper)}return this};Element[proto].insertAfter=function(element){if(this.removed){return this}if(element.constructor==Set){element=element[element.length]}if(element.Group.nextSibling){element.Group.parentNode.insertBefore(this.Group,element.Group.nextSibling)}else{element.Group.parentNode[appendChild](this.Group)}insertafter(this,element,this.paper);return this};Element[proto].insertBefore=function(element){if(this.removed){return this}if(element.constructor==Set){element=element[0]}element.Group.parentNode.insertBefore(this.Group,element.Group);insertbefore(this,element,this.paper);return this};var blurregexp=/ progid:\S+Blur\([^\)]+\)/g;Element[proto].blur=function(size){var s=this.node.runtimeStyle,f=s.filter;f=f.replace(blurregexp,E);if(+size!==0){this.attrs.blur=size;s.filter=f+S+ms+".Blur(pixelradius="+(+size||1.5)+")";s.margin=R.format("-{0}px 0 0 -{0}px",round(+size||1.5))}else{s.filter=f;s.margin=0;delete this.attrs.blur}};theCircle=function(vml,x,y,r){var g=createNode("group"),o=createNode("oval"),ol=o.style;g.style.cssText="position:absolute;left:0;top:0;width:"+vml.width+"px;height:"+vml.height+"px";g.coordsize=coordsize;g.coordorigin=vml.coordorigin;g[appendChild](o);var res=new Element(o,g,vml);res.type="circle";setFillAndStroke(res,{stroke:"#000",fill:"none"});res.attrs.cx=x;res.attrs.cy=y;res.attrs.r=r;res.setBox({x:x-r,y:y-r,width:r*2,height:r*2});vml.canvas[appendChild](g);return res};function rectPath(x,y,w,h,r){if(r){return R.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z",x+r,y,w-r*2,r,-r,h-r*2,r*2-w,r*2-h)}else{return R.format("M{0},{1}l{2},0,0,{3},{4},0z",x,y,w,h,-w)}}theRect=function(vml,x,y,w,h,r){var path=rectPath(x,y,w,h,r),res=vml.path(path),a=res.attrs;res.X=a.x=x;res.Y=a.y=y;res.W=a.width=w;res.H=a.height=h;a.r=r;a.path=path;res.type="rect";return res};theEllipse=function(vml,x,y,rx,ry){var g=createNode("group"),o=createNode("oval"),ol=o.style;g.style.cssText="position:absolute;left:0;top:0;width:"+vml.width+"px;height:"+vml.height+"px";g.coordsize=coordsize;g.coordorigin=vml.coordorigin;g[appendChild](o);var res=new Element(o,g,vml);res.type="ellipse";setFillAndStroke(res,{stroke:"#000"});res.attrs.cx=x;res.attrs.cy=y;res.attrs.rx=rx;res.attrs.ry=ry;res.setBox({x:x-rx,y:y-ry,width:rx*2,height:ry*2});vml.canvas[appendChild](g);return res};theImage=function(vml,src,x,y,w,h){var g=createNode("group"),o=createNode("image"),ol=o.style;g.style.cssText="position:absolute;left:0;top:0;width:"+vml.width+"px;height:"+vml.height+"px";g.coordsize=coordsize;g.coordorigin=vml.coordorigin;o.src=src;g[appendChild](o);var res=new Element(o,g,vml);res.type="image";res.attrs.src=src;res.attrs.x=x;res.attrs.y=y;res.attrs.w=w;res.attrs.h=h;res.setBox({x:x,y:y,width:w,height:h});vml.canvas[appendChild](g);return res};theText=function(vml,x,y,text){var g=createNode("group"),el=createNode("shape"),ol=el.style,path=createNode("path"),ps=path.style,o=createNode("textpath");g.style.cssText="position:absolute;left:0;top:0;width:"+vml.width+"px;height:"+vml.height+"px";g.coordsize=coordsize;g.coordorigin=vml.coordorigin;path.v=R.format("m{0},{1}l{2},{1}",round(x*10),round(y*10),round(x*10)+1);path.textpathok=true;ol.width=vml.width;ol.height=vml.height;o.string=Str(text);o.on=true;el[appendChild](o);el[appendChild](path);g[appendChild](el);var res=new Element(o,g,vml);res.shape=el;res.textpath=path;res.type="text";res.attrs.text=text;res.attrs.x=x;res.attrs.y=y;res.attrs.w=1;res.attrs.h=1;setFillAndStroke(res,{font:availableAttrs.font,stroke:"none",fill:"#000"});res.setBox();vml.canvas[appendChild](g);return res};setSize=function(width,height){var cs=this.canvas.style;width==+width&&(width+="px");height==+height&&(height+="px");cs.width=width;cs.height=height;cs.clip="rect(0 "+width+" "+height+" 0)";return this};var createNode;doc.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!doc.namespaces.rvml&&doc.namespaces.add("rvml","urn:schemas-microsoft-com:vml");createNode=function(tagName){return doc.createElement("<rvml:"+tagName+' class="rvml">')}}catch(e){createNode=function(tagName){return doc.createElement("<"+tagName+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}create=function(){var con=getContainer[apply](0,arguments),container=con.container,height=con.height,s,width=con.width,x=con.x,y=con.y;if(!container){throw new Error("VML container not found.")}var res=new Paper,c=res.canvas=doc.createElement("div"),cs=c.style;x=x||0;y=y||0;width=width||512;height=height||342;width==+width&&(width+="px");height==+height&&(height+="px");res.width=1000;res.height=1000;res.coordsize=zoom*1000+S+zoom*1000;res.coordorigin="0 0";res.span=doc.createElement("span");res.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";c[appendChild](res.span);cs.cssText=R.format("width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",width,height);if(container==1){doc.body[appendChild](c);cs.left=x+"px";cs.top=y+"px";cs.position="absolute"}else{if(container.firstChild){container.insertBefore(c,container.firstChild)}else{container[appendChild](c)}}plugins.call(res,res,R.fn);return res};Paper[proto].clear=function(){this.canvas.innerHTML=E;this.span=doc.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[appendChild](this.span);this.bottom=this.top=null};Paper[proto].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var i in this){this[i]=removed(i)}return true}}if((navigator.vendor=="Apple Computer, Inc.")&&(navigator.userAgent.match(/Version\/(.*?)\s/)[1]<4||win.navigator.platform.slice(0,2)=="iP")){Paper[proto].safari=function(){var rect=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});win.setTimeout(function(){rect.remove()})}}else{Paper[proto].safari=function(){}}var preventDefault=function(){this.returnValue=false},preventTouch=function(){return this.originalEvent.preventDefault()},stopPropagation=function(){this.cancelBubble=true},stopTouch=function(){return this.originalEvent.stopPropagation()},addEvent=(function(){if(doc.addEventListener){return function(obj,type,fn,element){var realName=supportsTouch&&touchMap[type]?touchMap[type]:type;var f=function(e){if(supportsTouch&&touchMap[has](type)){for(var i=0,ii=e.targetTouches&&e.targetTouches.length;i<ii;i++){if(e.targetTouches[i].target==obj){var olde=e;e=e.targetTouches[i];e.originalEvent=olde;e.preventDefault=preventTouch;e.stopPropagation=stopTouch;break}}}return fn.call(element,e)};obj.addEventListener(realName,f,false);return function(){obj.removeEventListener(realName,f,false);return true}}}else{if(doc.attachEvent){return function(obj,type,fn,element){var f=function(e){e=e||win.event;e.preventDefault=e.preventDefault||preventDefault;e.stopPropagation=e.stopPropagation||stopPropagation;return fn.call(element,e)};obj.attachEvent("on"+type,f);var detacher=function(){obj.detachEvent("on"+type,f);return true};return detacher}}}})(),drag=[],dragMove=function(e){var x=e.clientX,y=e.clientY,dragi,j=drag.length;while(j--){dragi=drag[j];if(supportsTouch){var i=e.touches.length,touch;while(i--){touch=e.touches[i];if(touch.identifier==dragi.el._drag.id){x=touch.clientX;y=touch.clientY;(e.originalEvent?e.originalEvent:e).preventDefault();break}}}else{e.preventDefault()}dragi.move&&dragi.move.call(dragi.el,x-dragi.el._drag.x,y-dragi.el._drag.y,x,y)}},dragUp=function(){R.unmousemove(dragMove).unmouseup(dragUp);var i=drag.length,dragi;while(i--){dragi=drag[i];dragi.el._drag={};dragi.end&&dragi.end.call(dragi.el)}drag=[]};for(var i=events[length];i--;){(function(eventName){R[eventName]=Element[proto][eventName]=function(fn){if(R.is(fn,"function")){this.events=this.events||[];this.events.push({name:eventName,f:fn,unbind:addEvent(this.shape||this.node||doc,eventName,fn,this)})}return this};R["un"+eventName]=Element[proto]["un"+eventName]=function(fn){var events=this.events,l=events[length];while(l--){if(events[l].name==eventName&&events[l].f==fn){events[l].unbind();events.splice(l,1);!events.length&&delete this.events;return this}}return this}})(events[i])}Element[proto].hover=function(f_in,f_out){return this.mouseover(f_in).mouseout(f_out)};Element[proto].unhover=function(f_in,f_out){return this.unmouseover(f_in).unmouseout(f_out)};Element[proto].drag=function(onmove,onstart,onend){this._drag={};this.mousedown(function(e){(e.originalEvent||e).preventDefault();this._drag.x=e.clientX;this._drag.y=e.clientY;this._drag.id=e.identifier;onstart&&onstart.call(this,e.clientX,e.clientY);!drag.length&&R.mousemove(dragMove).mouseup(dragUp);drag.push({el:this,move:onmove,end:onend})});return this};Element[proto].undrag=function(onmove,onstart,onend){var i=drag.length;while(i--){drag[i].el==this&&(drag[i].move==onmove&&drag[i].end==onend)&&drag.splice(i,1);!drag.length&&R.unmousemove(dragMove).unmouseup(dragUp)}};Paper[proto].circle=function(x,y,r){return theCircle(this,x||0,y||0,r||0)};Paper[proto].rect=function(x,y,w,h,r){return theRect(this,x||0,y||0,w||0,h||0,r||0)};Paper[proto].ellipse=function(x,y,rx,ry){return theEllipse(this,x||0,y||0,rx||0,ry||0)};Paper[proto].path=function(pathString){pathString&&!R.is(pathString,string)&&!R.is(pathString[0],array)&&(pathString+=E);return thePath(R.format[apply](R,arguments),this)};Paper[proto].image=function(src,x,y,w,h){return theImage(this,src||"about:blank",x||0,y||0,w||0,h||0)};Paper[proto].text=function(x,y,text){return theText(this,x||0,y||0,text||E)};Paper[proto].set=function(itemsArray){arguments[length]>1&&(itemsArray=Array[proto].splice.call(arguments,0,arguments[length]));return new Set(itemsArray)};Paper[proto].setSize=setSize;Paper[proto].top=Paper[proto].bottom=null;Paper[proto].raphael=R;function x_y(){return this.x+S+this.y}Element[proto].resetScale=function(){if(this.removed){return this}this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};Element[proto].scale=function(x,y,cx,cy){if(this.removed){return this}if(x==null&&y==null){return{x:this._.sx,y:this._.sy,toString:x_y}}y=y||x;!+y&&(y=x);var dx,dy,dcx,dcy,a=this.attrs;if(x!=0){var bb=this.getBBox(),rcx=bb.x+bb.width/2,rcy=bb.y+bb.height/2,kx=x/this._.sx,ky=y/this._.sy;cx=(+cx||cx==0)?cx:rcx;cy=(+cy||cy==0)?cy:rcy;var dirx=~~(x/math.abs(x)),diry=~~(y/math.abs(y)),s=this.node.style,ncx=cx+(rcx-cx)*kx,ncy=cy+(rcy-cy)*ky;switch(this.type){case"rect":case"image":var neww=a.width*dirx*kx,newh=a.height*diry*ky;this.attr({height:newh,r:a.r*mmin(dirx*kx,diry*ky),width:neww,x:ncx-neww/2,y:ncy-newh/2});break;case"circle":case"ellipse":this.attr({rx:a.rx*dirx*kx,ry:a.ry*diry*ky,r:a.r*mmin(dirx*kx,diry*ky),cx:ncx,cy:ncy});break;case"text":this.attr({x:ncx,y:ncy});break;case"path":var path=pathToRelative(a.path),skip=true;for(var i=0,ii=path[length];i<ii;i++){var p=path[i],P0=upperCase.call(p[0]);if(P0=="M"&&skip){continue}else{skip=false}if(P0=="A"){p[path[i][length]-2]*=kx;p[path[i][length]-1]*=ky;p[1]*=dirx*kx;p[2]*=diry*ky;p[5]=+!(dirx+diry?!+p[5]:+p[5])}else{if(P0=="H"){for(var j=1,jj=p[length];j<jj;j++){p[j]*=kx}}else{if(P0=="V"){for(j=1,jj=p[length];j<jj;j++){p[j]*=ky}}else{for(j=1,jj=p[length];j<jj;j++){p[j]*=(j%2)?kx:ky}}}}}var dim2=pathDimensions(path);dx=ncx-dim2.x-dim2.width/2;dy=ncy-dim2.y-dim2.height/2;path[0][1]+=dx;path[0][2]+=dy;this.attr({path:path});break}if(this.type in {text:1,image:1}&&(dirx!=1||diry!=1)){if(this.transformations){this.transformations[2]="scale("[concat](dirx,",",diry,")");this.node[setAttribute]("transform",this.transformations[join](S));dx=(dirx==-1)?-a.x-(neww||0):a.x;dy=(diry==-1)?-a.y-(newh||0):a.y;this.attr({x:dx,y:dy});a.fx=dirx-1;a.fy=diry-1}else{this.node.filterMatrix=ms+".Matrix(M11="[concat](dirx,", M12=0, M21=0, M22=",diry,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");s.filter=(this.node.filterMatrix||E)+(this.node.filterOpacity||E)}}else{if(this.transformations){this.transformations[2]=E;this.node[setAttribute]("transform",this.transformations[join](S));a.fx=0;a.fy=0}else{this.node.filterMatrix=E;s.filter=(this.node.filterMatrix||E)+(this.node.filterOpacity||E)}}a.scale=[x,y,cx,cy][join](S);this._.sx=x;this._.sy=y}return this};Element[proto].clone=function(){if(this.removed){return null}var attr=this.attr();delete attr.scale;delete attr.translation;return this.paper[this.type]().attr(attr)};var getPointAtSegmentLength=cacher(function(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,length){var len=0,old;for(var i=0;i<1.01;i+=0.01){var dot=findDotAtSegment(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,i);i&&(len+=pow(pow(old.x-dot.x,2)+pow(old.y-dot.y,2),0.5));if(len>=length){return dot}old=dot}}),getLengthFactory=function(istotal,subpath){return function(path,length,onlystart){path=path2curve(path);var x,y,p,l,sp="",subpaths={},point,len=0;for(var i=0,ii=path.length;i<ii;i++){p=path[i];if(p[0]=="M"){x=+p[1];y=+p[2]}else{l=segmentLength(x,y,p[1],p[2],p[3],p[4],p[5],p[6]);if(len+l>length){if(subpath&&!subpaths.start){point=getPointAtSegmentLength(x,y,p[1],p[2],p[3],p[4],p[5],p[6],length-len);sp+=["C",point.start.x,point.start.y,point.m.x,point.m.y,point.x,point.y];if(onlystart){return sp}subpaths.start=sp;sp=["M",point.x,point.y+"C",point.n.x,point.n.y,point.end.x,point.end.y,p[5],p[6]][join]();len+=l;x=+p[5];y=+p[6];continue}if(!istotal&&!subpath){point=getPointAtSegmentLength(x,y,p[1],p[2],p[3],p[4],p[5],p[6],length-len);return{x:point.x,y:point.y,alpha:point.alpha}}}len+=l;x=+p[5];y=+p[6]}sp+=p}subpaths.end=sp;point=istotal?len:subpath?subpaths:R.findDotsAtSegment(x,y,p[1],p[2],p[3],p[4],p[5],p[6],1);point.alpha&&(point={x:point.x,y:point.y,alpha:point.alpha});return point}},segmentLength=cacher(function(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y){var old={x:0,y:0},len=0;for(var i=0;i<1.01;i+=0.01){var dot=findDotAtSegment(p1x,p1y,c1x,c1y,c2x,c2y,p2x,p2y,i);i&&(len+=pow(pow(old.x-dot.x,2)+pow(old.y-dot.y,2),0.5));old=dot}return len});var getTotalLength=getLengthFactory(1),getPointAtLength=getLengthFactory(),getSubpathsAtLength=getLengthFactory(0,1);Element[proto].getTotalLength=function(){if(this.type!="path"){return}if(this.node.getTotalLength){return this.node.getTotalLength()}return getTotalLength(this.attrs.path)};Element[proto].getPointAtLength=function(length){if(this.type!="path"){return}if(this.node.getPointAtLength){return this.node.getPointAtLength(length)}return getPointAtLength(this.attrs.path,length)};Element[proto].getSubpath=function(from,to){if(this.type!="path"){return}if(math.abs(this.getTotalLength()-to)<1e-06){return getSubpathsAtLength(this.attrs.path,from).end}var a=getSubpathsAtLength(this.attrs.path,to,1);return from?getSubpathsAtLength(a,from).end:a};R.easing_formulas={linear:function(n){return n},"<":function(n){return pow(n,3)},">":function(n){return pow(n-1,3)+1},"<>":function(n){n=n*2;if(n<1){return pow(n,3)/2}n-=2;return(pow(n,3)+2)/2},backIn:function(n){var s=1.70158;return n*n*((s+1)*n-s)},backOut:function(n){n=n-1;var s=1.70158;return n*n*((s+1)*n+s)+1},elastic:function(n){if(n==0||n==1){return n}var p=0.3,s=p/4;return pow(2,-10*n)*math.sin((n-s)*(2*math.PI)/p)+1},bounce:function(n){var s=7.5625,p=2.75,l;if(n<(1/p)){l=s*n*n}else{if(n<(2/p)){n-=(1.5/p);l=s*n*n+0.75}else{if(n<(2.5/p)){n-=(2.25/p);l=s*n*n+0.9375}else{n-=(2.625/p);l=s*n*n+0.984375}}}return l}};var animationElements={length:0},animation=function(){var Now=+new Date;for(var l in animationElements){if(l!="length"&&animationElements[has](l)){var e=animationElements[l];if(e.stop||e.el.removed){delete animationElements[l];animationElements[length]--;continue}var time=Now-e.start,ms=e.ms,easing=e.easing,from=e.from,diff=e.diff,to=e.to,t=e.t,prev=e.prev||0,that=e.el,callback=e.callback,set={},now;if(time<ms){var pos=R.easing_formulas[easing]?R.easing_formulas[easing](time/ms):time/ms;for(var attr in from){if(from[has](attr)){switch(availableAnimAttrs[attr]){case"along":now=pos*ms*diff[attr];to.back&&(now=to.len-now);var point=getPointAtLength(to[attr],now);that.translate(diff.sx-diff.x||0,diff.sy-diff.y||0);diff.x=point.x;diff.y=point.y;that.translate(point.x-diff.sx,point.y-diff.sy);to.rot&&that.rotate(diff.r+point.alpha,point.x,point.y);break;case nu:now=+from[attr]+pos*ms*diff[attr];break;case"colour":now="rgb("+[upto255(round(from[attr].r+pos*ms*diff[attr].r)),upto255(round(from[attr].g+pos*ms*diff[attr].g)),upto255(round(from[attr].b+pos*ms*diff[attr].b))][join](",")+")";break;case"path":now=[];for(var i=0,ii=from[attr][length];i<ii;i++){now[i]=[from[attr][i][0]];for(var j=1,jj=from[attr][i][length];j<jj;j++){now[i][j]=+from[attr][i][j]+pos*ms*diff[attr][i][j]}now[i]=now[i][join](S)}now=now[join](S);break;case"csv":switch(attr){case"translation":var x=diff[attr][0]*(time-prev),y=diff[attr][1]*(time-prev);t.x+=x;t.y+=y;now=x+S+y;break;case"rotation":now=+from[attr][0]+pos*ms*diff[attr][0];from[attr][1]&&(now+=","+from[attr][1]+","+from[attr][2]);break;case"scale":now=[+from[attr][0]+pos*ms*diff[attr][0],+from[attr][1]+pos*ms*diff[attr][1],(2 in to[attr]?to[attr][2]:E),(3 in to[attr]?to[attr][3]:E)][join](S);break;case"clip-rect":now=[];i=4;while(i--){now[i]=+from[attr][i]+pos*ms*diff[attr][i]}break}break}set[attr]=now}}that.attr(set);that._run&&that._run.call(that)}else{if(to.along){point=getPointAtLength(to.along,to.len*!to.back);that.translate(diff.sx-(diff.x||0)+point.x-diff.sx,diff.sy-(diff.y||0)+point.y-diff.sy);to.rot&&that.rotate(diff.r+point.alpha,point.x,point.y)}(t.x||t.y)&&that.translate(-t.x,-t.y);to.scale&&(to.scale+=E);that.attr(to);delete animationElements[l];animationElements[length]--;that.in_animation=null;R.is(callback,"function")&&callback.call(that)}e.prev=time}}R.svg&&that&&that.paper&&that.paper.safari();animationElements[length]&&win.setTimeout(animation)},upto255=function(color){return mmax(mmin(color,255),0)},translate=function(x,y){if(x==null){return{x:this._.tx,y:this._.ty,toString:x_y}}this._.tx+=+x;this._.ty+=+y;switch(this.type){case"circle":case"ellipse":this.attr({cx:+x+this.attrs.cx,cy:+y+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+x+this.attrs.x,y:+y+this.attrs.y});break;case"path":var path=pathToRelative(this.attrs.path);path[0][1]+=+x;path[0][2]+=+y;this.attr({path:path});break}return this};Element[proto].animateWith=function(element,params,ms,easing,callback){animationElements[element.id]&&(params.start=animationElements[element.id].start);return this.animate(params,ms,easing,callback)};Element[proto].animateAlong=along();Element[proto].animateAlongBack=along(1);function along(isBack){return function(path,ms,rotate,callback){var params={back:isBack};R.is(rotate,"function")?(callback=rotate):(params.rot=rotate);path&&path.constructor==Element&&(path=path.attrs.path);path&&(params.along=path);return this.animate(params,ms,callback)}}Element[proto].onAnimation=function(f){this._run=f||0;return this};Element[proto].animate=function(params,ms,easing,callback){if(R.is(easing,"function")||!easing){callback=easing||null}var from={},to={},diff={};for(var attr in params){if(params[has](attr)){if(availableAnimAttrs[has](attr)){from[attr]=this.attr(attr);(from[attr]==null)&&(from[attr]=availableAttrs[attr]);to[attr]=params[attr];switch(availableAnimAttrs[attr]){case"along":var len=getTotalLength(params[attr]);var point=getPointAtLength(params[attr],len*!!params.back);var bb=this.getBBox();diff[attr]=len/ms;diff.tx=bb.x;diff.ty=bb.y;diff.sx=point.x;diff.sy=point.y;to.rot=params.rot;to.back=params.back;to.len=len;params.rot&&(diff.r=toFloat(this.rotate())||0);break;case nu:diff[attr]=(to[attr]-from[attr])/ms;break;case"colour":from[attr]=R.getRGB(from[attr]);var toColour=R.getRGB(to[attr]);diff[attr]={r:(toColour.r-from[attr].r)/ms,g:(toColour.g-from[attr].g)/ms,b:(toColour.b-from[attr].b)/ms};break;case"path":var pathes=path2curve(from[attr],to[attr]);from[attr]=pathes[0];var toPath=pathes[1];diff[attr]=[];for(var i=0,ii=from[attr][length];i<ii;i++){diff[attr][i]=[0];for(var j=1,jj=from[attr][i][length];j<jj;j++){diff[attr][i][j]=(toPath[i][j]-from[attr][i][j])/ms}}break;case"csv":var values=Str(params[attr])[split](separator),from2=Str(from[attr])[split](separator);switch(attr){case"translation":from[attr]=[0,0];diff[attr]=[values[0]/ms,values[1]/ms];break;case"rotation":from[attr]=(from2[1]==values[1]&&from2[2]==values[2])?from2:[0,values[1],values[2]];diff[attr]=[(values[0]-from[attr][0])/ms,0,0];break;case"scale":params[attr]=values;from[attr]=Str(from[attr])[split](separator);diff[attr]=[(values[0]-from[attr][0])/ms,(values[1]-from[attr][1])/ms,0,0];break;case"clip-rect":from[attr]=Str(from[attr])[split](separator);diff[attr]=[];i=4;while(i--){diff[attr][i]=(values[i]-from[attr][i])/ms}break}to[attr]=values}}}}this.stop();this.in_animation=1;animationElements[this.id]={start:params.start||+new Date,ms:ms,easing:easing,from:from,diff:diff,to:to,el:this,callback:callback,t:{x:0,y:0}};++animationElements[length]==1&&animation();return this};Element[proto].stop=function(){animationElements[this.id]&&animationElements[length]--;delete animationElements[this.id];return this};Element[proto].translate=function(x,y){return this.attr({translation:x+" "+y})};Element[proto][toString]=function(){return"Rapha\xebl\u2019s object"};R.ae=animationElements;var Set=function(items){this.items=[];this[length]=0;this.type="set";if(items){for(var i=0,ii=items[length];i<ii;i++){if(items[i]&&(items[i].constructor==Element||items[i].constructor==Set)){this[this.items[length]]=this.items[this.items[length]]=items[i];this[length]++}}}};Set[proto][push]=function(){var item,len;for(var i=0,ii=arguments[length];i<ii;i++){item=arguments[i];if(item&&(item.constructor==Element||item.constructor==Set)){len=this.items[length];this[len]=this.items[len]=item;this[length]++}}return this};Set[proto].pop=function(){delete this[this[length]--];return this.items.pop()};for(var method in Element[proto]){if(Element[proto][has](method)){Set[proto][method]=(function(methodname){return function(){for(var i=0,ii=this.items[length];i<ii;i++){this.items[i][methodname][apply](this.items[i],arguments)}return this}})(method)}}Set[proto].attr=function(name,value){if(name&&R.is(name,array)&&R.is(name[0],"object")){for(var j=0,jj=name[length];j<jj;j++){this.items[j].attr(name[j])}}else{for(var i=0,ii=this.items[length];i<ii;i++){this.items[i].attr(name,value)}}return this};Set[proto].animate=function(params,ms,easing,callback){(R.is(easing,"function")||!easing)&&(callback=easing||null);var len=this.items[length],i=len,item,set=this,collector;callback&&(collector=function(){!--len&&callback.call(set)});easing=R.is(easing,string)?easing:collector;item=this.items[--i].animate(params,ms,easing,collector);while(i--){this.items[i].animateWith(item,params,ms,easing,collector)}return this};Set[proto].insertAfter=function(el){var i=this.items[length];while(i--){this.items[i].insertAfter(el)}return this};Set[proto].getBBox=function(){var x=[],y=[],w=[],h=[];for(var i=this.items[length];i--;){var box=this.items[i].getBBox();x[push](box.x);y[push](box.y);w[push](box.x+box.width);h[push](box.y+box.height)}x=mmin[apply](0,x);y=mmin[apply](0,y);return{x:x,y:y,width:mmax[apply](0,w)-x,height:mmax[apply](0,h)-y}};Set[proto].clone=function(s){s=new Set;for(var i=0,ii=this.items[length];i<ii;i++){s[push](this.items[i].clone())}return s};R.registerFont=function(font){if(!font.face){return font}this.fonts=this.fonts||{};var fontcopy={w:font.w,face:{},glyphs:{}},family=font.face["font-family"];for(var prop in font.face){if(font.face[has](prop)){fontcopy.face[prop]=font.face[prop]}}if(this.fonts[family]){this.fonts[family][push](fontcopy)}else{this.fonts[family]=[fontcopy]}if(!font.svg){fontcopy.face["units-per-em"]=toInt(font.face["units-per-em"],10);for(var glyph in font.glyphs){if(font.glyphs[has](glyph)){var path=font.glyphs[glyph];fontcopy.glyphs[glyph]={w:path.w,k:{},d:path.d&&"M"+path.d[rp](/[mlcxtrv]/g,function(command){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[command]||"M"})+"z"};if(path.k){for(var k in path.k){if(path[has](k)){fontcopy.glyphs[glyph].k[k]=path.k[k]}}}}}}return font};Paper[proto].getFont=function(family,weight,style,stretch){stretch=stretch||"normal";style=style||"normal";weight=+weight||{normal:400,bold:700,lighter:300,bolder:800}[weight]||400;if(!R.fonts){return}var font=R.fonts[family];if(!font){var name=new RegExp("(^|\\s)"+family[rp](/[^\w\d\s+!~.:_-]/g,E)+"(\\s|$)","i");for(var fontName in R.fonts){if(R.fonts[has](fontName)){if(name.test(fontName)){font=R.fonts[fontName];break}}}}var thefont;if(font){for(var i=0,ii=font[length];i<ii;i++){thefont=font[i];if(thefont.face["font-weight"]==weight&&(thefont.face["font-style"]==style||!thefont.face["font-style"])&&thefont.face["font-stretch"]==stretch){break}}}return thefont};Paper[proto].print=function(x,y,string,font,size,origin){origin=origin||"middle";var out=this.set(),letters=Str(string)[split](E),shift=0,path=E,scale;R.is(font,string)&&(font=this.getFont(font));if(font){scale=(size||16)/font.face["units-per-em"];var bb=font.face.bbox.split(separator),top=+bb[0],height=+bb[1]+(origin=="baseline"?bb[3]-bb[1]+(+font.face.descent):(bb[3]-bb[1])/2);for(var i=0,ii=letters[length];i<ii;i++){var prev=i&&font.glyphs[letters[i-1]]||{},curr=font.glyphs[letters[i]];shift+=i?(prev.w||font.w)+(prev.k&&prev.k[letters[i]]||0):0;curr&&curr.d&&out[push](this.path(curr.d).attr({fill:"#000",stroke:"none",translation:[shift,0]}))}out.scale(scale,scale,top,height).translate(x-top,y-height)}return out};var formatrg=/\{(\d+)\}/g;R.format=function(token,params){var args=R.is(params,array)?[0][concat](params):arguments;token&&R.is(token,string)&&args[length]-1&&(token=token[rp](formatrg,function(str,i){return args[++i]==null?E:args[i]}));return token||E};R.ninja=function(){oldRaphael.was?(Raphael=oldRaphael.is):delete Raphael;return R};R.el=Element[proto];return R})();(function(){if(!("console" in window)||!("firebug" in console)){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i){window.console[names[i]]=function(){}}}jQuery(function($){$("input:not(.nosubmit),select:not(.nosubmit),textarea:not(.nosubmit),fieldset:not(.nosubmit)").live("keydown",function(e){if(e.which!=13){return true}if(this.tagName&&this.tagName=="TEXTAREA"){return true}var root=$(this);while(root.length>0){var button=root.find(":submit,:button");if(button.length>0){button[0].click();return false}root=root.parent()}});$("#navigation .middle ul li a").arrowAfter();$(".rootLink a").arrowBefore();$(".faqCategory li a").arrowAfter();$("a.showBars").arrowAfter();$("a.showLines").arrowAfter();$("#main-nav ul li:last").addClass("last");$("#colPortlet2 .list-portlet li:last").addClass("last");$("#contentWrapper .commentWrapper li:last").addClass("last");$("form.noscript").removeClass("noscript");$(".brandName").hide();$("ul li a").bind("mouseenter",function(){$(this).children(".brandName").slideDown(300)}).bind("mouseleave",function(){$(this).children(".brandName").slideUp(300)});$(".faqAnswer").hide();$(".faqItem a.faqQuestion").click(function(){if($(this).hasClass("minus")){$(this).siblings(".faqAnswer").slideUp("slow");$(this).removeClass("minus")}else{$(this).siblings(".faqAnswer").slideDown("slow");$(this).addClass("minus")}return false});$(".siteComments .paging-buttons span.page-number").wrapInner("<span></span>");$("fieldset.validate button").click(function(){$("#aspnetForm").validate()});$("a[href*=#]:not(a[href=#])").click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var $target=$(this.hash);$target=$target.length&&$target||$("[name="+this.hash.slice(1)+"]");if($target.length){var targetOffset=$target.offset().top;var documentHeight=$(document).height();var windowHeight=$(window).height();if((targetOffset+windowHeight)>documentHeight){targetOffset=documentHeight-windowHeight}$("html,body").animate({scrollTop:targetOffset},{duration:600,easing:"easeInOutQuad"},"swing");return false}}return true});$(".rightImage img").each(function(){var imageWidth=$(this).width();$(this).parent(".rightImage").css("width",""+imageWidth+"px")});$(".leftImage img").each(function(){var imageWidth=$(this).width();$(this).parent(".leftImage").css("width",""+imageWidth+"px")});$(".x-portlet ul.slideshow").each(function(){$(this).children("li").addClass("hide").children(":not(.colorbox)").hide();$(this).children("li:first").addClass("first-item");var title=$(this).children("li:first").children(".colorbox").attr("title");var number=$(this).children("li").size();$(this).parent(".x-portlet").append("<div class='imageNumber'>Bild 1/"+number+"</div>");$(this).parent(".x-portlet").append("<div class='imageSlideshowText'>"+title+"</div>")});$("ul.slideshow .colorbox").colorbox({maxWidth:"80%",maxHeight:"100%",current:"Bild {current} av {total}",title:function(){var text="";$(this).siblings().each(function(){text+="<"+this.nodeName+">"+$(this).html()+"</"+this.nodeName+">"});return text}});if($.browser.msie&&$.browser.version=="6.0"){$("body").addClass("ieSix");$("#pagewrapper").before("<div class='iesixDiv'>Du anv&auml;nder en webbl&auml;sare som denna sida ej &auml;r utvecklad f&ouml;r, vi ber er d&auml;rf&ouml;r anv&auml;nda en senare <a href='http://www.microsoft.com/downloads/details.aspx?FamilyId=9AE91EBE-3385-447C-8A30-081805B2F90B&displaylang=en'>version</a> av denna webbl&auml;sare eller en annan typ av <a href='http://www.mozilla.com/sv-SE/'>webbl&auml;sare</a></div>")}$(".movieList ul li:odd").addClass("odd");$("#comments ul li li:even").addClass("even");if($(".calendarView").length==0){$(".dynamicCalendar .gradient").hide()}else{$(".dynamicCalendar .less").hide();$(".listView").hide();$(".dynamicCalendar a.more").click(function(){$(this).hide();$(this).siblings(".less").show();$(this).parent(".gradient").siblings(".listView").slideDown("slow")});$(".dynamicCalendar a.less").click(function(){$(this).hide();$(this).siblings(".more").show();$(this).parent(".gradient").siblings(".listView").slideUp("slow")})}$(".dynamicCalendar td a.events").each(function(){$(this).parent("td").addClass("eventWrapper")});var deviceAgent=navigator.userAgent.toLowerCase();var agentID=deviceAgent.match(/(iphone|ipod|ipad)/);if(agentID){}else{if(!FlashDetect.installed||!FlashDetect.versionAtLeast(7)){$("#noflash").addClass("active")}}$(".sectionTitle").click(function(){$(this).toggleClass("closed");$(this).next("div").slideToggle({duration:1000,easing:"easeOutQuad"})});externalLinks();setupSiteMessage()});var setupSiteMessage=function(){$(document).ready(function(){var siteMessgeHeight=$("#message").height();var siteMessgeHeightStyleValue="-"+siteMessgeHeight+"px";$("#message").css("margin-top",siteMessgeHeightStyleValue);$("#message").animate({marginTop:"0px"},{duration:1500,easing:"easeOutQuad"});$("#message .mClose a").click(function(e){e.preventDefault();var siteMessgeHeight=$("#message").height();var siteMessgeHeightStyleValue="-"+siteMessgeHeight+"px";$("#message").animate({marginTop:siteMessgeHeightStyleValue},{duration:1500,easing:"easeOutQuad",complete:function(){var closeLinkHref=$("#message .mClose a").attr("href");$.post(closeLinkHref)}})})})};var externalLinks=function(){var anchors=document.getElementsByTagName("a");for(var i=0;i<anchors.length;i++){var anchor=anchors[i];var href=anchor.getAttribute("href");if(href!=null){if(IsIE()){AddMailtoClass(anchor,href)}var rel=anchor.getAttribute("rel");var email=IsEmailLink(href);var file=IsFileLink(href,rel);var external=IsExternalLink(href,rel);if(!email&&(external||file)){if(anchor.target!=null){anchor.target="_blank";if(IsIE()){if(file){anchor.className+=" file";AddExtensionClass(anchor,href)}else{anchor.className+=" external"}}}}}}};var IsIE=function(){var agt=navigator.userAgent.toLowerCase();return((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1))};var AddMailtoClass=function(anchor,href){if(IsEmailLink(href)){anchor.className+=" mailto"}};this.AddExtensionClass=function(anchor,href){var index=href.lastIndexOf(".");if(index>0){anchor.className+=" ext-"+href.slice(index+1)}};var IsEmailLink=function(href){return href.indexOf("mailto:")==0};var IsFileLink=function(href,rel){var extension="";var dotIndex=href.lastIndexOf(".");var questionIndex=href.indexOf("?");if(dotIndex>0&&questionIndex<0){extension=href.slice(dotIndex+1);var slashIndex=extension.indexOf("/");if(slashIndex>0){extension=""}var hashIndex=extension.indexOf("#");if(hashIndex>0){extension=extension.substring(0,hashIndex)}}return(rel=="file"||(extension!=""&&extension!="htm"&&extension!="html"&&extension!="aspx"&&extension!="asp"&&extension!="jsp"&&extension!="php"))};var IsExternalLink=function(href,rel){if(document.location.pathname!=null){if(jQuery.parseUri(href).host==document.location.hostname){return false}}var s=href.substring(0,1);return(rel=="external"||(s!="/"&&s!="#"))};$.fn.arrowBefore=function(){if(this.size()>0){this.each(function(){$(this).prepend("<span class='arrow'>&laquo;&nbsp;</span>")})}};$.fn.arrowAfter=function(){if(this.size()>0){this.each(function(){$(this).append("<span class='arrow'>&nbsp;&raquo;</span>")})}};var FlashDetect=new function(){var self=this;self.installed=false;self.raw="";self.major=-1;self.minor=-1;self.revision=-1;self.revisionStr="";var activeXDetectRules=[{name:"ShockwaveFlash.ShockwaveFlash.7",version:function(obj){return getActiveXVersion(obj)}},{name:"ShockwaveFlash.ShockwaveFlash.6",version:function(obj){var version="6,0,21";try{obj.AllowScriptAccess="always";version=getActiveXVersion(obj)}catch(err){}return version}},{name:"ShockwaveFlash.ShockwaveFlash",version:function(obj){return getActiveXVersion(obj)}}];var getActiveXVersion=function(activeXObj){var version=-1;try{version=activeXObj.GetVariable("$version")}catch(err){}return version};var getActiveXObject=function(name){var obj=-1;try{obj=new ActiveXObject(name)}catch(err){obj={activeXError:true}}return obj};var parseActiveXVersion=function(str){var versionArray=str.split(",");return{raw:str,major:parseInt(versionArray[0].split(" ")[1],10),minor:parseInt(versionArray[1],10),revision:parseInt(versionArray[2],10),revisionStr:versionArray[2]}};var parseStandardVersion=function(str){var descParts=str.split(/ +/);var majorMinor=descParts[2].split(/\./);var revisionStr=descParts[3];return{raw:str,major:parseInt(majorMinor[0],10),minor:parseInt(majorMinor[1],10),revisionStr:revisionStr,revision:parseRevisionStrToInt(revisionStr)}};var parseRevisionStrToInt=function(str){return parseInt(str.replace(/[a-zA-Z]/g,""),10)||self.revision};self.majorAtLeast=function(version){return self.major>=version};self.minorAtLeast=function(version){return self.minor>=version};self.revisionAtLeast=function(version){return self.revision>=version};self.versionAtLeast=function(major){var properties=[self.major,self.minor,self.revision];var len=Math.min(properties.length,arguments.length);for(i=0;i<len;i++){if(properties[i]>=arguments[i]){if(i+1<len&&properties[i]==arguments[i]){continue}else{return true}}else{return false}}};self.FlashDetect=function(){if(navigator.plugins&&navigator.plugins.length>0){var type="application/x-shockwave-flash";var mimeTypes=navigator.mimeTypes;if(mimeTypes&&mimeTypes[type]&&mimeTypes[type].enabledPlugin&&mimeTypes[type].enabledPlugin.description){var version=mimeTypes[type].enabledPlugin.description;var versionObj=parseStandardVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revisionStr=versionObj.revisionStr;self.revision=versionObj.revision;self.installed=true}}else{if(navigator.appVersion.indexOf("Mac")==-1&&window.execScript){var version=-1;for(var i=0;i<activeXDetectRules.length&&version==-1;i++){var obj=getActiveXObject(activeXDetectRules[i].name);if(!obj.activeXError){self.installed=true;version=activeXDetectRules[i].version(obj);if(version!=-1){var versionObj=parseActiveXVersion(version);self.raw=versionObj.raw;self.major=versionObj.major;self.minor=versionObj.minor;self.revision=versionObj.revision;self.revisionStr=versionObj.revisionStr}}}}}}()};FlashDetect.JS_RELEASE="1.0.4"})();(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> &#187;</span>'].join("")),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl()},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(["li.",o.hoverClass].join("")).length<1){over.call(o.$path)}},o.delay)},getMenu=function($menu){var menu=$menu.parents(["ul.",c.menuClass,":first"].join(""))[0];sf.op=sf.o[menu.serial];return menu},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone())};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$("li."+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(" ")).filter("li:has(ul)").removeClass(o.pathClass)});sf.o[s]=sf.op=o;$("li:has(ul)",this)[($.fn.hoverIntent&&!o.disableHI)?"hoverIntent":"hover"](over,out).each(function(){if(o.autoArrows){addArrow($(">a:first-child",this))}}).not("."+c.bcClass).hideSuperfishUl();var $a=$("a",this);$a.each(function(i){var $li=$a.eq(i).parents("li");$a.eq(i).focus(function(){over.call($li)}).blur(function(){out.call($li)})});o.onInit.call(this)}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7)){menuClasses.push(c.shadowClass)}$(this).addClass(menuClasses.join(" "))})};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined){this.toggleClass(sf.c.shadowClass+"-off")}};sf.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};sf.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:"";o.retainPath=false;var $ul=$(["li.",o.hoverClass].join(""),this).add(this).not(not).removeClass(o.hoverClass).find(">ul").hide().css("visibility","hidden");o.onHide.call($ul);return this},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+"-off",$ul=this.addClass(o.hoverClass).find(">ul:hidden").css("visibility","visible");sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul)});return this}})})(jQuery);$("document").ready(function(){$("#mainNav #products > ul").addClass("products");$("#mainNav > ul").superfish({delay:800,animation:{height:"show"},speed:"normal",autoArrows:false,dropShadows:false});var noProducts=$(".products").children().length;if(noProducts>8){$(".products li:nth-child(8)").nextAll().insertAfter("ul.products").wrapAll('<ul class="productsSplit">');var mLeft=$(".products").width();var col2=$(".productsSplit").width();$(".productsSplit").css("margin-left",mLeft+"px");$(".products").css("width",(mLeft+col2)+"px");$(".products li a").css("width",mLeft)}$("a.navSearch").bind("mouseenter",function(){$("a.navGlobe.enabled").removeClass("over");if($(this).hasClass("over")){clearTimeout(StopTimeOut)}else{$("#lang").hide();$("#navsearch").slideDown("fast")}}).bind("mouseleave",function(){StopMainTimeOut=setTimeout(function(){$("#navsearch").hide();$("a.navSearch").removeClass("over")},200)});$("#navsearch").bind("mouseenter",function(){$("a.navSearch").addClass("over");clearTimeout(StopMainTimeOut);clearTimeout(StopTimeOut)}).bind("mouseleave",function(){StopTimeOut=setTimeout(function(){$("#navsearch").hide();$("a.navSearch").removeClass("over")},600)});$("a.navGlobe.enabled").bind("mouseenter",function(){$("a.navSearch").removeClass("over");if($(this).hasClass("over")){clearTimeout(StopTimeOut)}else{$("#navsearch").hide();$("#lang").slideDown("fast")}}).bind("mouseleave",function(){StopMainTimeOut=setTimeout(function(){$("#lang").hide();$("a.navGlobe.enabled").removeClass("over")},200)});$("#lang").bind("mouseenter",function(){$("a.navGlobe.enabled").addClass("over");clearTimeout(StopMainTimeOut);clearTimeout(StopTimeOut)}).bind("mouseleave",function(){StopTimeOut=setTimeout(function(){$("#lang").hide();$("a.navGlobe.enabled").removeClass("over")},600)})});function openDrawer(){$("#prodDrawer").animate({height:"101px"},{duration:400,easing:"easeOutExpo"})}function closeDrawer(){$("#prodDrawer").animate({height:"41px"},{duration:400,easing:"easeOutExpo"})}function setupInitWidth(){var productDrawerWidth=calculateProductDrawerWidth();$("#prodDrawer .prodWrapper").css("width",productDrawerWidth);$("#prodDrawer .prodList").css("width",productDrawerWidth);$("#prodDrawer .prodListWrapper").css("width",productDrawerWidth);return productDrawerWidth}function calculateProductDrawerWidth(){var productCount=$("#prodDrawer ul.prodList li").length;var productWidth=76;var productDrawerWidth=productCount*productWidth;return productDrawerWidth}$("document").ready(function(){var productDrawerWidth=setupInitWidth();if($(window).width()<productDrawerWidth){$(".prodWrapper").css("width",$(window).width());$(".prodListWrapper").css("width",$(window).width())}$("ul.prodList li a").bind("mouseenter",function(){$(this).children(".brand").stop();$(this).children(".brand").show();$(this).children(".brand").css("opacity",1)});$("ul.prodList li a").bind("mouseleave",function(){$(this).children(".brand").fadeOut(500)});var config={over:openDrawer,timeout:100,out:closeDrawer};$(".prodWrapper").hoverIntent(config);var div=$("div.prodListWrapper"),ul=$("ul.prodList");var divWidth=div.width();var lastLi=ul.find("li:last-child");div.mousemove(function(e){var ulWidth=lastLi[0].offsetLeft+lastLi.outerWidth();var left=(e.pageX-div.offset().left)*(ulWidth-divWidth)/divWidth;div.scrollLeft(left)});$(window).bind("resize",function(){console.log("resize");var productDrawerWidth=calculateProductDrawerWidth();if($(window).width()<productDrawerWidth){$(".prodWrapper").css("width",$(window).width());$(".prodListWrapper").css("width",$(window).width())}else{$(".prodWrapper").css("width",productDrawerWidth+"px");$(".prodListWrapper").css("width",productDrawerWidth+"px")}divWidth=div.width()})});Raphael.fn.drawWheel=function(cx,cy,r,w,values,opts){opts=opts||{};var paper=this,rad=Math.PI/180,sectors=[],series=this.set(),chart=this.set(),len=values.length,angle=0,total=0;var sector=function(cx,cy,r,w,sa,ea){var r1=r,r2=r+w,x1=cx+r1*Math.sin(sa*rad),y1=cy-r1*Math.cos(sa*rad),x2=cx+r2*Math.sin(sa*rad),y2=cy-r2*Math.cos(sa*rad),x3=cx+r2*Math.sin(ea*rad),y3=cy-r2*Math.cos(ea*rad),x4=cx+r1*Math.sin(ea*rad),y4=cy-r1*Math.cos(ea*rad),xm=cx+r1/2*Math.sin(-(sa+(ea-sa)/2)*rad),ym=cy+r1/2*Math.cos(-(sa+(ea-sa)/2)*rad),res=["M",x1,y1,"L",x2,y2,"A",r2,r2,0,+(ea-sa>180),1,x3,y3,"L",x4,y4,"A",r1,r1,0,+(ea-sa>180),0,x1,y1];res.middle={x:xm,y:ym};return res};for(var i=0;i<len;i++){total+=values[i]}for(var i=0;i<len;i++){var mangle=angle-360*values[i]/total/2,path=sector(cx,cy,r,w,angle,angle+=360*values[i]/total),p=this.path(path).attr({fill:opts.colors&&opts.colors[i]||"hsb("+i/10+", 1, .95)",stroke:opts.stroke||"none","stroke-width":(opts.strokewidth==null?1:opts.strokewidth)});p.value=values[i];p.middle=path.middle;p.mangle=mangle;sectors.push(p);series.push(p)}chart.hover=function(fin,fout){fout=fout||function(){};var that=this;for(var i=0;i<len;i++){(function(sector,j){var o={sector:sector,cx:cx,cy:cy,mx:sector.middle.x,my:sector.middle.y,mangle:sector.mangle,r:r,value:values[j],total:total};sector.mouseover(function(){fin.call(o)}).mouseout(function(){fout.call(o)})})(series[i],i)}return this};chart.each=function(f){var that=this;for(var i=0;i<len;i++){(function(sector,j){var o={sector:sector,cx:cx,cy:cy,x:sector.middle.x,y:sector.middle.y,mangle:sector.mangle,r:r,value:values[j],total:total};f.call(o)})(series[i],i)}return this};chart.click=function(f){var that=this;for(var i=0;i<len;i++){(function(sector,j){var o={sector:sector,cx:cx,cy:cy,mx:sector.middle.x,my:sector.middle.y,mangle:sector.mangle,r:r,value:values[j],total:total};sector.click(function(){f.call(o)})})(series[i],i)}return this};chart.push(series);chart.series=series;return chart};function displayFlavors(radius,thickness,centerX,centerY){jQuery("div.flavor").each(function(){var $flavor=jQuery(this),values=[],colors=[];var $styleTemplate=$('<span id="flavorWheelStyleTemplate" class="flavorWheelStyleTemplate" />').appendTo($flavor),textColor=$styleTemplate.css("color");$styleTemplate.remove();$flavor.find("dt").each(function(){var $dt=jQuery(this);var input=$dt.find("input");colors.push(($dt.css("color").length>0)?$dt.css("color"):null);values.push(parseInt($dt.next("dd").text(),10))});if(!values.length){return}var $flavorWheelWrapper=$flavor.parent().parent().find(".flavorWheelWrapper");var container=$flavorWheelWrapper[0];var w=140,h=140;var p=Raphael(container,w,h);p.paperWidth=w;p.paperHeight=h;var wheel=p.drawWheel(centerX,centerY,radius,thickness,values,{colors:colors});wheel.hover(function(){this.sector.stop();this.sector.animate({scale:[1.1,1.1,this.cx,this.cy]},500,"elastic")},function(){this.sector.animate({scale:[1,1,this.cx,this.cy]},500,"bounce")})})};
