// LOG DEBUG TOOL. usage: log('inside coolFunc', this, arguments);
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console) {
      arguments.callee = arguments.callee.caller;
      console.log( Array.prototype.slice.call(arguments) );
  }
};

(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});





/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(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 p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);




/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
 * 
 * Copyright (c) 2008 - 2010 Janis Skarnelis
 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
 * 
 * Version: 1.3.4 (11/11/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.8,overlayColor:"#000",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);








/*!
 * jQzoom Evolution Library v2.3  - Javascript Image magnifier
 * http://www.mind-projects.it
 *
 * Copyright 2011, Engineer Marco Renzi
 * Licensed under the BSD license.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the organization nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * Date: 03 May 2011 22:16:00
 */
(function($){var isIE6=($.browser.msie&&$.browser.version<7);var body=$(document.body);var window=$(window);var jqzoompluging_disabled=false;$.fn.jqzoom=function(options){return this.each(function(){var node=this.nodeName.toLowerCase();if(node=="a"){new jqzoom(this,options)}})};jqzoom=function(el,options){var api=null;api=$(el).data("jqzoom");if(api){return api}var obj=this;var settings=$.extend({},$.jqzoom.defaults,options||{});obj.el=el;el.rel=$(el).attr("rel");el.zoom_active=false;el.zoom_disabled=false;el.largeimageloading=false;el.largeimageloaded=false;el.scale={};el.timer=null;el.mousepos={};el.mouseDown=false;$(el).css({"outline-style":"none","text-decoration":"none"});var img=$("img:eq(0)",el);el.title=$(el).attr("title");el.imagetitle=img.attr("title");var zoomtitle=($.trim(el.title).length>0)?el.title:el.imagetitle;var smallimage=new Smallimage(img);var lens=new Lens();var stage=new Stage();var largeimage=new Largeimage();var loader=new Loader();$(el).bind("click",function(e){e.preventDefault();return false});var zoomtypes=["standard","drag","innerzoom","reverse"];if($.inArray($.trim(settings.zoomType),zoomtypes)<0){settings.zoomType="standard"}$.extend(obj,{create:function(){if($(".zoomPad",el).length==0){el.zoomPad=$("<div/>").addClass("zoomPad");img.wrap(el.zoomPad)}if(settings.zoomType=="innerzoom"){settings.zoomWidth=smallimage.w;settings.zoomHeight=smallimage.h}if($(".zoomPup",el).length==0){lens.append()}if($(".zoomWindow",el).length==0){stage.append()}if($(".zoomPreload",el).length==0){loader.append()}if(settings.preloadImages||settings.zoomType=="drag"||settings.alwaysOn){obj.load()}obj.init()},init:function(){if(settings.zoomType=="drag"){$(".zoomPad",el).mousedown(function(){el.mouseDown=true});$(".zoomPad",el).mouseup(function(){el.mouseDown=false});document.body.ondragstart=function(){return false};$(".zoomPad",el).css({cursor:"default"});$(".zoomPup",el).css({cursor:"move"})}if(settings.zoomType=="innerzoom"){$(".zoomWrapper",el).css({cursor:"crosshair"})}$(".zoomPad",el).bind("mouseenter mouseover",function(event){img.attr("title","");$(el).attr("title","");el.zoom_active=true;smallimage.fetchdata();if(el.largeimageloaded){obj.activate(event)}else{obj.load()}});$(".zoomPad",el).bind("mouseleave",function(event){obj.deactivate()});$(".zoomPad",el).bind("mousemove",function(e){if(e.pageX>smallimage.pos.r||e.pageX<smallimage.pos.l||e.pageY<smallimage.pos.t||e.pageY>smallimage.pos.b){lens.setcenter();return false}el.zoom_active=true;if(el.largeimageloaded&&!$(".zoomWindow",el).is(":visible")){obj.activate(e)}if(el.largeimageloaded&&(settings.zoomType!="drag"||(settings.zoomType=="drag"&&el.mouseDown))){lens.setposition(e)}});var thumb_preload=new Array();var i=0;var thumblist=new Array();thumblist=$("a").filter(function(){var regex=new RegExp("gallery[\\s]*:[\\s]*'"+$.trim(el.rel)+"'","i");var rel=$(this).attr("rel");if(regex.test(rel)){return this}});if(thumblist.length>0){var first=thumblist.splice(0,1);thumblist.push(first)}thumblist.each(function(){if(settings.preloadImages){var thumb_options=$.extend({},eval("("+$.trim($(this).attr("rel"))+")"));thumb_preload[i]=new Image();thumb_preload[i].src=thumb_options.largeimage;i++}$(this).click(function(e){if($(this).hasClass("zoomThumbActive")){return false}thumblist.each(function(){$(this).removeClass("zoomThumbActive")});e.preventDefault();obj.swapimage(this);return false})})},load:function(){if(el.largeimageloaded==false&&el.largeimageloading==false){var url=$(el).attr("href");el.largeimageloading=true;largeimage.loadimage(url)}},activate:function(e){clearTimeout(el.timer);lens.show();stage.show()},deactivate:function(e){switch(settings.zoomType){case"drag":break;default:img.attr("title",el.imagetitle);$(el).attr("title",el.title);if(settings.alwaysOn){lens.setcenter()}else{stage.hide();lens.hide()}break}el.zoom_active=false},swapimage:function(link){el.largeimageloading=false;el.largeimageloaded=false;var options=new Object();options=$.extend({},eval("("+$.trim($(link).attr("rel"))+")"));if(options.smallimage&&options.largeimage){var smallimage=options.smallimage;var largeimage=options.largeimage;$(link).addClass("zoomThumbActive");$(el).attr("href",largeimage);img.attr("src",smallimage);lens.hide();stage.hide();obj.load()}else{alert("ERROR :: Missing parameter for largeimage or smallimage.");throw"ERROR :: Missing parameter for largeimage or smallimage."}return false}});if(img[0].complete){smallimage.fetchdata();if($(".zoomPad",el).length==0){obj.create()}}function Smallimage(image){var $obj=this;this.node=image[0];this.findborder=function(){var bordertop=0;bordertop=image.css("border-top-width");btop="";var borderleft=0;borderleft=image.css("border-left-width");bleft="";if(bordertop){for(i=0;i<3;i++){var x=[];x=bordertop.substr(i,1);if(isNaN(x)==false){btop=btop+""+bordertop.substr(i,1)}else{break}}}if(borderleft){for(i=0;i<3;i++){if(!isNaN(borderleft.substr(i,1))){bleft=bleft+borderleft.substr(i,1)}else{break}}}$obj.btop=(btop.length>0)?eval(btop):0;$obj.bleft=(bleft.length>0)?eval(bleft):0};this.fetchdata=function(){$obj.findborder();$obj.w=image.width();$obj.h=image.height();$obj.ow=image.outerWidth();$obj.oh=image.outerHeight();$obj.pos=image.offset();$obj.pos.l=image.offset().left+$obj.bleft;$obj.pos.t=image.offset().top+$obj.btop;$obj.pos.r=$obj.w+$obj.pos.l;$obj.pos.b=$obj.h+$obj.pos.t;$obj.rightlimit=image.offset().left+$obj.ow;$obj.bottomlimit=image.offset().top+$obj.oh};this.node.onerror=function(){alert("Problems while loading image.");throw"Problems while loading image."};this.node.onload=function(){$obj.fetchdata();if($(".zoomPad",el).length==0){obj.create()}};return $obj}function Loader(){var $obj=this;this.append=function(){this.node=$("<div/>").addClass("zoomPreload").css("visibility","hidden").html(settings.preloadText);$(".zoomPad",el).append(this.node)};this.show=function(){this.node.top=(smallimage.oh-this.node.height())/2;this.node.left=(smallimage.ow-this.node.width())/2;this.node.css({top:this.node.top,left:this.node.left,position:"absolute",visibility:"visible"})};this.hide=function(){this.node.css("visibility","hidden")};return this}function Lens(){var $obj=this;this.node=$("<div/>").addClass("zoomPup");this.append=function(){$(".zoomPad",el).append($(this.node).hide());if(settings.zoomType=="reverse"){this.image=new Image();this.image.src=smallimage.node.src;$(this.node).empty().append(this.image)}};this.setdimensions=function(){this.node.w=(parseInt((settings.zoomWidth)/el.scale.x)>smallimage.w)?smallimage.w:(parseInt(settings.zoomWidth/el.scale.x));this.node.h=(parseInt((settings.zoomHeight)/el.scale.y)>smallimage.h)?smallimage.h:(parseInt(settings.zoomHeight/el.scale.y));this.node.top=(smallimage.oh-this.node.h-2)/2;this.node.left=(smallimage.ow-this.node.w-2)/2;this.node.css({top:0,left:0,width:this.node.w+"px",height:this.node.h+"px",position:"absolute",display:"none",borderWidth:1+"px"});if(settings.zoomType=="reverse"){this.image.src=smallimage.node.src;$(this.node).css({opacity:1});$(this.image).css({position:"absolute",display:"block",left:-(this.node.left+1-smallimage.bleft)+"px",top:-(this.node.top+1-smallimage.btop)+"px"})}};this.setcenter=function(){this.node.top=(smallimage.oh-this.node.h-2)/2;this.node.left=(smallimage.ow-this.node.w-2)/2;this.node.css({top:this.node.top,left:this.node.left});if(settings.zoomType=="reverse"){$(this.image).css({position:"absolute",display:"block",left:-(this.node.left+1-smallimage.bleft)+"px",top:-(this.node.top+1-smallimage.btop)+"px"})}largeimage.setposition()};this.setposition=function(e){el.mousepos.x=e.pageX;el.mousepos.y=e.pageY;var lensleft=0;var lenstop=0;function overleft(lens){return el.mousepos.x-(lens.w)/2<smallimage.pos.l}function overright(lens){return el.mousepos.x+(lens.w)/2>smallimage.pos.r}function overtop(lens){return el.mousepos.y-(lens.h)/2<smallimage.pos.t}function overbottom(lens){return el.mousepos.y+(lens.h)/2>smallimage.pos.b}lensleft=el.mousepos.x+smallimage.bleft-smallimage.pos.l-(this.node.w+2)/2;lenstop=el.mousepos.y+smallimage.btop-smallimage.pos.t-(this.node.h+2)/2;if(overleft(this.node)){lensleft=smallimage.bleft-1}else{if(overright(this.node)){lensleft=smallimage.w+smallimage.bleft-this.node.w-1}}if(overtop(this.node)){lenstop=smallimage.btop-1}else{if(overbottom(this.node)){lenstop=smallimage.h+smallimage.btop-this.node.h-1}}this.node.left=lensleft;this.node.top=lenstop;this.node.css({left:lensleft+"px",top:lenstop+"px"});if(settings.zoomType=="reverse"){if($.browser.msie&&$.browser.version>7){$(this.node).empty().append(this.image)}$(this.image).css({position:"absolute",display:"block",left:-(this.node.left+1-smallimage.bleft)+"px",top:-(this.node.top+1-smallimage.btop)+"px"})}largeimage.setposition()};this.hide=function(){img.css({opacity:1});this.node.hide()};this.show=function(){if(settings.zoomType!="innerzoom"&&(settings.lens||settings.zoomType=="drag")){this.node.show()}if(settings.zoomType=="reverse"){img.css({opacity:settings.imageOpacity})}};this.getoffset=function(){var o={};o.left=$obj.node.left;o.top=$obj.node.top;return o};return this}function Stage(){var $obj=this;this.node=$("<div class='zoomWindow'><div class='zoomWrapper'><div class='zoomWrapperTitle'></div><div class='zoomWrapperImage'></div></div></div>");this.ieframe=$('<iframe class="zoomIframe" src="javascript:\'\';" marginwidth="0" marginheight="0" align="bottom" scrolling="no" frameborder="0" ></iframe>');this.setposition=function(){this.node.leftpos=0;this.node.toppos=0;if(settings.zoomType!="innerzoom"){switch(settings.position){case"left":this.node.leftpos=(smallimage.pos.l-smallimage.bleft-Math.abs(settings.xOffset)-settings.zoomWidth>0)?(0-settings.zoomWidth-Math.abs(settings.xOffset)):(smallimage.ow+Math.abs(settings.xOffset));this.node.toppos=Math.abs(settings.yOffset);break;case"top":this.node.leftpos=Math.abs(settings.xOffset);this.node.toppos=(smallimage.pos.t-smallimage.btop-Math.abs(settings.yOffset)-settings.zoomHeight>0)?(0-settings.zoomHeight-Math.abs(settings.yOffset)):(smallimage.oh+Math.abs(settings.yOffset));break;case"bottom":this.node.leftpos=Math.abs(settings.xOffset);this.node.toppos=(smallimage.pos.t-smallimage.btop+smallimage.oh+Math.abs(settings.yOffset)+settings.zoomHeight<screen.height)?(smallimage.oh+Math.abs(settings.yOffset)):(0-settings.zoomHeight-Math.abs(settings.yOffset));break;default:this.node.leftpos=(smallimage.rightlimit+Math.abs(settings.xOffset)+settings.zoomWidth<screen.width)?(smallimage.ow+Math.abs(settings.xOffset)):(0-settings.zoomWidth-Math.abs(settings.xOffset));this.node.toppos=Math.abs(settings.yOffset);break}}this.node.css({left:this.node.leftpos+"px",top:this.node.toppos+"px"});return this};this.append=function(){$(".zoomPad",el).append(this.node);this.node.css({position:"absolute",display:"none",zIndex:5001});if(settings.zoomType=="innerzoom"){this.node.css({cursor:"default"});var thickness=(smallimage.bleft==0)?1:smallimage.bleft;$(".zoomWrapper",this.node).css({borderWidth:thickness+"px"})}$(".zoomWrapper",this.node).css({width:Math.round(settings.zoomWidth)+"px",borderWidth:thickness+"px"});$(".zoomWrapperImage",this.node).css({width:"100%",height:Math.round(settings.zoomHeight)+"px"});$(".zoomWrapperTitle",this.node).css({width:"100%",position:"absolute"});$(".zoomWrapperTitle",this.node).hide();if(settings.title&&zoomtitle.length>0){$(".zoomWrapperTitle",this.node).html(zoomtitle).show()}$obj.setposition()};this.hide=function(){switch(settings.hideEffect){case"fadeout":this.node.fadeOut(settings.fadeoutSpeed,function(){});break;default:this.node.hide();break}this.ieframe.hide()};this.show=function(){switch(settings.showEffect){case"fadein":this.node.fadeIn();this.node.fadeIn(settings.fadeinSpeed,function(){});break;default:this.node.show();break}if(isIE6&&settings.zoomType!="innerzoom"){this.ieframe.width=this.node.width();this.ieframe.height=this.node.height();this.ieframe.left=this.node.leftpos;this.ieframe.top=this.node.toppos;this.ieframe.css({display:"block",position:"absolute",left:this.ieframe.left,top:this.ieframe.top,zIndex:99,width:this.ieframe.width+"px",height:this.ieframe.height+"px"});$(".zoomPad",el).append(this.ieframe);this.ieframe.show()}}}function Largeimage(){var $obj=this;this.node=new Image();this.loadimage=function(url){loader.show();this.url=url;this.node.style.position="absolute";this.node.style.border="0px";this.node.style.display="none";this.node.style.left="-5000px";this.node.style.top="0px";document.body.appendChild(this.node);this.node.src=url};this.fetchdata=function(){var image=$(this.node);var scale={};this.node.style.display="block";$obj.w=image.width();$obj.h=image.height();$obj.pos=image.offset();$obj.pos.l=image.offset().left;$obj.pos.t=image.offset().top;$obj.pos.r=$obj.w+$obj.pos.l;$obj.pos.b=$obj.h+$obj.pos.t;scale.x=($obj.w/smallimage.w);scale.y=($obj.h/smallimage.h);el.scale=scale;document.body.removeChild(this.node);$(".zoomWrapperImage",el).empty().append(this.node);lens.setdimensions()};this.node.onerror=function(){alert("Problems while loading the big image.");throw"Problems while loading the big image."};this.node.onload=function(){$obj.fetchdata();loader.hide();el.largeimageloading=false;el.largeimageloaded=true;if(settings.zoomType=="drag"||settings.alwaysOn){lens.show();stage.show();lens.setcenter()}};this.setposition=function(){var left=-el.scale.x*(lens.getoffset().left-smallimage.bleft+1);var top=-el.scale.y*(lens.getoffset().top-smallimage.btop+1);$(this.node).css({left:left+"px",top:top+"px"})};return this}$(el).data("jqzoom",obj)};$.jqzoom={defaults:{zoomType:"standard",zoomWidth:300,zoomHeight:300,xOffset:10,yOffset:0,position:"right",preloadImages:true,preloadText:"Laddar zoom",title:true,lens:true,imageOpacity:0.4,alwaysOn:false,showEffect:"show",hideEffect:"hide",fadeinSpeed:"slow",fadeoutSpeed:"2000"},disable:function(el){var api=$(el).data("jqzoom");api.disable();return false},enable:function(el){var api=$(el).data("jqzoom");api.enable();return false},disableAll:function(el){jqzoompluging_disabled=true},enableAll:function(el){jqzoompluging_disabled=false}}})(jQuery);





