AudioPlayer.setup("/gfx/swf/player.swf", {  
		width: 294,
		loader: '00749c',
		initialvolume: 100,  
		transparentpagebg: "yes"
});  

function LoadDynamicFeedControl() {
	var feeds =  [ {title: 'Jornal do Fundão', url: 'http://www.jornaldofundao.pt/rss/rss.asp'}];
	var feeds2 = [ {title: 'Reconquista', url: 'http://www.reconquista.pt/rss/rss.asp'}];
	var feeds3 = [ {title: 'Naturtejo', url: 'http://feeds2.feedburner.com/Naturtejo'}];
	var feeds4 = [ {title: 'Terras da Beira', url: 'http://www.terrasdabeira.com/rss/rss.asp'}];
	var feeds5 = [ {title: 'Jornal O Interior', url: 'http://www.ointerior.pt/rss/rss.asp'}];
	var feeds6 = [ {title: 'Jornal Nova Guarda', url: 'http://www.novaguarda.pt/rss/rss.asp'}];
	var feeds7 = [ {title: 'Jornal A Guarda', url: 'http://www.jornalaguarda.com/rss/rss.asp'}];
	
    var options = {  horizontal : false, title : "RSS", displayTime : 3500}
	
	new GFdynamicFeedControl(feeds, 'jf', options);
	new GFdynamicFeedControl(feeds2, 'reconquista', options);
	new GFdynamicFeedControl(feeds3, 'rcb', options);
	new GFdynamicFeedControl(feeds4, 'tb', options);
	new GFdynamicFeedControl(feeds5, 'joi', options);
	new GFdynamicFeedControl(feeds6, 'jng', options);
	new GFdynamicFeedControl(feeds7, 'jag', options);
}

google.load('feeds', '1');
google.setOnLoadCallback(LoadDynamicFeedControl);

