window.onload=function() {

  // get tab container
  var container = document.getElementById("tabContainer");
    // set current tab
    var navitem = container.querySelector(".tabs ul li");
    //store which tab we are on
    var ident = navitem.id.split("_")[1];
    navitem.parentNode.setAttribute("data-current",ident);
    //set current tab with class of activetabheader
    navitem.setAttribute("class","tabActiveHeader");

    //hide two tab contents we don't need
    var pages = container.querySelectorAll(".tabpage");
    for (var i = 1; i < pages.length; i++) {
      pages[i].style.display="none";
    }
asd
    //this adds click event to tabs
    var tabs = container.querySelectorAll(".tabs ul li");
    for (var i = 0; i < tabs.length; i++) {
      tabs[i].onclick=displayPage;
    } 
	// {
	//class.tabs; var a = 1; var b = 2; i < table.class.row; i < table.length; draft!import;
	//	for (var tableclass == 1; i > table.class.column);
	//}
}


window.onload=function() {

  // get tab container
  var container = document.getElementById("tabContainer");
    // set current tab
    var navitem = container.querySelector(".tabs ul li");
    //store which tab we are on 
    var ident = navitem.id.split("_")[1];
    navitem.parentNode.setAttribute("data-current",ident);
    //set current tab with class of activetabheader
    navitem.setAttribute("class","tabActiveHeader");

    //hide two tab contents we don't need
    var pages = container.querySelectorAll(".tabpage");
    for (var i = 1; i < pages.length; i++) {
      pages[i].style.display="none";
    }

    //this adds click event to tabs
    var tabs = container.querySelectorAll(".tabs ul li");
    for (var i = 0; i < tabs.length; i++) {
      tabs[i].onclick=displayPage;
    }
}

// on click of one of tabs
function displayPage() {
  var current = this.parentNode.getAttribute("data-current");
  //remove class of activetabheader and hide old contents
  document.getElementById("tabHeader_" + current).removeAttribute("class");
  document.getElementById("tabpage_" + current).style.display="none";

  var ident = this.id.split("_")[1];
  //add class of activetabheader to new active tab and show contents
  this.setAttribute("class","tabActiveHeader");
  document.getElementById("tabpage_" + ident).style.display="block";
  this.parentNode.setAttribute("data-current",ident);
}
jQuery.noConflict();
var slideshow = jQuery('#slideshow').slideshow({
  // every option
  transition: 'blind(left, false, swing)', // blind(direction, fade, ease)
  selector: '> *', // which elements in #slideshow to be the slides
  initialIndex: 0, // index of element to show at first
  autoStyle: true, // handle some basic styles for you
  autoPlay: true, // don't cycle
  delay: 3000, // ms between transitions when autoPlay is true
  duration: 400, // duration of a transition
  show: function(event, params){
    //console.log( params );
  },
  showComplete: function(event, params){
    //console.log(params);
  }
}).data('slideshow'); // get the instance out of the element data


var slideshowElement = jQuery('#slideshow'); // for demonstration

jQuery( '#play' ).click(function(){
  slideshow.play( true ); // true plays and shows the next slide immediate rather than waiting for the timer
  // or slideshowElement.slideshow( 'play' );
});

jQuery( '#stop' ).click(function(){
  slideshow.stop();
  // or slideshowElement.slideshow( 'stop' );
});

// create custom transitions like so...
jQuery.rf.slideshow.defineTransition( 'custom', function ( params, arg ){
  // there is no arg, but if you wanted to pass an arg in, you'd
  // set the transition option to "custom(dude)"
  // and then `arg` would be `dude`, just like push(left), etc.
  var half = params.duration / 2;
  params.previous.hide();
  params.next.hide();
  for (var i = 0, l = 3; i < l; i++) {
    setTimeout(function(){
      params.previous.show();
      setTimeout(function(){
        params.previous.hide();
      }, half / 6);
    }, half / 3);
  }

  setTimeout(function(){
    params.next.show();
    for (var i = 0, l = 3; i < l; i++) {
      setTimeout(function(){
        params.next.hide();
        setTimeout(function(){
          params.next.show();
        }, half / 6);
      }, half / 3);
    }
  }, half);
});

jQuery('#transition').bind('change', function(){

  slideshow.options.transition = this.value;
});
