$(document).ready(function() {
	if(jQuery().coinslider) 
		$('#coin-slider').coinslider({ width: 775, height: 350,delay: 5000});
	if(jQuery().colorbox) {
		$("a[rel='colorbox']").colorbox();
		$("a[rel='colorbox_video']").colorbox({iframe:true, innerWidth:425, innerHeight:344});
	}
	
	///////////////////// on air /////////////////////////	
	rand = parseInt(Date());
	var auto_refresh = setInterval(
	function a(){
		$.ajax({
			type: "POST",
			data: "anti_cache="+Math.random(),
			dataType:'json',
			url: "http://www.starfm.gr/feeds/billboard",
			success: function(data){
				//var now = new Date();
				//$(".onair_table_now").html(data.now);
				$(".album").html(data.thumb);
				$(".dj").html(data.photo);
				$(".dj_now").html(data.ekpompi);
			}
		});
	}, 15000);
		$.ajax({
			type: "POST",
			data: "anti_cache="+Math.random(),
			dataType:'json',
			url: "http://www.starfm.gr/feeds/billboard",
			success: function(data){
				//var now = new Date();
				//$(".onair_table_now").html(data.now);
				$(".album").html(data.thumb);
				$(".dj").html(data.photo);
				$(".dj_now").html(data.ekpompi);
			}
		});
	//////////////////////////////////////////////////////////
	///////////////////// top /////////////////////////	
	rand = parseInt(Date());
	var d = new Date();
	if(parseInt(d.getHours()) == 18){
		var auto_refresh = setInterval(
		function b(){
			var d = new Date();
			$.ajax({
				type: "POST",
				data: "anti_cache="+Math.random(),
				url: "http://www.starfm.gr/feeds/top",
				success: function(data){
					$(".top").html(data);
				}
			});
		}, 30000);
	}
	
	$(".oldpick").live('click',function(){
		$(".pickoftheday").each(function(){
			$(this).attr('class','oldpick');
			$(this).children(".v").hide();
		});
		$(this).attr('class','pickoftheday');
		$(this).children(".v").show();

		return false;
	});

	//////////////////////////////////////////////////////////
});
