var openTab = function(id) {
	//alert([oldId, id]);
	if (typeof(oldId) == "undefined") {
		//alert('not exists');
		var str = $('#tabsId li:eq(0)').attr("id");
		var i = str.indexOf('_');
		var title = str.substr(i+1, str.length-i-1);
		oldId = title;
	}
	//alert([oldId, id]);
	if (oldId != id ){
		if (oldId) { 
			document.getElementById("element_"+oldId).style.display = "none";
			var elemId = document.getElementById("element_"+oldId).childNodes;
			var tabId = document.getElementById("sTab_"+oldId);
			$(function(){
				window.clearInterval(intval);
				intval='';
			});
			$(elemId).removeAttr("id", "loopedSlider");
			$(tabId).removeClass("active"); //Remove any "active" class
		}
		document.getElementById("element_"+id).style.display = "block";
		var elemId = document.getElementById("element_"+id).childNodes;
		var tabId = document.getElementById("sTab_"+id);
		$(elemId).attr("id", "slideshow");
		$(tabId).addClass("active");
		$(function(){
			startSlider();
		});
		oldId = id;
	}
	//alert([oldId, id]);
}
