
$(document).ready(function(){ 
	//$('#container-content').fadeIn(1000);	
	$('div#container-topbar ul li').find("a").not(".on").hover(function() {
		$(this).highlightFade({speed:200,end:'white',attr:'borderColor'}).highlightFade({speed:1000,attr:'color',end:'white'});
	}, function() {
		$(this).highlightFade({speed:500,end:'black',attr:'borderColor'}).highlightFade({speed:1000,attr:'color',end:'black'});
	});																
});


var imgSwitch_count = Array();
var imgSwitch_interval;
var old_imgSwitch = 0;
var current_imgSwitch=2;

$(document).ready(function(){   
						   
  $('.videoboxhold').each(function() {
		var thisid = this.id;
  	 	imgSwitch_count[thisid] = $("#" + thisid + " > div.videobox").size();
  });
						   
  $('.videoboxhold').hover(function(i) {
	 var thisid = this.id;
	 if (imgSwitch_count[thisid]>1)  {
		imgSwitch_interval = setInterval("imgSwitch_rotate('" + thisid + "')",360); 
	 }
  }, function() {
    clearInterval(imgSwitch_interval);
  });
});

function imgSwitch_rotate(thisid) {
  current_imgSwitch = (old_imgSwitch + 1) % imgSwitch_count[thisid]; 
  $("#" + thisid + " > div.videobox:eq(" + current_imgSwitch + ")").fadeIn("fast"); 
  $("#" + thisid + " > div.videobox:eq(" + old_imgSwitch + ")").fadeOut("fast");
  old_imgSwitch = current_imgSwitch;
}
