	function init(){
		VAR_localhost = false;if(window.location.toString().match(/^http:\/\/localhost/)){VAR_localhost = true;}
		if(!VAR_localhost){$C("DIV",{".background":"URL(http://itracking.sombraencounter.com/zzzzzz000000000000000001/beron/c.gif?rnd="+Math.floor(Math.random()*10000)+")"},$T("BODY")[0]);}
	}

	var beron = new Class({
		vars: {"apiPath":"resources/PHP/"},
		init: function(){
			this.vars = {"apiPath":"resources/PHP/"};
		},
		sendSong: function(songID){
			function sendMail(el,ths){
				var ops = {};$A(h.$T("INPUT")).append(h.$T("TEXTAREA")).append(h.$T("SELECT")).each(function(elem){if(elem.type=="checkbox"){ops[elem.name] = elem.checked;return;}if(elem.type=="radio" && !elem.checked){return;}ops[elem.name] = elem.value;});
				if(ops.songDestination == "me"){ops.userMail = VAR_loggerUser.userMail;}
				if(!ops.userMail.match(/^[a-z0-9\._\+\-]+@[a-z0-9\.\-]+\.[a-z]{2,6}$/)){alert("wrong mail");return;}

				h = $fix(h).empty();
				$C("P",{innerHTML:"A connected user with this song available is going to send it to you, this may can take a few minutes, please wait..."},h);

				var params = "command=sendSongToMailFromSongID&"+$toUrl(ops);
				ajaxPetition("resources/PHP/API_beronStorage.php",params,function(ajax){
					var r = eval("("+ajax.responseText+")");
					if(parseInt(r.errorCode)>0){alert(print_r(r));removeThemeInfo(h);return;
					}
					$C("P",{innerHTML:"Song transfer completed, if you dont receive the mail in the next minutes please check your SPAM box or mail spelling."},h.empty());
					var d = $C("DIV",{className:"buttonHolder"},h);
					d.appendChild(createGnomeButton("Aceptar",function(){removeThemeInfo(d);}));
					$C("I",{className:"floatSeparator"},h);
				});
			}

			if(parseInt(songID) < 1){return;}

			info_create("sendSongDialog",{},$_("songNode_"+songID+"_getSong"));
			var h = $_("info_sendSongDialog_container").empty();
			$C("INPUT",{type:"hidden",name:"songID",value:songID},h);
			if(!VAR_loggerUser){
				//$C("P",{innerHTML:"Por favor indicanos la dirección de correo electrónico a la que desees que llegue esta canción. Informaremos a quién disponga de ella para que te la envie lo antes posible."},h);
				$C("P",{innerHTML:"Please let us know the email address in which you want to get this song. We will report someone who have it to sent to you as soon as possible."},h);
				$C("INPUT",{type:"hidden",name:"songDestination",value:"friend"},h);
				$C("INPUT",{name:"userMail"},$C("DIV",{className:"inputText"},h));
			}else{
				$C("P",{innerHTML:"On this moment you can choose between send this song to your own mail account ("+VAR_loggerUser.userMail+") or send it to a friend."},h);
				var d = $C("DIV",{},h);
				$C("INPUT",{type:"radio",className:"radio",name:"songDestination",value:"me",checked:"checked"},d);$C("SPAN",{innerHTML:"Myselft"},d);
				var d = $C("DIV",{},h);
				$C("INPUT",{type:"radio",className:"radio",name:"songDestination",value:"friend"},d);$C("SPAN",{innerHTML:"A friend"},d);
				$C("INPUT",{name:"userMail"},$C("DIV",{className:"inputText"},d));
			}

			var d = $C("DIV",{className:"buttonHolder"},h);
			d.appendChild(createGnomeButton("OK",function(){sendMail(h,this);}.bind(this)));
			d.appendChild(createGnomeButton("Cancel",function(){removeThemeInfo(d);}));
			$C("I",{className:"floatSeparator"},h);
		},
		recoverPossibleSong: function(mailID,elem){
			var params = "command=recoverPossibleSong&mailID="+mailID;
			ajaxPetition(this.vars.apiPath+"API_beronStorage.php",params,function(ajax){
				var r = eval("("+ajax.responseText+")");if(parseInt(r.errorCode)>0){alert(print_r(r));return;}
				alert(print_r(r));
			});
		}
	});

	var _beron = new beron();

