/*!*
 * jQuery Cookie plugin
 *
 * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie=function(m,l,h){if(arguments.length>1&&String(l)!=="[object Object]"){h=jQuery.extend({},h);if(l===null||l===undefined){h.expires=-1}if(typeof h.expires==="number"){var j=h.expires,n=h.expires=new Date();n.setDate(n.getDate()+j)}l=String(l);return(document.cookie=[encodeURIComponent(m),"=",h.raw?l:encodeURIComponent(l),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join(""))
}h=l||{};var i,k=h.raw?function(a){return a}:decodeURIComponent;return(i=new RegExp("(?:^|; )"+encodeURIComponent(m)+"=([^;]*)").exec(document.cookie))?k(i[1]):null};
/*!
 * © 2011 Ju-Jutsu Oulu
 */
var oulunjujutsu={fancybox:{centerOnScroll:true,cyclic:true,overlayColor:"#000",overlayOpacity:0.5,padding:5,speedIn:500,speedOut:500,titlePosition:"outside",transitionIn:"elastic",transitionOut:"elastic"},testisivusto:(window.location.hostname!=="www.oulunjujutsu.com")};$(document).ready(function(){var a=$("body"),c=oulunjujutsu,b;
if(typeof _gat==="object"&&$.cookie("suodata-vierailut")!=="1"){b=_gat._createTracker("UA-2286526-1");b._setDomainName(".www.oulunjujutsu.com");b._trackPageview();if(a.hasClass("virhesivu")){b._trackEvent("Virhesivut",window.location.pathname,$("body").attr("id").substr(5))}}a.delegate("a","click",function(){var e=$(this),d;if(this.href.indexOf("http://")!==0&&this.href.indexOf("https://")!==0){return}if(b){if(this.href.indexOf("http://"+window.location.hostname)!==0){b._trackEvent("Ulos johtavat linkit",this.href.substr(this.href.indexOf(":")+3))
}else{if(e.hasClass("lataus")){b._trackPageview(this.href.substr(27))}}}if(e.hasClass("youtube")&&(d=/\?v=([A-Za-z0-9_\-]+)/.exec(this.href))){$.fancybox('<p id="youtube-video">Tämän videon toistaminen vaatii <a href="http://get.adobe.com/flashplayer/">Flash Playerin</a>.</p>',$.extend({},c.fancybox,{autoDimensions:false,autoScale:false,height:390,onCleanup:function(){swfobject.removeSWF("ytplayer")},orig:this,scrolling:"no",width:640}));swfobject.embedSWF("http://www.youtube.com/e/"+d[1]+"?fs=1&version=3&autoplay=1","youtube-video","640","390","8",null,null,{allowFullScreen:"true",wmode:"transparent"},{id:"ytplayer"});
return false}});if(a.is("#harjoitukset")){c.harjoitukset={naytaVuorot:function(){var e,k=$(this),d=c.harjoitukset.paivat,q=c.harjoitukset.taulukko,g;$("#vuorot .aktiivinen").removeClass("aktiivinen");k.addClass("aktiivinen");switch(k.text()){case"Hokutoryu":e="BJJ";break;case"BJJ":e="Hokutoryu";break;default:e="";break}q.find("tbody").remove();for(var h=0,o=d.length;h<o;++h){var m=$("<tbody/>");g=0;for(var f=0,l=d[h].vuorot.length;f<l;++f){if(d[h].vuorot[f].laji!==e){var k=$("<td/>"),n=$("<tr/>");$("<td/>").text(d[h].vuorot[f].aika).appendTo(n);
k.text(d[h].vuorot[f].laji).appendTo(n);if("ryhma" in d[h].vuorot[f]){$("<td/>").text(d[h].vuorot[f].ryhma).appendTo(n)}else{k.attr("colspan",2)}n.appendTo(m);++g}}if(g>0){$('<th scope="rowgroup"/>').text(d[h].paiva).attr("rowspan",g).prependTo(m.find("tr:eq(0)"));m.appendTo(q)}}q.find("tbody:gt(0) tr:nth-child(1)").addClass("raja");q.find("tbody tr:odd").addClass("parillinen");return false},paivat:[],taulukko:$(".harjoitusajat")};$(".harjoitusajat tbody").each(function(f){var d=$(this),h,g,e=[];d.children().each(function(){h=$(this).children("td");
g={aika:h.eq(0).text(),laji:h.eq(1).text()};if(h.length===3){g.ryhma=h.eq(2).text()}e.push(g)});c.harjoitukset.paivat.push({paiva:d.find("th").text(),vuorot:e})});$('<div id="vuorot">Näytä vuorot: <a class="toiminto aktiivinen" href="#">Kaikki</a> <a id="vuorot-hokutoryu" class="toiminto" href="#">Hokutoryu</a> <a class="toiminto" href="#">BJJ</a></div>').delegate("a","click",c.harjoitukset.naytaVuorot).insertBefore(c.harjoitukset.taulukko)}$("a.suurennus, #albumi a").fancybox(c.fancybox)});
