﻿
/*
EASY TABS 1.2 Produced and Copyright by Koller Juergen
www.kollermedia.at | www.austria-media.at
Need Help? http:/www.kollermedia.at/archive/2007/07/10/easy-tabs-12-now-with-autochange
You can use this Script for private and commercial Projects, but just leave the two credit lines, thank you.
*/

//EASY TABS 1.2 - MENU SETTINGS
//Set the id names of your tablinks (without c number at the end)
var tablink_idname2 = new Array("tlink")
//Set the id names of your tabcontentareas (without c number at the end)
var tabcontent_idname2 = new Array("tcontent") 
//Set the number of your tabs in each menu
var tabcount2 = new Array("8")
//Set the Tabs wich should load at start (In this Example:Menu 1 -> Tab 2 visible on load, Menu 2 -> Tab 5 visible on load , Menu 3 -> Tab 1 visible on load)
var loadtabs2 = new Array("1")  
//Set the Number of the Menu which should autochange (if you dont't want to have c change menu set it to 0)
var autochangemenu2 = 2;
//the speed in seconds when the tabs should change
var changespeed2 = 2;
//should the autochange stop if the user hover over c tab from the autochangemenu2? 0=no 1=yes
var stoponhover2 = 1;
//END MENU SETTINGS


/*Swich easytabs2 Functions - no need to edit something here*/
function easytabs2(menunr2, active2) {
if (menunr2 == autochangemenu2){
currenttab2=active2;
}if ((menunr2 == autochangemenu2)&&(stoponhover2==1)) {
stop_autochange2()
} else if ((menunr2 == autochangemenu2)&&(stoponhover2==0))  {
counter2=0;
}
menunr2 = menunr2-1;
for (j=1; j <= tabcount2[menunr2]; j++){
document.getElementById(tablink_idname2[menunr2]+j).className='tab0';
document.getElementById(tabcontent_idname2[menunr2]+j).style.display = 'none';
}document.getElementById(tablink_idname2[menunr2]+active2).className='current';document.getElementById(tabcontent_idname2[menunr2]+active2).style.display = 'block';}var timer2; counter2=0; var totaltabs=tabcount2[autochangemenu2-1];var currenttab2=loadtabs2[autochangemenu2-1];function start_autochange2(){counter2=counter2+1;timer2=setTimeout("start_autochange2()",1000);if (counter2 == changespeed2+1) {currenttab2++;if (currenttab2>totaltabs) {currenttab2=1}easytabs2(autochangemenu2,currenttab2);restart_autochange2();}}function restart_autochange2(){clearTimeout(timer2);counter2=0;start_autochange2();}function stop_autochange2(){clearTimeout(timer2);counter2=0;}

//window.onload=function(){
//var menucount2=loadtabs2.length; var c = 0; var d = 1; do {easytabs2(d, loadtabs2[c]);  c++; d++;}while (d<=menucount2);
//if (autochangemenu2!=0){start_autochange2();}
//}
// JavaScript Document
