/* -----------------------------------
   rotating image  project page items
   ----------------------------------- */
var image_count;
var current_image=0;

var txt_count;
var current_txt=0;

$(document).ready(function(){
  image_count = $("div.img-rotate").hide().size();
  $("div.img-rotate:eq("+current_image+")").show();
  setInterval(feature_rotate,7000); //time in milliseconds
});

function feature_rotate() {
  old_image = current_image%image_count;
  new_image = ++current_image%image_count;
  $("div.img-rotate:eq(" + new_image + ")").fadeIn("slow", function() {
    $("div.img-rotate:eq(" + old_image + ")").fadeOut("slow");
  });
}


$(document).ready(function(){
  txt_count = $("span.txt-rotate").hide().size();
  $("span.txt-rotate:eq("+current_txt+")").show();
  setInterval(feature_rotate2,7000); //time in milliseconds
});

function feature_rotate2() {
  old_txt = current_txt%txt_count;
  new_txt = ++current_txt%txt_count;
  $("span.txt-rotate:eq(" + new_txt + ")").show(function() {
    $("span.txt-rotate:eq(" + old_txt + ")").hide();
  });
}
