var rotateNews = function() {
	jQuery(".newsRotate").show();
	jQuery(".newsRotate").vTicker({
		speed: 500,
		pause: 6000,
		showItems: 5,
		animation: 'fade',
		mousePause: false,
		height: 20,
		direction: 'up'
	});
} 

jQuery(document).ready(function(){
	var lastPos = 2;
	var linkTab = '';
	
	jQuery("div.scrollable").scrollable({circular: true}).navigator().autoscroll({ autoplay: true, interval: 20000 });
	
	jQuery(".tweet").tweet({
		join_text: "auto",
		count: 1,
		auto_join_text_default: "",
		auto_join_text_ed: "",
		auto_join_text_ing: "",
		auto_join_text_reply: "",
		auto_join_text_url: "",
		loading_text: "Loading Twitter..."
	});
	
	rotateNews();
	
	jQuery(".tabs > div").bind("click", function(e){
		var pos = this.id.substring(4);
		//alert('lastPos: '+lastPos+', pos: '+pos);
		jQuery("#tab_0"+lastPos).attr("src", "/images/home/tab_0"+lastPos+".gif");
		jQuery("#tab_0"+lastPos+"_content").css({'display' : 'none'});
		jQuery("#tab_0"+lastPos).addClass("inactiveTab");
		
		jQuery("#tab_0"+pos).attr("src", "/images/home/tab_0"+pos+"_ov.gif");
		jQuery("#tab_0"+pos+"_content").css({'display' : 'block'});
		jQuery("#tab_0"+pos).removeClass("inactiveTab");
		jQuery("#tab_0"+pos).addClass("activeTab");
		jQuery("div.panes").css({"background-image": "url(/images/home/tab_0"+pos+"_bg.gif)"});
		
		if (pos == 1) {jQuery("div.panes").css({"background-color": "#993378"});}
		if (pos == 2) {jQuery("div.panes").css({"background-color": "#b74418"});}
		if (pos == 3) {jQuery("div.panes").css({"background-color": "#d7af02"});}
		
		lastPos = pos;
	});
	
	/*jQuery(".inactiveTab").bind("mouseover", function(e){
		jQuery(this).attr("src", "/images/home/"+jQuery(this).attr('id')+"_ov.gif");
	});
	
	jQuery(".inactiveTab").bind("mouseout", function(e){
		jQuery(this).attr("src", "/images/home/"+jQuery(this).attr('id')+".gif");
	});*/
	
});


