// JavaScript Document

$(document).ready(function(){
	$('.stationList').vTicker();
	$('#slider-stage').carousel('#previous', '#next');
	$('#fromTheHeart').carousel('#simplePrevious', '#simpleNext');  
	
	//The auto-scrolling function
	function slide(){
		$('#simpleNext').click();
	}
	
	//Launch the scroll every 8 seconds
	var intervalId = window.setInterval(slide, 8000);
	//On user click deactivate auto-scrolling
	
	$('#previous, #simpleNext').click(
		function(){
			window.clearInterval(intervalId);
		}
	);
});

function popup( url , windowOptions){
	var newwindow=window.open(url,'name', windowOptions);
	if (window.focus) {newwindow.focus()}
}

function listenNow(url){
	
	popup(
		'http://www.nwrnetwork.com/listen/player.asp?station=wpff-fm', 
		'toolbar=no,location=no,directories=no,status=yes,'+
		'menubar=no,resizable=no,copyhistory=no,scrollbars=no,'+
		'width=763,height=393'
	); 

}