/* =========================================================

// jquery.innerfade.js

// Datum: 2008-02-14
// Firma: Medienfreunde Hofmann & Baldes GbR
// Author: Torsten Baldes
// Mail: t.baldes@medienfreunde.com
// Web: http://medienfreunde.com

// based on the work of Matt Oakes http://portfolio.gizone.co.uk/applications/slideshow/
// and Ralf S. Engelschall http://trainofthoughts.org/

 *
 *  <ul id="news"> 
 *      <li>content 1</li>
 *      <li>content 2</li>
 *      <li>content 3</li>
 *  </ul>
 *  
 *  $('#news').innerfade({ 
 *	  animationtype: Type of animation 'fade' or 'slide' (Default: 'fade'), 
 *	  speed: Fading-/Sliding-Speed in milliseconds or keywords (slow, normal or fast) (Default: 'normal'), 
 *	  timeout: Time between the fades in milliseconds (Default: '2000'), 
 *	  type: Type of slideshow: 'sequence', 'random' or 'random_start' (Default: 'sequence'), 
 * 		containerheight: Height of the containing element in any css-height-value (Default: 'auto'),
 *	  runningclass: CSS-Class which the container get’s applied (Default: 'innerfade'),
 *	  children: optional children selector (Default: null)
 *  }); 
 *
 */
