/*
This file will contain all of your custom skin JavaScript.
*/
/* Modernizr 2.7.1 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-csstransforms3d-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load
*/
;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.7.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;fForum');
var $shop_link = $('Butik');
$forum_link.prependTo('#siteNavTree > ul.homepage');
$shop_link.prependTo('#siteNavTree > ul.homepage');
isMobile();
jQuery(window).resize(function(){
if ( timer ) {clearTimeout(timer);}
var timer = setTimeout( "isMobile()", 100);
});
setTimeout( "fixedMenu()", 500);
$('#fixedMenuBtn').live('click', function(ev){
ev.preventDefault();
$('#handler-right').attr('checked', !$('#handler-right').attr('checked'));
});
// SHOW LOGIN FORM
$(".login-link").click( function() {
$(".login-links").fadeOut( function() {
$(".login form").fadeIn();
});
return false;
});
// Reset Text Inputs
$("[resetval]").each( function() {
var sval = $(this).val();
var resetval = $(this).attr("resetval");
if (sval == "")
$(this).val(resetval);
});
$("[resetval]").focus( function() {
var resetval = $(this).attr("resetval");
var textval = $(this).val();
if (textval == resetval)
$(this).val('');
});
$("[resetval]").blur( function() {
var resetval = $(this).attr("resetval");
var textval = $(this).val();
if (textval == resetval || textval=='')
$(this).val(resetval);
});
//Dropdowns
$(".dropdown").parents("span").find("span").addClass("drop-link");
$("body").click( function() {
$(".dropdown").hide();
});
$(".drop-link").click( function() {
$(".dropdown").hide();
var d = $(this).find("~ .dropdown");
d.slideDown('fast');
});
// Button CSS for deeply rooted buttons
$("input[type=submit]").addClass("btn");
$("input[type=button]").addClass("btn");
$(".commentActions input").addClass("btn");
$(".commentActions a").addClass("btn");
$("#deki-page-alerts div.toggle a").attr("title","Manage notifications");
$(".page a.disabled").parent().hide();
});
function isMobile(){
var left_nav = document.getElementsByClassName('left-navigation')[0];
if(jQuery(window).width() < 768){
// move .left-navigation to top
$(left_nav).css({'height': '100%'}).prependTo('body');
// insert checkbox and label if not already there
if (!$('#handler-right').length){
var $checkbox = $('');
var $fixedMenuBtn = $('');
$checkbox.prependTo('body');
$fixedMenuBtn.appendTo('.splash');
}
} else {
// move .left-navigation back to .highlight
$(left_nav).prependTo('.highlight');
}
}
var unpin = 30
, affixed;
function fixedMenu(){
$s = $('.splash');
$leftNav = $('.left-navigation');
$content = $('.content');
var dwHierarchyTop = $('.dw-hierarchy').offset().top - 10;
var dwHierarchyLeft = $('.dw-hierarchy').offset().left -10;
var splashOuterHeight = ($s.length) ? $s.outerHeight(true): 0;
var leftNavTop = $leftNav.offset().top;
$(window).scroll(function(){
if ($s.length && (Deki.EditorInstance.Instance === null)){
if ($(this).scrollTop() > dwHierarchyTop){
$s.addClass('fixed-splash').css('padding-left', dwHierarchyLeft + 'px');
$content.css('padding-top', splashOuterHeight + 'px');
if(!$('body > .splash').length){
$('.splash').appendTo('body');
}
if(jQuery(window).width() < 768){
$leftNav.css('padding-top', (splashOuterHeight +15) + 'px');
}
} else {
$s.removeClass('fixed-splash').css('padding-left', 0);
$content.css('padding-top', '0px');
if($('body > .splash').length){
$('.splash').insertBefore('.page-tools');
}
$leftNav.css('padding-top', '0px');
}
}
var $window = $(window)
, $element = $leftNav
, scrollHeight = $(document).height()
, scrollTop = $window.scrollTop()
, position = $element.offset()
, offset = {bottom: 10, top: (leftNavTop - splashOuterHeight - 15)}
, offsetBottom = offset.bottom
, offsetTop = offset.top
, reset = 'affix affix-top affix-bottom'
, affix;
if ($window.height() <= $element.height() || $element.parent().height() <= $element.height()){
$element.removeClass(reset);
return;
}
affix = unpin !== null && (scrollTop + unpin <= position.top) ?
false : (position.top + $element.height() >= scrollHeight - offsetBottom) ?
'bottom' : scrollTop <= offsetTop ?
'top' : false;
if (affixed === affix) {
return;
}
affixed = affix
unpin = (affix == 'bottom') ? position.top - scrollTop : null
$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
});
}