// Temple JS



var timer=setTimeout("switchTab(0);",4500);

/**
 *
 * @access public
 * @return void
 **/
function switchTab(tabCount){
	if (tabCount==0) {
			viewLink();
			timer=setTimeout("switchTab(1);",4500);
		}
	else if(tabCount==1){
			postLink();
			timer=setTimeout("switchTab(2);",4500);
	}
	else if (tabCount==2) {
			shareLink();
			timer=setTimeout("switchTab(0);",4500);
	}


}

  /*
 * @access public
 * @return void
 **/
function shareLink(){
		$("#share").css("display","block");
		$("#view").css("display","none");
		$("#post").css("display","none");
		$("#yourStory").removeClass();
		$("#yourStory").addClass("ysShare");
}

/**
 *
 * @access public
 * @return void
 **/
function viewLink(){
			$("#share").css("display","none");
		$("#view").css("display","block");
		$("#post").css("display","none");
		$("#yourStory").removeClass();
		$("#yourStory").addClass("ysView");

}

function postLink(){
		$("#share").css("display","none");
		$("#view").css("display","none");
		$("#post").css("display","block");
		$("#yourStory").removeClass();
		$("#yourStory").addClass("ysPost");
}

$(document).ready(function() {
	$("#share").css("display","block");
	$("#view").css("display","none");
	$("#post").css("display","none");

	$("#shareLink").click(function () {
		shareLink();
		clearTimeout(timer);
    });

	$("#viewLink").click(function () {
		viewLink();
		clearTimeout(timer);
    });

	$("#postLink").click(function () {
		postLink();
		clearTimeout(timer);
    });

});


/***fancy box**/

$(document).ready(function() {
	$(".historicalYearImage a").fancybox({
		'hideOnContentClick': true,
		'overlayShow':	true,
		'zoomSpeedIn':	0,
		'zoomSpeedOut':	0
	});
	$(".historicalYearImageLong a").fancybox({
		'hideOnContentClick': true,
		'overlayShow':	true,
		'zoomSpeedIn':	0,
		'zoomSpeedOut':	0
	});
});


