function popupVideo( path ) {
	if ( $("news_roll") ) $('news_roll').value = 'false';
        if ( $("live_scores_roll") ) $('live_scores_roll').value = 'false';
	show_popup("<div id=\"playerContainer\"></div>", "Video");
	var fo = new SWFObject( "/includes/flowplayer/FlowPlayerLight.swf", "FlowPlayer", "720", "405", "9", "#fff", true);
            fo.addVariable("config", "{videoFile: '"+path+"', loop: true, bufferLength: 10, showPlayList: false, showStopButton: true, controlsOverVideo: 'locked', showFullScreenButton: false, showMenu: false, usePlayOverlay: true, autoPlay: true }");
            fo.write("playerContainer");
}

var win;

function show_popup( content, title) {
	try { document.getElementById('my_embed').style.visibility = 'hidden'; } catch(e) { }

	var out = new Array();
	
	out.push("<div style='position: absolute; border: 2px solid #ffffff; background-color: #333333;'><div id=\"popup_content\" style=\"width: 720px; height: 405px; padding: 5px; color: #ffffff;\">"+content+"</div><hr style=\"width: 0px; clear: both; border: 0px #333333;\"><div style=\"background-color: #222222; color: #ffffff; font-size: 8pt; text-align: right; padding: 7px;\">");
	out.push ("<span style=\"cursor: pointer;\" class='closeSticky' >[Close]</span>");
	out.push("</div></div>");
	
	var size = window.getSize();
	var offset = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
	var offset_left = 0;
	if ( window.ie ) offset_left = -300;
	
	
	win = new StickyWin({
		content: out.join(""),
		width: '650px',
		id : 'popup',
		allowMultiple : false,
		fadeDuration : 400,
		fadeTransition: Fx.Transitions.sineInOut,
		position: 'center',
		offset: {
			x: offset_left, /*over to the left*/
			y: -300 /*and down a little*/
		},
		modalOptions: {
			modalStyle : {
				'position' : 'absolute',
				'border' : '0px #999999 solid',
				'background-color' : '#000000',
				'opacity':.85,
				'width':(window.getScrollWidth())+'px',
				'height':(document.body.parentNode.scrollHeight+(offset*2))+'px',
				'top' : '0px'
				}
			}
	});
	
}
function demoMap( location ){
	
	
	var locs = new Array();
	locs['1'] = new Array();
	locs['1']['lat'] = 52.131572;
	locs['1']['long'] = -106.628451;
	locs['1']['name'] = "Rutherford Rink";
/*//\n69 Campus Dr\nS7N 5B1
*/	locs['2'] = new Array();
	locs['2']['lat'] = 52.13499;
	locs['2']['long'] = -106.637206;
	locs['2']['name'] = "Education Gym";
/*//28 Campus Dr  	S7N 0X1
*/	locs['3'] = new Array();
	locs['3']['lat'] = 52.125545;
	locs['3']['long'] = -106.630318;
	locs['3']['name'] = "Field 7";

	locs['4'] = new Array();
	locs['4']['lat'] = 52.12706;
	locs['4']['long'] = -106.629846;
	locs['4']['name'] = "Griffiths Stadium in PotashCorp Park";
/*	// 	5 Stadium Crescent
*/
	locs['5'] = new Array();
	locs['5']['lat'] = 52.129951;
	locs['5']['long'] = -106.631316;
	locs['5']['name'] = "Physical Activity Complex (PAC)";
/*	//87 Campus Drive  	S7N 5B2
*/
	locs['6'] = new Array();
	locs['6']['lat'] = 52.12731;
	locs['6']['long'] = -106.626735;
	locs['6']['name']= "Saskatoon Field House";
/*	//2020 College Drive  	S7N 2W4
*/
 Shadowbox.open({
	 player: 'html',
	 content: '',
	 height: 400,
	 width: 600,
	 options: {
	 onFinish: function(item){
			 if(GBrowserIsCompatible()){
				 var map = new GMap2(document.getElementById('shadowbox_content'));
				 map.setMapType(G_HYBRID_MAP);
				 map.setCenter(new GLatLng(parseFloat(locs[location]['lat']),parseFloat(locs[location]['long'])), 16);
				 map.openInfoWindow(map.getCenter(),
								  document.createTextNode(locs[location]['name']));
			
			 }
			
			 // add some simple controls
			 map.addControl(new GSmallMapControl());
			 map.addControl(new GMapTypeControl());
		 }
		 }
 });

};

function window_popup( url ) {
	if ( url.substring( 0, 10 ) == '/Home_Left'  ) {
		window.location.href = url;
	} else {
		window.open(url,'','toolbar=no,width=800,height=540');	
	}
}

			

			
function show_detail( id, el ) { 
	$('game_detail').innerHTML = "<img src='/images/game_details_bg.png' width='362' height='103' class='fixPNG' /><div class='game_day_game'><img src='/images/ajax-loader.gif' border='0' /></div>";
	$('game_detail').style.top = ( ( el.getCoordinates($('calendar_month')).top ).toInt() - 100 )+'px'; 
	$('game_detail').style.left = ( ( el.getCoordinates($('calendar_month')).left ).toInt()  )+'px';  
	$('game_detail').fade( 'in' );
	var myajax = new Request.HTML( { url : '/includes/ajax_functions.php', method : 'get' , 
	 onSuccess : function(responseText) { 
	 	if ( responseText != 'false' ) { 
			$('game_detail').innerHTML = responseText; 
		} 
	} } ); 
	myajax.send('action=load_event&id='+id); 

 } 
			

	function validatemobileupdate() {
		
		var ret = true;
		var error = "";
		var checked = false;
		$$("input[type='checkbox']").each( function(el) {
			if ( el.checked ) checked = true;
	        });
		if ( !checked ) {
			ret = false;
			error += "Please select a sport you want to recieve updates.\n\r";
		}
		if ( $('name').value == '' ) {
			ret = false;
			error += "Please provide your name.\n\r";
		}
		if ( $('email').value == '' ) {
			ret = false;
			error += "Please provide your email.\n\r";
		}
		if ( $('sms_carrier').options.selectedIndex <= 0 ) {
			ret = false;
			error += "Please select your cellular carrier.\n\r";
		}
		if ( $('areacode').value.length != 3 )  {
			ret = false;
			error += "Please provide your area code.\n\r";
		}
		if ( $('phoneprefix').value.length != 3 )  {
			ret = false;
			error += "Please provide your full cellular number.\n\r";
		}
		if ( $('phonenumber').value.length != 4 ) {
			ret = false;
			error += "Please provide your full cellular number.\n\r";
		}
		if ( ret ) {
			$('mobile_updates').submit();
		} else {
			alert( error );
		}
	}


function rotate_header_feature( el ) {
	$$( '#game_day_cont .feature_item' ).each( function( fitem ) { fitem.fade( '0' ); } );
	if ( el == 'null' ) el = $('game_day_cont').childNodes[1];
	setTimeout( "$('"+el.id+"').fade( '1' )", 300 );
	var next;
	if ( !el.nextSibling ) next = $('game_day_cont').firstChild;
	else next = el.nextSibling;
	setTimeout( "rotate_header_feature( $('"+next.id+"') )", 5000 );
}