(function(a){a.fn.innerfade=function(b){return this.each(function(){a.innerfade(this,b)})};a.innerfade=function(b,c){var e={animationtype:"fade",speed:"normal",type:"sequence",timeout:2000,containerheight:"auto",runningclass:"innerfade",children:null};if(c){a.extend(e,c)}if(e.children===null){var g=a(b).children()}else{var g=a(b).children(e.children)}if(g.length>1){a(b).css("position","relative").css("height",e.containerheight).addClass(e.runningclass);for(var d=0;d<g.length;d++){a(g[d]).css("z-index",String(g.length-d)).css("position","absolute").hide()}if(e.type=="sequence"){setTimeout(function(){a.innerfade.next(g,e,1,0)},e.timeout);a(g[0]).show()}else{if(e.type=="random"){var f=Math.floor(Math.random()*(g.length));setTimeout(function(){do{h=Math.floor(Math.random()*(g.length))}while(f==h);a.innerfade.next(g,e,h,f)},e.timeout);a(g[f]).show()}else{if(e.type=="random_start"){e.type="sequence";var h=Math.floor(Math.random()*(g.length));setTimeout(function(){a.innerfade.next(g,e,(h+1)%g.length,h)},e.timeout);a(g[h]).show()}else{alert("Innerfade-Type must either be 'sequence', 'random' or 'random_start'")}}}}};a.innerfade.next=function(d,b,e,c){if(b.animationtype=="slide"){a(d[c]).slideUp(b.speed);a(d[e]).slideDown(b.speed)}else{if(b.animationtype=="fade"){a(d[c]).fadeOut(b.speed);a(d[e]).fadeIn(b.speed,function(){removeFilter(a(this)[0])})}else{alert("Innerfade-animationtype must either be 'slide' or 'fade'")}}if(b.type=="sequence"){if((e+1)<d.length){e=e+1;c=e-1}else{e=0;c=d.length-1}}else{if(b.type=="random"){c=e;while(e==c){e=Math.floor(Math.random()*d.length)}}else{alert("Innerfade-Type must either be 'sequence', 'random' or 'random_start'")}}setTimeout((function(){a.innerfade.next(d,b,e,c)}),b.timeout)}})(jQuery);






