/*Yetii - Yet (E)Another Tab Interface Implementation,version 1.8.0,http://www.kminek.pl/lab/yetii/,Copyright (c) Grzegorz Wojcik,Code licensed under the BSD License: http://www.kminek.pl/bsdlicense.txt*/ function Yetii(){this.defaults={id:null,active:1,interval:null,wait:null,persist:null,tabclass:'tab',activeclass:'active',callback:null,leavecallback:null};this.activebackup=null;for(var n in arguments[0]){this.defaults[n]=arguments[0][n]};this.getTabs=function(){var retnode=[];var elem=document.getElementById(this.defaults.id).getElementsByTagName('*');var regexp=new RegExp("(^|\\s)"+this.defaults.tabclass.replace(/\-/g,"\\-")+"(\\s|$)");for(var i=0;ithis.tabs.length)this.defaults.active=1;var self=this;if(this.defaults.wait)clearTimeout(this.timer2);this.timer1=setTimeout(function(){self.rotate(interval)},interval*1000)};this.next=function(){var _target=(this.defaults.active+1>this.tabs.length)?1:this.defaults.active+1;this.show(_target);this.defaults.active=_target};this.previous=function(){var _target=((this.defaults.active-1)==0)?this.tabs.length:this.defaults.active-1;this.show(_target);this.defaults.active=_target};this.previous=function(){this.defaults.active--;if(!this.defaults.active)this.defaults.active=this.tabs.length;this.show(this.defaults.active)};this.gup=function(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return null;else return results[1]};this.guh=function(){var regexS="#([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.hash);if(results==null)return null;else return results[1]};this.parseurl=function(tabinterfaceid){var result=this.gup(tabinterfaceid);if(result==null)result=this.guh();if(result==null)return null;if(parseInt(result))return parseInt(result);if(document.getElementById(result)){for(var i=0;i