$(document).ready(function(){
	$('ul.sf-menu').superfish({
		 autoArrows:  false 
	});
	
	$('a[rel*=facebox]').facebox();
	
//--- start simple tab
	$(".upd-content").hide(); //Hide all content
	$("#upd-nav a:first").addClass("active").show(); //Activate first tab
	$(".upd-content:first").show(); //Show first tab content

	//On Click Event
	$("#upd-nav a").click(function() {

		$("#upd-nav a").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".upd-content").hide(); //Hide all tab content

		var activeTab = $(this).attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
//--- start simple tab

//--- start newsTicker
	var options = {
		newsList: "#warstickers",
		startDelay: 10,
		stopOnHover: false,
		controls: false,
		placeHolder1: "_"
	}
	$().newsTicker(options);
//--- end newsTicker
	
//--- start banner
	$("#bannerlist").carouFredSel({
		direction			: "left",
		items: 1,
		scroll : {
			items			: 1,
			//easing			: "easeOutCirc",
			duration		: 1000
		},
		auto : {
			pauseDuration	: 4000,
			pauseOnHover	: true
		},
		pagination: "#bannerpag"/*,
		prev : {	
			button	: "#affprev",
			key		: "left"
		},
		next : {	
			button	: "#affnext",
			key		: "right"
		},
		pagination: "#affpag"
*/
	});/**/
//--- end banner

//--- start banner
	$("#itemlist").carouFredSel({
		direction			: "down",
		items: 1,
		scroll : {
			items			: 1,
			easing			: "easeOutBounce",
			duration		: 1000
		},
		auto : {
			pauseDuration	: 3000,
			pauseOnHover	: true
		}
	});/**/
//--- end banner

	$(".tips").tooltip();

});

function priview()
{
	var width = 500;
	var height = 120;
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
	var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
	window.open("../pages/priview","name",windowFeatures);
}
