var animatedcollapse={divholders:{},divgroups:{},lastactiveingroup:{},show:function(B){if(typeof B=="object"){for(var A=0;A<B.length;A++){this.showhide(B[A],"show")}}else{this.showhide(B,"show")}},hide:function(B){if(typeof B=="object"){for(var A=0;A<B.length;A++){this.showhide(B[A],"hide")}}else{this.showhide(B,"hide")}},toggle:function(A){this.showhide(A,"toggle")},addDiv:function(B,A){this.divholders[B]=({id:B,$divref:null,attrs:A});this.divholders[B].getAttr=function(D){var C=new RegExp(D+"=([^,]+)","i");return(C.test(this.attrs)&&parseInt(RegExp.$1)!=0)?RegExp.$1:null}},showhide:function(D,C){var A=this.divholders[D].$divref;if(this.divholders[D]&&A.length==1){var B=this.divgroups[A.attr("groupname")];if(A.attr("groupname")&&B.count>1&&(C=="show"||C=="toggle"&&A.css("display")=="none")){if(B.lastactivedivid&&B.lastactivedivid!=D){this.slideengine(B.lastactivedivid,"hide")}this.slideengine(D,"show");B.lastactivedivid=D}else{this.slideengine(D,C)}}},slideengine:function(D,C){var A=this.divholders[D].$divref;if(this.divholders[D]&&A.length==1){var B={height:C};if(A.attr("fade")){B.opacity=C}A.animate(B,A.attr("speed")?parseInt(A.attr("speed")):500);return false}},generatemap:function(){var B={};for(var A=0;A<arguments.length;A++){if(arguments[A][1]!=null){B[arguments[A][0]]=arguments[A][1]}}return B},init:function(){var A=this;jQuery(document).ready(function(E){var B=A.getCookie("acopendivids");var D=A.getCookie("acgroupswithpersist");if(B!=null){B=(B=="nada")?[]:B.split(",")}D=(D==null||D=="nada")?[]:D.split(",");jQuery.each(A.divholders,function(){this.$divref=E("#"+this.id);if((this.getAttr("persist")||jQuery.inArray(this.getAttr("group"),D)!=-1)&&B!=null){var H=(jQuery.inArray(this.id,B)!=-1)?"block":"none"}else{var H=this.getAttr("hide")?"none":null}this.$divref.css(A.generatemap(["height",this.getAttr("height")],["display",H]));this.$divref.attr(A.generatemap(["groupname",this.getAttr("group")],["fade",this.getAttr("fade")],["speed",this.getAttr("speed")]));if(this.getAttr("group")){var G=A.divgroups[this.getAttr("group")]||(A.divgroups[this.getAttr("group")]={});G.count=(G.count||0)+1;if(!G.lastactivedivid&&this.$divref.css("display")!="none"||H=="block"){G.lastactivedivid=this.id}this.$divref.css({display:"none"})}});jQuery.each(A.divgroups,function(){if(this.lastactivedivid){A.divholders[this.lastactivedivid].$divref.show()}});var C=E("*[rel]").filter('[@rel^="collapse-"], [@rel^="expand-"], [@rel^="toggle-"]');var F=/(collapse-)|(expand-)|(toggle-)/;C.each(function(){E(this).click(function(){var G=this.getAttribute("rel");var I=G.replace(F,"");var H=(G.indexOf("collapse-")!=-1)?"hide":(G.indexOf("expand-")!=-1)?"show":"toggle";return A.showhide(I,H)})});E(window).bind("unload",function(){A.uninit()})})},uninit:function(){var B="",A="";jQuery.each(this.divholders,function(){if(this.$divref.css("display")!="none"){B+=this.id+","}if(this.getAttr("group")&&this.getAttr("persist")){A+=this.getAttr("group")+","}});B=(B=="")?"nada":B.replace(/,$/,"");A=(A=="")?"nada":A.replace(/,$/,"");this.setCookie("acopendivids",B);this.setCookie("acgroupswithpersist",A)},getCookie:function(A){var B=new RegExp(A+"=[^;]*","i");if(document.cookie.match(B)){return document.cookie.match(B)[0].split("=")[1]}return null},setCookie:function(B,C,D){if(typeof D!="undefined"){var A=new Date();A.setDate(A.getDate()+D);document.cookie=B+"="+C+"; path=/; expires="+A.toGMTString()}else{document.cookie=B+"="+C+"; path=/"}}};$(document).ready(function(){var A=$("#video").width();$(".item").css({width:A})});$(function(){$("#video").scrollable({size:1,horizontal:true,speed:300,prev:"#bn_l",next:"#bn_r",navi:".pages",naviItem:"a",activeClass:"active",items:".items",onSeek:null})});