$(document).ready(function(){

	/*$('#img-rotator').crossSlide({
  		speed: 25,
  		fade: 1 
		}, [
  		
		{ src: 'images/header/3.jpg', dir: 'down'   },
  		{ src: 'images/header/4.jpg',   dir: 'up' },
		{ src: 'images/header/5.jpg', dir: 'down'   },
		{ src: 'images/header/6.jpg',   dir: 'up' },
		{ src: 'images/header/7.jpg',   dir: 'down' },
		{ src: 'images/header/8.jpg',   dir: 'up' }

	]);*/
		   
	$("#bt-user-nav a").append("<em></em>");

	$("#menu-nav ul li .programacao").click(function() {
		return false;
	});

	$("#menu-nav ul li .programacao").hover(function() {
		$("#submenu-programacao").show();
	}, function() {
		$("#submenu-programacao").hide();
	});

	$("#submenu-programacao").hover(function() {
		$("#submenu-programacao").show();
		$("#menu-nav ul li .programacao").addClass("menu-active");

	}, function() {
		$("#submenu-programacao").hide();
		$("#menu-nav ul li .programacao").removeClass("menu-active");
	});

	
	$("#bt-user-nav a").hover(function() {
		$(this).find("em").animate({opacity: "show", top: "-75"}, "slow");
		var hoverText = $(this).attr("title");
	    $(this).find("em").text(hoverText);
	}, function() {
		$(this).find("em").animate({opacity: "hide", top: "-85"}, "fast");
	});

	$("a.fancy").fancybox({ 
		'zoomSpeedIn': 300, 
		'zoomSpeedOut': 300, 
		'overlayShow': false,
		'zoomOpacity': true,
		'overlayShow': true,
		'overlayOpacity': 0.7,
		'frameWidth': 860,
		'frameHeight': 580,
		'padding': 0
	}); 

	$('a[rel="external"]').click(function(){
		$(this).attr("target","_blank");

	});

	$("#submenu_1, #submenu_2, #submenu_3").hide(); 

	$("#menu_1").click(function () { 
      $("#submenu_1").slideToggle(); 
	  return false;
    });

	$("#menu_2").click(function () { 
      $("#submenu_2").slideToggle(); 
	  return false;
    });
	$("#menu_3").click(function () { 
      $("#submenu_3").slideToggle(); 
	  return false;
    });
	
	$("#link-info").click(function () { 
	  $("#expand-newsletter, #expand-meteo").slideUp();
      $("#expand-info").slideToggle(); 
	  return false;
    });
	
	$("#link-newsletter").click(function () { 
	  $("#expand-info, #expand-meteo").slideUp();
      $("#expand-newsletter").slideToggle(); 
	  return false;
    });
	
	$("#link-meteo").click(function () { 
	  $("#expand-newsletter, #expand-info").slideUp();
      $("#expand-meteo").slideToggle(); 
	  return false;
    });


	function openwindow(url,height,width){
		window.open(url,null,"height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,resizable=no");
	}
	

	$("#postal-2010").click(function () { 
		openwindow('/ficheiros/arquivo-de-natal/natal-2010.html','500','780');
		return false;
    });
	

	$("#postal-2007").click(function () { 
		openwindow('/ficheiros/arquivo-de-natal/arquivo-natal-07.html','500','780');
		return false;
    });
	

	$("#postal-2006").click(function () { 
		openwindow('/ficheiros/arquivo-de-natal/arquivo-natal-06.html','500','780');
		return false;
    });

	//openwindow('/radio-online/','432','296');
	
	$(".bt-ouvir-rcm").click(function () { 
		openwindow('/radio-online/','432','311');
		return false;
    });

	$(".link-ouvir-rcm").click(function () { 
		openwindow('/radio-online/','432','311');
		return false;
    });

	$("a.bt-musica-ambiente").click(function () { 
		openwindow('/musica-ambiente/','480','325');
		return false;
    });

	$(".bt-recomendar").click(function () { 
		$('#rcm-amigo').dialog('open');
		return false;
    });
	
	
	 function bookmarksite(title,url){
		if (window.sidebar) // firefox
			window.sidebar.addPanel(title, url, "");
		else if(window.opera && window.print){ // opera
			var elem = document.createElement('a');
			elem.setAttribute('href',url);
			elem.setAttribute('title',title);
			elem.setAttribute('rel','sidebar');
			elem.click();
		} 
		else if(document.all)// ie
			window.external.AddFavorite(url, title);
		else 	
			$('#favoritos-dialog').dialog('open');
	}
	
	
	$(".bt-favoritos").click(function () { 
		bookmarksite('Rádio Clube de Monsanto', 'http://www.radiomonsanto.pt');
		return false;
	});
	
	
});

$(function(){

	$("#noticias-recentes").accordion({ 
		header: "h2",
		autoHeight: false
	});

	$("#noticias-regiao").accordion({ 
		header: "h2",
		autoHeight: false
	});
	
	$(".accordion-default").accordion({ 
		header: "h3",
		autoHeight: false
	});

	$('.bt-ouvir-rcm small marquee').marquee();
	
	$("#resultados, #favoritos-dialog, #rcm-amigo").dialog({
		autoOpen: false,
		bgiframe: true,
		resizable: false,
		height: 'auto',
		modal: true
	});
	
	$('#resultados_link').click(function(){
		$('#resultados').dialog('open');
		return false;
	});
	
	$('#increase-text').click(function(){
			var ourText = $('#text-noticia p');
			var currFontSize = ourText.css('fontSize');
			var finalNum = parseFloat(currFontSize, 10);
			var stringEnding = currFontSize.slice(-2);
			finalNum *= 1.2;
			ourText.css('fontSize', finalNum + stringEnding);
			return false;
	});
	
	$('#decrease-text').click(function(){
			var ourText = $('#text-noticia p');
			var currFontSize = ourText.css('fontSize');
			var finalNum = parseFloat(currFontSize, 10);
			var stringEnding = currFontSize.slice(-2);
			finalNum /=1.2;
			ourText.css('fontSize', finalNum + stringEnding);
			return false;
	});
	
	$('#reset-text').click(function(){
			$('#text-noticia p').css('fontSize', 11);
			return false;
	});
	
	$('#img-rotator').cycle({ 
    	fx:    'fade', 
    	speed:  2500,
		timeout:  10000
 	});


});