/*
* RBB Radio Kulturradio
* standard.js
* 
* Author: Henry Krause
* Date: Januar 2012
*/

jQuery(document).ready(function() {
	jQuery('.accordeonplus').click(function() {
		var id = this.id;
		id = id.substring(13)
		jQuery(".accordeonminus").hide();
		jQuery(".accordeonplus").show();
		jQuery(".accordeon").slideUp('fast')
		jQuery("#accordeon" + id).slideDown('fast', function() {
			jQuery("#accordeonplus" + id).hide();
			jQuery("#accordeonminus" + id).show();
		})
	})
	jQuery('.accordeonminus').click(function() {
		var id = this.id;
		id = id.substring(14)
		jQuery("#accordeon" + id).slideUp('fast', function() {
			jQuery("#accordeonminus" + id).hide();
			jQuery("#accordeonplus" + id).show();
		})
	})
	jQuery('#showallaccordeon').click(function() {
		jQuery(".accordeon").slideDown('fast');
		jQuery(".accordeonplus").hide();
		jQuery(".accordeonminus").show();
	})
	
	// override box headlines
	jQuery('.overrideboxheadline').each(function (i) {
		jQuery(this).find('div.teaserbox h2').text(jQuery(this).attr('value'));
	})
	

})

if (isPublish()) {
	window.setInterval("requestNowOnAir()", 60000);
}
function requestNowOnAir() {
	jQuery("#nowonair .teaserbox.first .layoutsnippet").load("/include/kul/nowonair/now_on_air.html", { cache: true } ); 
}