/* FOR YOUTUBE-PLAYER PLUGIN  */
//-------------------------------------------------
//		youtube playlist jquery plugin
//		Created by dan@geckonm.com
//		www.geckonewmedia.com
//
//		v1.1 - updated to allow fullscreen 
//			 - thanks Ashraf for the request
//-------------------------------------------------

jQuery.fn.ytplaylist = function(options) {
 
  // default settings
  var options = jQuery.extend( {
  holderId: 'video-container',
	playerHeight: '480',
	playerWidth: '853',
	addThumbs: false,
	thumbSize: 'small',
	showInline: false,
	autoPlay: true,
	showRelated: true,
	allowFullScreen: true
  },options);
 
  return this.each(function() {
							
   		var selector = $(this);
		
		var autoPlay = "";
		var showRelated = "&rel=0";
		var fullScreen = "";
		if(options.autoPlay) autoPlay = "&autoplay=0"; 
		if(options.showRelated) showRelated = "&rel=1"; 
		if(options.allowFullScreen) fullScreen = "&fs=1"; 
		
		//throw a youtube player in
		function play(id)
		{
		   var html  = '';
	
		   html += '<object height="'+options.playerHeight+'" width="'+options.playerWidth+'">';
		   html += '<param name="movie" value="http://www.youtube.com/v/'+id+autoPlay+showRelated+fullScreen+'"> </param>';
		   html += '<param name="wmode" value="transparent"> </param>';
		   if(options.allowFullScreen) { 
		   		html += '<param name="allowfullscreen" value="true"> </param>'; 
		   }
		   html += '<embed src="http://www.youtube.com/v/'+id+autoPlay+showRelated+fullScreen+'"';
		   if(options.allowFullScreen) { 
		   		html += ' allowfullscreen="true" '; 
		   	}
		   html += 'type="application/x-shockwave-flash" wmode="transparent"  height="'+options.playerHeight+'" width="'+options.playerWidth+'"></embed>';
		   html += '</object>';
			
		   return html;
		   
		};
	
	
	/*	MY IFRAME VERSION. NO PREVIEW
		function play(id)
		{
		   var html  = '';
	
		   html += '<iframe class="youtube-iframe" height="'+options.playerHeight+'" width="'+options.playerWidth+'" src="http://www.youtube.com/embed/'+id+autoPlay+showRelated+fullScreen+'" frameborder="0"';
		   if(options.allowFullScreen) { 
		   		html += ' allowfullscreen>'; 
		   }
		   html += '</iframe>';
			
		   return html;
		   
		};
*/


		//grab a youtube id from a (clean, no querystring) url (thanks to http://jquery-howto.blogspot.com/2009/05/jyoutube-jquery-youtube-thumbnail.html)
		function youtubeid(url) {
			var ytid = url.match("[\\?&]v=([^&#]*)");
			ytid = ytid[1];
			return ytid;
		};
		
		
		//load inital video
		var firstVid = selector.children("li:first-child").addClass("currentvideo").children("a").attr("href");
		$("#"+options.holderId+"").html(play(youtubeid(firstVid)));
		
		//load video on request
		selector.children("li").children("a").click(function() {
			
			if(options.showInline) {
				$("li.currentvideo").removeClass("currentvideo");
				$(this).parent("li").addClass("currentvideo").html(play(youtubeid($(this).attr("href"))));
			}
			else {
				$("#"+options.holderId+"").html(play(youtubeid($(this).attr("href"))));
				$(this).parent().parent("ul").find("li.currentvideo").removeClass("currentvideo");
				$(this).parent("li").addClass("currentvideo");
			}

			return false;
		});
		
		//do we want thumbs with that?
		if(options.addThumbs) {
			
			selector.children().each(function(i){
											  
				var replacedText = $(this).text();
				
				if(options.thumbSize == 'small') {
					var thumbUrl = "http://img.youtube.com/vi/"+youtubeid($(this).children("a").attr("href"))+"/2.jpg";
				}
				else {
					var thumbUrl = "http://img.youtube.com/vi/"+youtubeid($(this).children("a").attr("href"))+"/0.jpg";
				}

				$(this).children("a").empty().html("<img src='"+thumbUrl+"' alt='"+replacedText+"' />"+replacedText).attr("title", replacedText);

			});
		}
  });
};





