/*Si menu animé
window.onload = (
	function(){
		$("#menu li").mouseover(
			function() { 
				//alert("Hello");
				$(this).find("DIV").show();
				}
			);
		$("#menu li").mouseout(
			function() { 
				//alert("Hello");
				$(this).find("DIV").hide();
				}
			);
		}
	);
*/

function open_player(kelPlayer){
	window.open('http://www.point-sys.org/radioalfa/player/'+kelPlayer+'.html','ALFA_player','height=415, width=480, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
	}

function affiche_portail_player(){
	$("#portail_player_cont").show();
	$("#portail_player").toggle("slow",verifCont);
	}

function verifCont(){
	if($("#portail_player").css('display')=='none') $("#portail_player_cont").hide();
	}
	
scrollPub = 110;
function positPub(){
	scrolling=document.documentElement.scrollTop;
	newScroll = 150;
	if($('#milieu').height()>640){
		if(scrolling > 150){
			newScroll = scrolling-10;
			}
		}
	if($('#milieu').height()-newScroll<370){
		newScroll = 530;
		}
	if(newScroll != scrollPub){	
		scrollPub = newScroll;
		if($.browser.msie){
			$("#pub2").css("top",newScroll); 
			$("#pub4").css("top",newScroll); 
			setTimeout("positPub()",250);
			}else{
			$("#pub2").animate({ top : newScroll+"px"}, "slow",'');
			$("#pub4").animate({ top : newScroll+"px"}, "slow",'',positPub);
			}
		}else{
		setTimeout("positPub()",250);
		}
	}
	
function verifRecherche(kelForm){
	focusRecherche(kelForm['recherche']);
	return true;
}	
function focusRecherche(kelChps){
	if(kelChps.value == 'recherche...'){
		kelChps.value = '';
	}
}
function blurRecherche(kelChps){
	if(kelChps.value == ''){
		kelChps.value = 'recherche...';
	}
}

$(function(){
	$('.thickbox').colorbox({
			opacity : 0.7,
			maxWidth : '90%',
			maxHeight : '90%'
			});
	
	if(popPub){
		$.colorbox({
			href : popPub,
			opacity : 0.7,
			maxWidth : '90%',
			maxHeight : '90%',
			onComplete : function(){
					if(popPubUrl){
						$(".cboxPhoto").css('cursor','pointer');
						$(".cboxPhoto").click(function(){
							window.location = popPubUrl;
						});
					}
				}
			});
		setTimeout(function(){ $.colorbox.close(); }, 8000);
	}
});
