/* init*/
jQuery(function(a){a.easing.elasout=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(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e};a("a.back").click(function(){a(this).parents("div.pane").scrollTo(0,800,{queue:true});a(this).parents("div.section").find("span.message").text(this.title);return false});a("ul.links").click(function(c){c.preventDefault();var b=c.target;b.blur();if(b.title){a(this).parent().find("span.message").text(b.title)}});a("div.pane").scrollTo(0);a.scrollTo(0)});;
/* scroll to */
(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return c.browser.safari||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.speed||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){var l=this,j=c(l),k=f,i,g={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);case"object":if(k.is||k.style){i=(k=c(k)).offset()}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=a.max(l,r);if(i){g[p]=i[u]+(m?0:o-j.offset()[u]);if(d.margin){g[p]-=parseInt(k.css("margin"+s))||0;g[p]-=parseInt(k.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=k[r=="x"?"width":"height"]()*d.over[u]}}else{var t=k[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){h(d.onAfterFirst)}delete g[p]}});h(d.onAfter);function h(n){j.animate(g,e,d.easing,n&&function(){n.call(this,f,d)})}}).end()};a.max=function(j,i){var h=i=="x"?"Width":"Height",e="scroll"+h;if(!c(j).is("html,body")){return j[e]-c(j)[h.toLowerCase()]()}var g="client"+h,f=j.ownerDocument.documentElement,d=j.ownerDocument.body;return Math.max(f[e],d[e])-Math.min(f[g],d[g])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);;
/* YOU TUBE Playlist PLUGIN */
jQuery.fn.ytplaylist=function(a){var a=jQuery.extend({holderId:"ytvideo",playerHeight:"300",playerWidth:"450",addThumbs:false,thumbSize:"small",showInline:false,autoPlay:true,showRelated:true,allowFullScreen:false},a);return this.each(function(){var d=$j(this);var f="";var c="&rel=0";var e="";if(a.autoPlay){f="&autoplay=1"}if(a.showRelated){c="&rel=1"}if(a.allowFullScreen){e="&fs=1"}function h(j){var i="";i+='<object height="'+a.playerHeight+'" width="'+a.playerWidth+'">';i+='<param name="movie" value="http://www.youtube.com/v/'+j+f+c+e+'"> </param>';i+='<param name="wmode" value="transparent"> </param>';if(a.allowFullScreen){i+='<param name="allowfullscreen" value="true"> </param>'}i+='<embed src="http://www.youtube.com/v/'+j+f+c+e+'"';if(a.allowFullScreen){i+=' allowfullscreen="true" '}i+='type="application/x-shockwave-flash" wmode="transparent"  height="'+a.playerHeight+'" width="'+a.playerWidth+'"></embed>';i+="</object>";return i}function g(i){if(i!=undefined&&i!="undefined"){var j=i.match("[\\?&]v=([^&#]*)");j=j[1];return j}}var b=d.children("li:first-child").addClass("currentvideo").children("a").attr("href");$j("#"+a.holderId+"").html(h(g(b)));d.children("li").children("a").click(function(){if(a.showInline){$j("li.currentvideo").removeClass("currentvideo");$j(this).parent("li").addClass("currentvideo").html(h(g($j(this).attr("href"))))}else{$j("#"+a.holderId+"").html(h(g($j(this).attr("href"))));$j(this).parent().parent("ul").find("li.currentvideo").removeClass("currentvideo");$j(this).parent("li").addClass("currentvideo")}return false});if(a.addThumbs){d.children().each(function(k){var j=$j(this).text();if(a.thumbSize=="small"){var l="http://img.youtube.com/vi/"+g($j(this).children("a").attr("href"))+"/2.jpg"}else{var l="http://img.youtube.com/vi/"+g($j(this).children("a").attr("href"))+"/0.jpg"}$j(this).children("a").empty().html("<img src='"+l+"' alt='"+j+"' />"+j).attr("title",j)})}})};;
