url_radio="http://www.radio-rire.fr/inscription-radio-rire-chansons.php" // url de la radio
sound=0; // son coupé initialement
video_audio="mute"

if(location.href.indexOf("http://radio-rire.fr")!=-1){location.href="http://www.radio-rire.fr"}

// correction bug refferer
//function blockError(){return true;};window.onerror=blockError;

function show_radio(x){
// on coupe l'anim flash
video_action("stop")
tmp=location+""
if(tmp.indexOf("radio=on")!=-1 || x==1){
window.open(url_radio,"radio","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=477,height=406,top=50,left=50")
}
}

function roll_menu(num_bt){
path="http://www.radio-rire.fr/"
tmp=document.getElementById("bt"+num_bt)
if(tmp.src==path+"img/pixel.gif"){tmp.src=path+"img/bt_"+num_bt+"_b.gif"}
	else{tmp.src=path+"img/pixel.gif"}

}

function show_ads(type){

new_ad=new Array();p=0
for(i=0;i<ad.length;i++){if(ad[i][1]==type){new_ad[p]=ad[i];p++}} // keep only the type
for(i=0;i<new_ad.length;i++){if(new_ad[i].length>3){id_prio=i;break}else{id_prio="none"}} // search priority
if(id_prio=="none"){id_ad=Math.floor(new_ad.length * Math.random())}else{id_ad=id_prio} // get priority or get random ad

switch(new_ad[id_ad][2]){ // get extension
	case "0":ext="gif";break
	case "1":ext="jpg";break
	case "2":ext="png";break
	case "3":ext="swf";break
	}

ad_dim=ad_type[type].split(",") // get type dim

if(ext!="swf"){
document.write("<img src='http://www.mesbillets.com/img/ads/"+new_ad[id_ad][0]+"."+ext+"' width='"+ad_dim[0]+"' width='"+ad_dim[1]+"' onClick='get_ad("+new_ad[id_ad][0]+")' class='pub'>")
}else{
document.write("<object class='pub' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+ad_dim[0]+"' height='"+ad_dim[1]+"'><param name='movie' value='http://www.mesbillets.com/img/ads/"+new_ad[id_ad][0]+".swf'><param name='quality' value='high'><embed src='http://www.mesbillets.com/img/ads/"+new_ad[id_ad][0]+".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+ad_dim[0]+"' height='"+ad_dim[1]+"'></embed></object>")
}
}


function get_ad(id_ad){
document.getElementById("helper").style.display="inline";
document.getElementById("helper").innerHTML="<IFRAME SRC='ads.php?id="+id_ad+"'></IFRAME>";}


function visit_ad(url,target_type){
switch(target_type){
	case 0:location.href=url;break
	case 1:window.open(url,"",",toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=750,height=550,top=50,left=50");break
	case 2:window.open(url,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=750,height=550,top=50,left=50");break
	}
}

function init_ticker_position(){ // définit la vitesse du scrolling
setTimeout("document.getElementById('ticker').scrollAmount=2;document.getElementById('ticker').scrollDelay=20",1000)
}

function check_fill(id){
def=document.getElementById(id).defaultValue
val=document.getElementById(id).value
if(val==def){txt=""};if(val==""){txt=def}
if(val==def || val==""){document.getElementById(id).value=txt}
if(document.getElementById(id).value!=document.getElementById(id).defaultValue){
document.getElementById(id).value=document.getElementById(id).value.toLowerCase()
}
	}
	
	
function init_sound(){
if(sound==0){setTimeout("video_action('mute')",1000)}
}
	
function video_play(url){
document.getElementById("videosflv").innerHTML="<object type='application/x-shockwave-flash' data='swf/player_flv.swf' width='173' height='126' id='video_ctrl'><param name='movie' value='swf/player_flv.swf' /><param name='FlashVars' value='flv=/flv/"+url+"&amp;width=173&amp;height=126&margin=-3&showvolume=1&autoplay=1&loop=1&playercolor=000000&buttoncolor=FFFFFF&buttonovercolor=F8A504&sliderovercolor=F8A504&slidercolor1=F03838&slidercolor2=980000&showplayer=never&loadingcolor=F8A504&onclick=none' /><param name='wmode' value='transparent' /></object>"
video_etat="play"
}

function video_action(action){
tmp_title=document.title
	switch(action){
	case "stop":document.getElementById("video_ctrl").SetVariable("player:jsStop", "");break
	case "play":document.getElementById("video_ctrl").SetVariable("player:jsPlay", "");;break
	case "pause":document.getElementById("video_ctrl").SetVariable("player:jsPause", "");break
	case "son":document.getElementById("video_ctrl").SetVariable("player:jsVolume", "100");break
	case "mute":document.getElementById("video_ctrl").SetVariable("player:jsVolume", "0");break
	case "url":video_play(document.getElementById("select_videos").value);break
	case "agrandir":video_action("stop");window.open("flv_max.php?flv="+document.getElementById("select_videos").value,"radio_video","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=300'");break
	}
document.title=tmp_title // corrrection bug titre
}


function flush(){document.getElementById('helper').innerHTML=""}


function popup(t,l,w,h,title,code_HTML){
document.getElementById("popup_mb").innerHTML=""

// titre popup
+"<table width='"+w+"' border='0' cellpadding='0' cellspacing='0'><tr>"
+"<td class='popup_c1'><img src='img/pc1.gif' width='20' height='19' border='0'></td>"
+"<td width='"+(w-44)+"' class='popup_titre'>"+title+"</td>"
+"<td><a href='javascript:popup_etat(0)'><img src='img/pc2.gif' width='24' height='19' border='0'></a></td>"
+"</tr></table>"

// contenu popup
+"<table width='"+w+"' border='0' cellspacing='0' cellpadding='0' class='popup_fond'>"
+"<tr><td style='height:"+(h-25)+"' align='center'>"+code_HTML+"</td></tr>"
+"</table>"

// bas popup
+"<table border='0' cellspacing='0' cellpadding='0' style='height:6px;width:"+w+"px'><tr>"
+"<td class='popup_c3'></td>"
+"<td width='"+(w-12)+"' class='popup_c2'><img src='img/pixel.gif'></td>"
+"<td class='popup_c4'></td>"
+"</tr></table>"

code_HTML+="<div id='popup_mb' style='position:absolute; left:"+l+"px; top:"+t+"px; width:"+w+"px; height:"+h+"px; z-index:9'>"
document.getElementById("popup_mb").style.left=l+"px";
document.getElementById("popup_mb").style.top=t+"px";
popup_etat(1)
	}


function popup_etat(etat){
	tmp=document.getElementById('popup_mb')
	
	if(etat==1){etat="visible"}else{
	document.getElementById("popup_mb").innerHTML=""
	etat="hidden"
	}
		
	if(navigator.appName.indexOf('Microsoft')!=-1){
		tmp.style.filter='blendTrans(duration=.7)'
		tmp.filters.blendTrans.apply()
		tmp.filters.blendTrans.play()
		}
	tmp.style.visibility=etat
	}


function invits(){
temp=document.getElementById("email_invit").value
if(temp=="Inscrit ton email ici !" || temp==""){
	popup(450,160,180,50,"Attention !","Vous devez saisir une adresse email !")
	}else{
	document.getElementById("helper").innerHTML="<IFRAME SRC='inscription.php?email="+temp+"&from=radio'></IFRAME>";}
	}
	
// roll over alpha
function roll(id,etat){
tmp=document.getElementById(id).style
	if(navigator.appName.indexOf("Microsoft")!=-1){
		if(etat==1){tmp.filter="alpha(opacity:100)"}else{tmp.filter="alpha(opacity:65)"} // ie
			}else{if(etat==1){tmp.opacity="1"}else{tmp.opacity=".65"}} // firefox
}

// affiche la page
function show_page(){
setTimeout("document.getElementById('contenu').style.visibility='visible'",500);
}