//Scripts
var hide_box = false;
function checkOnline(){
		$.post('getMethod.php',{actionName:'checkOnair'},function(html){
			//alert(html);
			if($("#header_onair").html()!=html){
				$("#header_onair").html(html);
			}
			setTimeout("checkOnline()",300000)
		})
	}
$(document).ready(function(){
	//Water mark for Google Search
	$("input#google_search").Watermark("Google Search","#fff");
	
	setTimeout("checkOnline()",1000);
//change selected class
	$("ul#navigation li a").click(function(){
		$("ul#navigation li a").removeClass('selected');
		$(this).addClass('selected');
	});
//AJax load	
	$("a.ajaxload").live('click',function(){
		//clearTimeout(timeout);
		if(hide_box){
			$("#open_box,#floating_box").show();
		}
		href = $(this).attr('href');
		window.location.hash = href;
		loadingpage = href.replace('index.php','pages.php');
		//window.scrollTo(0, 0);
		$('#full_content').html("<img src='images/loader.gif' class='loading_image' align='middle' />");
		$('#full_content').load(loadingpage+"&loader=ajax");
		return false;
	});
	
//Floating Box
setTimeout("$('div.button img').trigger('click')",5000);
	$("div.button img").click(function(){
	 	var height=$('#floating_box').height();
		$("#floating_box").animate( { top:"-"+height+"px" },700, function(){
					//$(this).hide();
					$("#open_box").animate({ top:"0px"},400);
					
		});
			
	});
	
	$("#open_box .open_button img").click(function(){
	 	//var wid=$('#floating_box').width();
		$("#open_box").animate( { top:"-30px" },400, function(){
					//$(this).hide();
					$("#floating_box").animate({ top:"0px"},700);
					
		});
			
	});	
	
	
});


