// JavaScript Document
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

////POP UP
function open_popup(url,largeur,hauteur,opt){
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(url,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+opt);
	
}
////POP UP TITLE
function open_popup_title(url,titrepage,largeur,hauteur,opt){
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	w=window.open(url,titrepage,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+opt);
	return w;
}

/////STATION LIST
function station_list(){
	
					///POP UP
					open_popup("station_list.php",800,450,'menubar=no,scrollbars=yes,statusbar=no');
				
	

}

/////PLAYLIST
function play_list(){
	
					///POP UP
					open_popup("playlist.php",700,450,'menubar=no,scrollbars=yes,statusbar=no');
				
	

}

/////SPOTLIGHT
function station_list_spotlight(){
	
					///POP UP
					open_popup("station_list_spotlight.php",700,450,'menubar=no,scrollbars=yes,statusbar=no');
				
	

}


/////PREVIOUS PLAYLIST
function previous_play_list(){
	
					///POP UP
					open_popup("previous_list.php",700,450,'menubar=no,scrollbars=yes,statusbar=no');
				
	

}

/////PREVIOUS PLAYLIST
function pop_aboutus(page){
	
					///POP UP
					open_popup(page,700,450,'menubar=no,scrollbars=yes,statusbar=no');
				
	

}

////PREVIOUS PLAYLIST
function pop_act_kit(page){
	
					///POP UP
					open_popup(page,550,728,'menubar=no,scrollbars=yes,statusbar=no');
				
	

}

/////PREVIOUS PLAYLIST
function pop_kids(page){
	
					///POP UP
					open_popup(page,610,450,'menubar=no,scrollbars=yes,statusbar=no');
				
	

}
/////POP PLAYER AUDIO
function pop_player(url,type){
	
		
			
					///POP UP
					//open_popup("player.php?url="+url+"&type="+type,320,100,'menubar=no,scrollbars=no,statusbar=no');
					w=open_popup_title("player.php?url="+url+"&type="+type,'WMP',320,100,'menubar=no,scrollbars=no,statusbar=no');
					w.focus();
	

}
////CHECK REGISTRATION
function check_form_registration(){
			var str_mail=document.getElementById("email").value;
			var name=document.getElementById("name").value;
			var country=document.getElementById("country").value;
			var msg_error="";
			
			if(!chek_valid_email(str_mail))msg_error+="- Email not correct\n";
			if(!name)msg_error+="- Name cannot be left empty\n";
			if(!country)msg_error+="- You must select a country\n";
			
			
			if(msg_error==""){
				
				document.reg_user.submit();
				
			}else{
				
				alert(msg_error);	
			}
					


}

		function chek_valid_email(str_mail){
			
			if(!str_mail)return false;
			
					var email,poset,pospunto;
					
					email=str_mail;			
					poset=email.indexOf("@");
					pospunto=email.indexOf(".");
				
									if(poset==-1||pospunto==-1||!email){
											return false;
									}else{
											return true;	
									}				
		}

