
function pager_hide(id)
{
	var temp  = document.getElementById(id);
	if(temp && temp !="undefined")
	{
		temp.style.display="none";
	}
}
function pager_show(id)
{
	var temp  = document.getElementById(id);
	if(temp && temp !="undefined")
	{
		temp.style.display="block";
	}
}
function frontend_hide(id)
{
	document.getElementById(id).style.display = "none";
}
function frontend_show(id)
{
	document.getElementById(id).style.display = "block";
}
function videolist_hide(id){
	document.getElementById(id).style.display = "none";
}
function videolist_show(id){
	document.getElementById(id).style.display = "block";
}

function loadStaticPage(stringId)
{
	new Ajax.Updater('static_page_content', 
		'/staticpage/showByStringId?string_id=' + stringId, 
		{
			asynchronous:true, 
	 		evalScripts:true 
	 	});
}

function openStaticPage(stringId){
	if(jQuery("#static_page_container").css('display') == 'block'){
		jQuery("#static_page_container").slideUp('normal', 
			function callback() {
 				jQuery("#static_page_content").html("");
 				openStaticPage(stringId);
 		});
	}	
	else{	
		jQuery("#static_page_container").slideDown('normal', 
			function callback() {
 				loadStaticPage(stringId);
 		});
 	}
}
function closeStaticPage(){
	jQuery("#static_page_container").slideUp('normal', 
		function callback() {
 			jQuery("#static_page_content").html("");
 	});
	
}	

function openEPG(){
 	 	window.open("/frontend.php/live_playlist/programInfo",
 	"test","menubar=0, resizable=1, scrollbars=1; status=0, left=100, top=100, width=710,height=580");
 	}


function openStaticCategory(id){
	 	new Ajax.Updater('showcategory', 
	 					 'frontend_dev.php/contentcategory/show?category_id='+id, 
	 					 {
	 					 	asynchronous:true, 
	 					 	evalScripts:true, 
	 					 	onComplete:function(request, json){showCategory('showcategory')}, 
	 					 	onLoading:function(request, json){loadingCategory('showcategory')}
	 					 }
	 					 ); return false;
 	 }





  	function showCategory(updateDiv){
		//document.getElementById(updateDiv).innerHTML = "";
		document.getElementById(updateDiv+"_loader").style.display = "none";
		document.getElementById(updateDiv).style.display="block";
	}
	function loadingCategory(updateDiv){
		//document.getElementById(updateDiv).innerHTML = "";
		document.getElementById(updateDiv).style.display="none";
		document.getElementById(updateDiv+"_loader").style.display = "block";
	}
	
	var selected = "cat_0";
	function changeCSSClass(active){
		if (active != selected){
			document.getElementById(selected).className = "";
			document.getElementById(active).className = "active";
			selected = active;
		}
	}
	
function clear_video()
{
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		var player = document.getElementById('player1');
		if(player != null)
		{	
			player.settings.mute = true;
			document.getElementById('divPlayer').style.display = "none";
			document.getElementById('PlayerControls').style.display = 'none';
		}
	}
}

function details_show(div_id){
	document.getElementById('info').style.display = 'none';
	document.getElementById('tell').style.display = 'none';
	document.getElementById('comments').style.display = 'none';
	document.getElementById('rating').style.display = 'none';	
	
	document.getElementById(div_id).style.display = 'block'; 
}
function openProgram(){
	if(jQuery("#static_page_container").css('display') == 'block'){
		jQuery("#static_page_container").slideUp('normal', 
			function callback() {
 				jQuery("#static_page_content").html("");
 				openProgram();
 		});
	}	
	else{	
		jQuery("#static_page_container").slideDown('normal', 
			function callback() {
 				loadProgram();
 		});
 	}
}
function loadProgram()
{
	new Ajax.Updater('static_page_content', 
		'/theme/nit_tv/templates/HTML/program.php', 
		{
			asynchronous:true, 
	 		evalScripts:true 
	 	});
}

function openButuzin()
{
	if(jQuery("#static_page_container").css('display') == 'block'){
	jQuery("#static_page_container").slideUp('normal', 
			function callback() {
 				jQuery("#static_page_content").html("");
 				openButuzin();
 		});
	}	
	else{	
		jQuery("#static_page_container").slideDown('normal', 
			function callback() {
 				loadButuzin();
 		});
 	}
}

function loadButuzin()
{
	new Ajax.Updater('static_page_content', 
		'/advertisement/showForm', 
		{
			asynchronous:true, 
	 		evalScripts:true 
	 	});
}