(function(a){a.fn.clickarea=function(c){var c=a.extend({},a.fn.clickarea.defaults,c);var b=this.has(c.selector);b.each(function(){var f=a(this);var e=f.find(c.selector).first();var d=f.find(c.toggle);if(e){f.css({cursor:"pointer"}).click(function(g){self.location.href=e.attr("href")})}});return this};a.fn.clickarea.defaults={selector:"a.button",speed:"fast"}})(jQuery); jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g1){for(var c=0;c1||a.childNodes[0].nodeType!=3)){FLIR.prepare(a);FLIR._replace_tree(a,c);continue}if(a.innerHTML==""){continue}var f=c.options.output;if(FLIR.isIE6&&(a.flirIE6PNG=(f=="png"||(f=="auto"&&FLIR.getStyle(a,"background-color")=="transparent")))){FLIR._Rimg(a,c,true)}else{if(c.replaceBackground){FLIR._Rbkg(a,c)}else{FLIR._Rimg(a,c)}}a.className+=" flir-replaced";a.flirReplaced=true;if(typeof FLIR.options.onreplacedchild=="function"){FLIR.options.onreplacedchild(e,c)}}},_Rbkg:function(e,d){if(!(args=FLIR.pcall("replaceBackground",arguments))){return}e=args[0];d=args[1];var c=this.saveObject(e);var a=d.URL(e);if(FLIR.options.bkgCheckForBlock){if(FLIR.getStyle(e,"display")!="block"){e.style.display="block"}}var b=new Image();b.onload=function(){FLIR.flirElements[c].style.width=this.width+"px";FLIR.flirElements[c].style.height=this.height+"px";if(FLIR.hoverEnabled&&d!=d.hoverStyle){var f=new Image();e.flirHoverURL=f.src=d.hoverStyle.URL(e)}};b.src=a;e.style.background='url("'+a.replace(/ /g,"%20")+'") no-repeat';e.flirOrig=a;e.oldTextIndent=e.style.textIndent;e.style.textIndent="-9999px"},_Rimg:function(f,e,d){if(!(args=FLIR.pcall("replaceMethodOverlay",arguments))){return}f=args[0];e=args[1];var c=this.saveObject(f);var a=document.createElement("IMG");var b=e.URL(f);a.alt=f.innerHTML;if(FLIR.hoverEnabled&&e!=e.hoverStyle){a.onload=function(){var g=new Image();f.flirHoverURL=g.src=e.hoverStyle.URL(f,a.alt)}}if(a.onerror){a.onerror=function(){var g=document.createElement("SPAN");g.innerHTML=a.alt;try{f.replaceChild(g,a)}catch(h){}}}a.flirImage=true;a.className="flir-image";a.style.border="none";if(d){a.src=this.options.path+"spacer.png";if(f.offsetWidth){a.style.width=f.offsetWidth+"px";a.style.height=f.offsetHeight+"px"}a.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'", sizingMethod="image")';f.flirOrig=b}else{a.src=b;f.flirOrig=a.src}f.innerHTML="";f.appendChild(a)},saveObject:function(a){if(typeof a.flirId=="undefined"){a.flirId=this.generateUID();this.flirElements[a.flirId]=a}return a.flirId},generateUID:function(){var a="flir-";if(typeof __flir_uid_count=="undefined"){__flir_uid_count=0}else{__flir_uid_count++}return a+__flir_uid_count},calcDPI:function(){if(screen.logicalXDPI){var b=parseInt(screen.logicalXDPI)}else{var d=document.cookie.match(/(\d+)<\/dpi>/);if(d){this.dpi=d[1];return}var c=document.createElement("DIV");c.style.position="absolute";c.style.visibility="hidden";c.style.border=c.style.padding=c.style.margin="0";c.style.height=c.style.width="1in";document.body.appendChild(c);var b=parseInt(c.offsetHeight);document.body.removeChild(c);var a=new Date();a.setDate(new Date().getDate()+365);document.cookie="dpi="+this.dpi+";expires="+a.toGMTString()+";path=/"}if(b>0){this.dpi=b}},isIgnoredEl:function(a){return((","+this.options.ignoredEls+",").indexOf(","+a.nodeName+",")>-1)},sanitizeHTML:function(a){return a.replace(/<[^>]+>/g,"")},isFStyle:function(a){if(!a){return false}return(typeof a.cssMap!="undefined")}};__flirstyle_instances=0;function FLIRStyle(a,c){__flirstyle_instances++;this.uid=__flirstyle_instances;this.replaceBackground=false;this.hoverStyle=c&&FLIR.isFStyle(c)?c:this;this.options={};this.defaults={mode:"static",output:"auto",fixBaseline:false,hq:false,css:{}};this.cssMap={"background-color":"Background",color:"Color","font-family":"Font","font-size":"FontSize","letter-spacing":"Measurement","line-height":"LineHeight","text-align":"Default","font-stretch":"Default","font-style":"FontStyle","font-variant":"Default","font-weight":"Weight",opacity:"Default","text-decoration":"Default"};for(var b in this.defaults){this.options[b]=this.defaults[b]}if(a&&typeof a.css=="string"){a.css=this.parse_css_string(a.css)}this.loadopts(a)}FLIRStyle.prototype.loadopts=function(b){for(var c in this.cssMap){this.options.css[c]=null}if(typeof this.loadopts_compat=="function"){b=this.loadopts_compat(b)}if(typeof b!="undefined"){for(var c in b){if(b[c]==null){continue}if(typeof this[c]!="undefined"){this[c]=b[c]}else{if(c=="css"){for(var a in b[c]){prop=a.replace(/[A-Z]/g,function(d){return"-"+d.toLowerCase()});this.options[c][prop]=b[c][a]}}else{this.options[c]=b[c]}}}}};FLIRStyle.prototype.parse_css_string=function(c){var d=c.split(";");var a={};var e;for(var b=0;b-1){var b=FLIR.getParentNode(d);var a=FLIR.getStyle(b,"background-color");if(typeof __flirstyle_root_obj=="undefined"){__flirstyle_root_obj=FLIR.getParentNode(document.body)}while(a.search(/^(transparent|none)$/i)>-1&&b!=__flirstyle_root_obj){b=FLIR.getParentNode(b);a=FLIR.getStyle(b,"background-color")}return this.getColor(d,a)}else{return this.getColor(d,c)}};FLIRStyle.prototype.getWeight=function(c,b){var a=c.nodeName=="STRONG"||FLIR.getParentNode(c).nodeName=="STRONG"?"bold":b;switch(a.toString()){case"100":case"200":case"300":case"lighter":return"-1";case"400":case"normal":return"";case"500":case"600":case"700":case"bold":return"1";case"800":case"900":case"bolder":return"2"}};FLIRStyle.prototype.getLineHeight=function(c,b){var a=this.getMeasurement(c,b)/c.flirFontSize;return Math.round((a*100000))/100000};FLIRStyle.prototype.getFont=function(b,a){if(a.indexOf(",")){a=a.split(",")[0]}return a.replace(/['"]/g,"").toLowerCase()};FLIRStyle.prototype.getColor=function(b,a){switch(a){case"transparent":case"none":return"";default:if(a.substr(0,1)=="#"){a=a.substr(1)}return a.replace(/['"\(\) ]|rgba?/g,"").toLowerCase()}};FLIRStyle.prototype.getFontSize=function(o,val){var px=this.getMeasurement(o,val,true);var prepx=px;if("*/+-".indexOf(val[0])>-1){try{px=Math.round((parseFloat(eval(px.toString().concat(val))))*10000)/10000}catch(err){px=16}}o.flirFontSize=px;return px};FLIRStyle.prototype.getMeasurement=function(g,f,d){var c,b,a;if(f=="normal"||f=="none"){return""}if(f.indexOf("px")>-1){c=Math.round(parseFloat(f))}else{if(f.indexOf("pt")>-1){var e=parseFloat(f);c=e/(72/FLIR.dpi)}else{if((b=(f.indexOf("em")>-1))||(a=(f.indexOf("%")>-1))){if(!g.flirFontSize){var h=document.createElement("DIV");h.style.padding=h.style.border="0";h.style.position="absolute";h.style.visibility="hidden";if(d){h.style.lineHeight="100%"}h.innerHTML="FlirTest";g.appendChild(h);c=h.offsetHeight;g.removeChild(h)}else{c=g.flirFontSize}}}}return c};FLIRStyle.prototype.copyObject=function(b){var c={};for(var a in b){c[a]=b[a]}return c};FLIRStyle.prototype.toString=function(){return this.uid};FLIR.detectBrowser=function(){FLIR.isIE=(navigator.userAgent.toLowerCase().indexOf("msie")>-1&&!window.opera);FLIR.isIE6=(typeof document.body.style.maxHeight=="undefined")};FLIR.getElements=function(r){var q=[];if(document.querySelectorAll){var e=false;try{q=document.querySelectorAll(r);e=true}catch(f){e=false}if(e){return q}}var i,n,l,j,r,d,h,o,k;d=r;o=false;if(d.indexOf(" ")>-1){var g=d.split(" ");d=g[0];o=g[1]}else{if(d.substr(0,1)=="#"){return document.getElementById(d.substr(1))}}var c=false;if(d.indexOf("#")>-1){c=d.split("#")[1];r=d.split("#")[0]}var m=false;if(d.indexOf(".")>-1){m=d.split(".")[1];r=d.split(".")[0]}i=document.getElementsByTagName(r);for(var a=0;a-1){c=c.split("-")[0]+c.split("-")[1].substr(0,1).toUpperCase()+c.split("-")[1].substr(1)}var b=a.currentStyle[c]}else{if(window.getComputedStyle){var b=document.defaultView.getComputedStyle(a,"").getPropertyValue(c)}}return b};FLIR.getChildren=function(c){var b=[];if(c&&c.hasChildNodes()){for(var a in c.childNodes){if(c.childNodes[a]&&c.childNodes[a].nodeType==1){b[b.length]=c.childNodes[a]}}}return b};FLIR.getParentNode=function(b){var a=b.parentNode;while(a!=document&&a.nodeType!=1){a=a.parentNode}return a};FLIR.hasClass=function(a,b){return(a&&a.className&&a.className.indexOf(b)>-1)};FLIR.evsrc=function(a){var b;if(a.target){b=a.target}else{if(a.srcElement){b=a.srcElement}}if(b.nodeType==3){b=b.parentNode}return b};FLIR.addHover=function(a){if(!(args=FLIR.pcall("addHover",arguments))){return}a=args[0];a.flirHasHover=true;if(a.addEventListener){a.addEventListener("mouseover",FLIR.hover,false);a.addEventListener("mouseout",FLIR.hover,false)}else{if(a.attachEvent){a.attachEvent("onmouseover",function(){FLIR.hover(window.event)});a.attachEvent("onmouseout",function(){FLIR.hover(window.event)})}}};FLIR.flirIERepObj=[];FLIR.flirIEHovEls=[];FLIR.flirIEHovStyles=[];FLIR.hover=function(m){console.log("hover");var b=FLIR.evsrc(m);var p=b;var s=b.flirHasHover;var j=b;var n=(m.type=="mouseover");while(b!=document.body&&!b.flirMainObj){b=FLIR.getParentNode(b);if(!s){s=b.flirHasHover;j=b}}if(b==document.body){return}var c=b.flirStyle;if(n&&c!=c.hoverStyle){c=c.hoverStyle}if(!(args=FLIR.pcall("hover",[n,p,b,j]))){return}n=args[0];p=args[1];b=args[2];j=args[3];var k=FLIR.getChildren(j);if(k.length==0||(k.length==1&&(k[0].flirImage||k[0].flirHasHover))){k=[j]}else{if(k.length==1&&!FLIR.isIgnoredEl(k[0])){var f=FLIR.getChildren(k[0]);if(f.length>0){if((f.length==1&&!f[0].flirImage)||f.length>1){k=f}}}}var q;for(var h=0;h-1?a.split(","):a)))}; /* jQuery Tools 1.2.5 Overlay - Overlay base. Extend it. NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. http://flowplayer.org/tools/overlay/ Since: March 2008 Date: Wed Sep 22 06:02:10 2010 +0000 */ (function(a){function t(d,b){var c=this,j=d.add(c),o=a(window),k,f,m,g=a.tools.expose&&(b.mask||b.expose),n=Math.random().toString().slice(10);if(g){if(typeof g=="string")g={color:g};g.closeOnClick=g.closeOnEsc=false}var p=b.target||d.attr("rel");f=p?a(p):d;if(!f.length)throw"Could not find Overlay: "+p;d&&d.index(f)==-1&&d.click(function(e){c.load(e);return e.preventDefault()});a.extend(c,{load:function(e){if(c.isOpened())return c;var h=q[b.effect];if(!h)throw'Overlay: cannot find effect : "'+b.effect+ '"';b.oneInstance&&a.each(s,function(){this.close(e)});e=e||a.Event();e.type="onBeforeLoad";j.trigger(e);if(e.isDefaultPrevented())return c;m=true;g&&a(f).expose(g);var i=b.top,r=b.left,u=f.outerWidth({margin:true}),v=f.outerHeight({margin:true});if(typeof i=="string")i=i=="center"?Math.max((o.height()-v)/2,0):parseInt(i,10)/100*o.height();if(r=="center")r=Math.max((o.width()-u)/2,0);h[0].call(c,{top:i,left:r},function(){if(m){e.type="onLoad";j.trigger(e)}});g&&b.closeOnClick&&a.mask.getMask().one("click", c.close);b.closeOnClick&&a(document).bind("click."+n,function(l){a(l.target).parents(f).length||c.close(l)});b.closeOnEsc&&a(document).bind("keydown."+n,function(l){l.keyCode==27&&c.close(l)});return c},close:function(e){if(!c.isOpened())return c;e=e||a.Event();e.type="onBeforeClose";j.trigger(e);if(!e.isDefaultPrevented()){m=false;q[b.effect][1].call(c,function(){e.type="onClose";j.trigger(e)});a(document).unbind("click."+n).unbind("keydown."+n);g&&a.mask.close();return c}},getOverlay:function(){return f}, getTrigger:function(){return d},getClosers:function(){return k},isOpened:function(){return m},getConf:function(){return b}});a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(e,h){a.isFunction(b[h])&&a(c).bind(h,b[h]);c[h]=function(i){i&&a(c).bind(h,i);return c}});k=f.find(b.close||".close");if(!k.length&&!b.close){k=a('');f.prepend(k)}k.click(function(e){c.close(e)});b.load&&c.load()}a.tools=a.tools||{version:"1.2.5"};a.tools.overlay={addEffect:function(d, b,c){q[d]=[b,c]},conf:{close:null,closeOnClick:true,closeOnEsc:true,closeSpeed:"fast",effect:"default",fixed:!a.browser.msie||a.browser.version>6,left:"center",load:false,mask:null,oneInstance:true,speed:"normal",target:null,top:"10%"}};var s=[],q={};a.tools.overlay.addEffect("default",function(d,b){var c=this.getConf(),j=a(window);if(!c.fixed){d.top+=j.scrollTop();d.left+=j.scrollLeft()}d.position=c.fixed?"fixed":"absolute";this.getOverlay().css(d).fadeIn(c.speed,b)},function(d){this.getOverlay().fadeOut(this.getConf().closeSpeed, d)});a.fn.overlay=function(d){var b=this.data("overlay");if(b)return b;if(a.isFunction(d))d={onBeforeLoad:d};d=a.extend(true,{},a.tools.overlay.conf,d);this.each(function(){b=new t(a(this),d);s.push(b);a(this).data("overlay",b)});return d.api?b:this}})(jQuery); /* jQuery Tools 1.2.5 / Expose - Dim the lights NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. http://flowplayer.org/tools/toolbox/expose.html Since: Mar 2010 Date: Wed Sep 22 06:02:10 2010 +0000 */ (function(b){function k(){if(b.browser.msie){var a=b(document).height(),d=b(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a-d<20?d:a]}return[b(document).width(),b(document).height()]}function h(a){if(a)return a.call(b.mask)}b.tools=b.tools||{version:"1.2.5"};var l;l=b.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,startOpacity:0,color:"#fff",onLoad:null, onClose:null}};var c,i,e,g,j;b.mask={load:function(a,d){if(e)return this;if(typeof a=="string")a={color:a};a=a||g;g=a=b.extend(b.extend({},l.conf),a);c=b("#"+a.maskId);if(!c.length){c=b("
").attr("id",a.maskId);b("body").append(c)}var m=k();c.css({position:"absolute",top:0,left:0,width:m[0],height:m[1],display:"none",opacity:a.startOpacity,zIndex:a.zIndex});a.color&&c.css("backgroundColor",a.color);if(h(a.onBeforeLoad)===false)return this;a.closeOnEsc&&b(document).bind("keydown.mask",function(f){f.keyCode== 27&&b.mask.close(f)});a.closeOnClick&&c.bind("click.mask",function(f){b.mask.close(f)});b(window).bind("resize.mask",function(){b.mask.fit()});if(d&&d.length){j=d.eq(0).css("zIndex");b.each(d,function(){var f=b(this);/relative|absolute|fixed/i.test(f.css("position"))||f.css("position","relative")});i=d.css({zIndex:Math.max(a.zIndex+1,j=="auto"?0:j)})}c.css({display:"block"}).fadeTo(a.loadSpeed,a.opacity,function(){b.mask.fit();h(a.onLoad);e="full"});e=true;return this},close:function(){if(e){if(h(g.onBeforeClose)=== false)return this;c.fadeOut(g.closeSpeed,function(){h(g.onClose);i&&i.css({zIndex:j});e=false});b(document).unbind("keydown.mask");c.unbind("click.mask");b(window).unbind("resize.mask")}return this},fit:function(){if(e){var a=k();c.css({width:a[0],height:a[1]})}},getMask:function(){return c},isLoaded:function(a){return a?e=="full":e},getConf:function(){return g},getExposed:function(){return i}};b.fn.mask=function(a){b.mask.load(a);return this};b.fn.expose=function(a){b.mask.load(a,this);return this}})(jQuery); (function($) { $.fn.book = function(settings) { var config = {}; if (settings) $.extend(config, settings); var container = this; var data = $('div.data > div', this); var pages = $('div.pages > div', this); var action = $('div.action', this); var links = $('div.links > a', this); var index_actual = 0; var show = function(selector, index) { var actual = pages.filter('.'+selector); var next = data.eq(index); // change link links.filter('.'+selector).attr({ 'href': next.find('a').attr('href'), 'title': next.find('a').attr('title') }); // the tooltip plugin does not notice when only the title of an elements changes, // we have to change to tooltip content manually $('#tooltip .content').text( next.find('a').attr('title') ); // switch actual.fadeOut('fast', function(){ actual.html(next.clone()); actual.fadeIn('fast'); }); } $('.next', action).click(function(e){ e.preventDefault(); var next = getIndex(index_actual+1); show('first', next); setTimeout(function(){ show('second', getIndex(next+1)); }, 300); index_actual = next; }); $('.prev', action).click(function(e){ e.preventDefault(); var prev = getIndex(index_actual-1); setTimeout(function(){ show('first', prev); }, 300); show('second', index_actual); index_actual = prev; }); var getIndex = function(index){ if (index > data.length-1) return 0; if (index < 0) return data.length-1; return index; } show('first', 0); show('second', 1); return this; }; })(jQuery); // tooltip plugin with event delegation $.fn.tooltip = function(selector) { $('body').append('
'); var el_tooltip = $('#tooltip'); var el_tooltip_content = $('#tooltip .content'); return this.each(function(){ $(this) .delegate(selector, 'mouseenter', function(e, el){ var $target = $(this); el_tooltip_content.text( $target.attr('title') ); $target.attr("title", ''); el_tooltip.show(); }) .delegate(selector, 'mousemove', function(e){ el_tooltip.css( { left: e.pageX + 25, top: e.pageY + 25 } ); }) .delegate(selector, 'mouseleave', function(e, el){ $(this).attr('title', el_tooltip_content.text() ); el_tooltip.css('display', 'none'); el_tooltip.hide(); }); }); } $(function(){ var base = $('base').attr('href'); var ie = ($('html.ie').length > 0) ? true : false; var fadeSpeed = ie ? 0 : 500; // align text on labels var labelHeight = $('.scroller .label:eq(0)').height() / 2; $('.scroller .label span').each(function () { var top = Math.floor(labelHeight - ($(this).height() / 2)); $(this).css('padding-top', top); }); // its neccessary because elements with display none dont have dimensions $('.scroller .label').css({'display': 'none', 'visibility': 'visible'}); var settings = { fixed:false, top:80, left:"center", speed: fadeSpeed, closeSpeed: fadeSpeed, onBeforeLoad : function () { // grab wrapper element inside content var ov = this.getOverlay(); var wrap = ov.find("#layerContent"); wrap.load(this.getTrigger().attr("href"), function () { FLIR.replace($('h1', this), new FLIRStyle({hq: true, mode: 'wrap'})); }); }, onClose : function() { // empty content // in IE8 a hidden video continues playing. so we would hear sound if we close the overlay var ov = this.getOverlay(); ov.find("#layerContent").empty(); }, expose:{ color: '#ede4ff', opacity: 0.7, closeSpeed: 500, zIndex:200001 } }; $('#home .box').click(function(e) { var l = $(this).find('a'); if (l.hasClass('layerTrigger')) { l.overlay(settings).load(); } else { var url = l.attr('href'); if (/^http/.test(url)) { window.open(url); } else { window.location.href = base + url; } } }); $('.printLink').click(function(e) { e.preventDefault(); var link = document.location + '?print=true'; window.open(link, 'printRecipe', 'width=800, height=900, scrollbars=yes'); }); $('.layerTrigger').overlay({ fixed:false, top:80, left:"center", speed: fadeSpeed, closeSpeed: fadeSpeed, onBeforeLoad : function () { // grab wrapper element inside content var ov = this.getOverlay(); var wrap = ov.find("#layerContent"); wrap.load(this.getTrigger().attr("href"), function () { FLIR.replace($('h1', this), new FLIRStyle({hq: true, mode: 'wrap'})); }); }, onClose : function() { // empty content // in IE8 a hidden video continues playing. so we would hear sound if we close the overlay var ov = this.getOverlay(); ov.find("#layerContent").empty(); }, expose:{ color: '#ede4ff', opacity: 0.7, closeSpeed: 500, zIndex:200001 } }); // set background images for ol lis $('.text_list_box li').each(function(i) { $(this).css('background-image', 'url(' + (base + 'main/images/ol.' + (i + 1) + '.png') + ')'); }); // add tooltips //$('div.images, .ttWrapper, #book').tooltip('a[title]'); $('div.images, .ttWrapper, #book, #dekotippsScroller').tooltip('a'); // init book on news/season/ $('#book').book(); // label handling var groupSelector = $('#categories li'); var currentGroup = null; var currentGroupLabels = null; groupSelector.bind('click', updateGroup); $('#labelNext').bind('click', next); $('#labelPrev').bind('click', prev); function next(e) { var currentLi = $('.current', currentGroup); var nextLi = currentLi.next('li'); if (nextLi.length > 0) { currentLi.hide().removeClass('current'); nextLi.show().addClass('current'); } } function prev(e) { var currentLi = $('.current', currentGroup); var prevLi = currentLi.prev('li'); if (prevLi.length > 0) { currentLi.hide().removeClass('current'); prevLi.show().addClass('current'); } } function updateGroup() { var $this = $(this); // remove current class and add clicked groupSelector.removeClass('current'); $this.addClass('current'); // hide all groups and show clicked by rel $('#labelGroups ul').hide(); currentGroup = $('#' + $this.attr('rel')); currentGroup.show(); currentGroupLabels = $('li', currentGroup); $('.current', currentGroup).show(); } // init groupSelector.first().click(); // animation of boxes on homepage var speed=500; $(".box").each(function(){ var obj=$(this); obj.stop(true, false).animate({ "margin-top":"97px" },speed+=500); obj.hover(function(){ obj.animate({"margin-top":'10px'},200) },function(){ obj.stop(true, false).animate({"margin-top":"97px"},200); }) }); var pageWidth = $('.wrap-inner').innerWidth(); $(".main-nav >li").each(function(){ $(this).hover(function(){ $(">a",$(this)).addClass("selected"); $("ul",$(this)).show(); },function(){ $("ul",$(this)).hide(); $(">a",$(this)).removeClass("selected"); }) }); var speed2 = 1000; var num = 4; $(".show-con .images").each(function(index){ $(this).delay(speed2*index).fadeIn(speed2,function(){num--;}) }); }); $(window).load(function() { var ie = ($('html.ie').length > 0) ? true : false; var scroller = $('.scroller'); var scrollerWrapper = $('.scrollerWrapper'); var fadeSpeed = ie ? 0 : 500; var fadeoutSpeed = fadeSpeed/5; if (scroller.length > 0) { var scrollerItem = $('li', scroller), targetWidth = $('.scrollerImg:eq(0)', scroller).width(), factor = 50, initialWidth = targetWidth - factor, difference = factor / 2, offset = scrollerWrapper.offset().left, scrollerWidth = $('.wrap-inner').width(), scrollerInnerWidth = 0, timeout = null, mouseX = null; // init width scrollerInnerWidth = parseInt(scrollerItem.outerWidth(true) * scrollerItem.length, 10) +34; scroller.width(scrollerInnerWidth); // reduce image size scroller.find('.scrollerImg').width(initialWidth); // keep mouse position available $(document).mousemove(function(e){ mouseX = e.pageX - offset; }); scroller.hover ( function(){ timeout = setInterval(function() { var scrollerLeft = parseInt(scroller.css('left'), 10); var scrollEnd = scrollerInnerWidth - (scrollerLeft * (-1)); var scrollerCenter = Math.floor(scrollerWidth / 2); var percent = Math.floor(Math.abs((((mouseX - scrollerCenter) / scrollerCenter) * 100))); var scrollSpeed = percent / 20; var range = 30; if (mouseX > scrollerCenter) { // right side of the scroller // move left if (scrollerInnerWidth > scrollerWidth && (scrollEnd > scrollerWidth) && percent > range) scroller.css('left', (scrollerLeft - scrollSpeed)); } else { // left side of the scroller // move right if (scrollerLeft < 0 && percent > range) scroller.css('left', (scrollerLeft + scrollSpeed)); } }, 5); }, function () { clearInterval(timeout); } ); fadeSpeed = ($('html.lte8').length) ? 0 : 500; scrollerItem.hover( function () { $('.scrollerImgShopMouseover', this).stop(true, false).fadeTo(fadeSpeed, 1, function() { /* IE7 hack */ $(this).css('filter', 'none !important') }); $('.scrollerImg', this).stop().animate({'width': (targetWidth), 'top': '-10', 'left': (difference * (-1))}, 300); $('.label', this).fadeIn(fadeSpeed); }, function () { $('.scrollerImgShopMouseover', this).stop(true, false).fadeTo(fadeSpeed, 0); $('.label', this).fadeOut(fadeoutSpeed); $('.scrollerImg', this).stop().animate({'width': initialWidth, 'top': 0, 'left': 0}, 300); } ); } // products $('.pHover').each (function () { var currentParent = $(this), hoverItem = $('.hover', currentParent); hoverItem.hide(); $('a', currentParent).hover( function() { hoverItem.fadeIn(fadeSpeed); }, function() { hoverItem.fadeOut(fadeSpeed); } ); }); });