//funciones ajax final

function crearInstancia(){
	XMLHttp= false;
	if (window.XMLHttpRequest){
		return new XMLHttpRequest();
	}
	else if (window.ActiveXObject){
		var versiones = ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "Msxml2.XMLHTTP.3.0", "Msxml2.HTTP", "Microsoft.XMLHTTP"];
		for (var i=0; i<versiones.length; i++){
			try {
				XMLHttp = new ActiveXObject (versiones[i]);
				if (XMLHttp){
					return XMLHttp;
					break;
				}
			}catch(e){};
		}
	}
}
function TerminarProcesocarga(){
	Effect.BlindDown('contenedor');
	Effect.BlindUp('download');
	div = document.getElementById("apDiv1");
	div.style.display = 'none';
}
function CargaRespuesta(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("contenedor").innerHTML="<div align=\"center\" style=\"width:100%\"><strong>downloading information, please wait.</strong><br><img src=images/ajax-loader.gif ></div>";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("contenedor").innerHTML=respuesta;
		setTimeout("TerminarProcesocarga()", 1000);
		
	}
	
}
function CargarInformacion(funcion){
	Effect.BlindUp('contenedor');
	Effect.BlindDown('download');
	setTimeout(funcion, 1000);
	div = document.getElementById("apDiv1");
	div.style.display = '';
	//document.getElementById("contenedor").innerHTML="";
}

//funciones de registro
function Register(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/register-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}

function isEmailAddress(theElement){
	var s = theElement.value;
	var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
	if (s.length == 0 )
		return true;
	if (filter.test(s))
		return true;
	else
		return false;
}
function ValidaFormularioRegister(estado,ResultadoValidacion){
	
	if(estado==true)
	{
		if(ResultadoValidacion==true)
		{
			document.getElementById("ResultadoRegistro").innerHTML="<strong>Sending Form, Please Wait ...</strong><br><img src=images/ajax-loader.gif >";
			document.formregisteruser.submit()
			
		}
		else
		{
			document.getElementById("ResultadoRegistro").innerHTML="<strong><img src=images/warning.png align='absmiddle' /><br>Enter the information requested<br></strong>";
			Effect.BlindDown('FormularioRegistro');
		}
	}
	else
	{
		document.getElementById("ResultadoRegistro").innerHTML="<strong>Processing</strong><br><img src=images/ajax-loader.gif >";
		Effect.BlindUp('FormularioRegistro');
		
	
	
	var error = 0
	
	if(document.formregisteruser.email.value == "" ){
		error = 1;
	}
	if(document.formregisteruser.password.value == ""){
		error = 1;
	}
	if(document.formregisteruser.c_password.value == ""){
		error = 1;
	}
	if(document.formregisteruser.name.value == ""){
		error = 1;
	}
	if(document.formregisteruser.lastname.value == ""){
		error = 1;
	}
	if(document.formregisteruser.address.value == ""){
		error = 1;
	}
	if(document.formregisteruser.city.value == ""){
		error = 1;
	}
	if(document.formregisteruser.state.value == ""){
		error = 1;
	}
	if(document.formregisteruser.zipcode.value == ""){
		error = 1;
	}
	if(document.formregisteruser.phone.value == ""){
		error = 1;
	}
	if(document.formregisteruser.term.checked =! "checked"){
		error = 1;
	}

	if(error==0){
		
		setTimeout("ValidaFormularioRegister(true,true)", 2000);
	}
	else
	{
		
		setTimeout("ValidaFormularioRegister(true,false)", 2000);
	}
}

}
function ResultadoFormularioRegistro(respuesta,MostrarFormulario){
	
	var mensaje = respuesta;
  
    document.getElementById('ResultadoRegistro').innerHTML=mensaje;
	
	if(MostrarFormulario){
		Effect.BlindDown('FormularioRegistro');
	}
	
	
	}

//funciones de registro de tipo de usuarios
function RegisterMakers(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/register-makers.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}

function RecuperarPass(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/recuperar-contrasena.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}

function CambiaRegistroMarkers(){
	if(document.TypeUser.Type.options[document.TypeUser.Type.selectedIndex].text == "Artist / Producer"){
		Effect.BlindDown('artist');
		Effect.BlindUp('label');
	}
	else {
		Effect.BlindDown('label');
		Effect.BlindUp('artist');
	}
}
function ValidaFormularioRegisterArtists(estado,ResultadoValidacion){
	
	if(estado==true){
		if(ResultadoValidacion==true){
			document.getElementById("ResultadoRegistro").innerHTML="<strong>Sending Form, Please Wait ...</strong><br><img src=images/ajax-loader.gif >";
			document.artist.submit()
		} else {
			document.getElementById("ResultadoRegistro").innerHTML="<strong><img src=images/warning.png align='absmiddle' /><br>Enter the information requested<br></strong>";
			Effect.BlindDown('FormularioRegistro');
		}
	} else {
		document.getElementById("ResultadoRegistro").innerHTML="<strong>Processing</strong><br><img src=images/ajax-loader.gif >";
		Effect.BlindUp('FormularioRegistro');
		
		var error = 0
	
		//validacion de los campos

		if(error==0){
		
			setTimeout("ValidaFormularioRegisterArtists(true,true)", 2000);
		} else {
			setTimeout("ValidaFormularioRegisterArtists(true,false)", 2000);
		}
	}
}
function ResultadoFormularioRegistroArtists(respuesta,MostrarFormulario){
	
	var mensaje = respuesta;
  
    document.getElementById('ResultadoRegistro').innerHTML=mensaje;
	
	if(MostrarFormulario){
		Effect.BlindDown('FormularioRegistro');
	}
	
	
	}
function ValidaFormularioRegisterLabel(estado,ResultadoValidacion){
	
	if(estado==true){
		if(ResultadoValidacion==true){
			document.getElementById("ResultadoRegistro").innerHTML="<strong>Sending Form, Please Wait ...</strong><br><img src=images/ajax-loader.gif >";
			document.label.submit()
		} else {
			document.getElementById("ResultadoRegistro").innerHTML="<strong><img src=images/warning.png align='absmiddle' /><br>Enter the information requested<br></strong>";
			Effect.BlindDown('FormularioRegistro');
		}
	} else {
		document.getElementById("ResultadoRegistro").innerHTML="<strong>Processing</strong><br><img src=images/ajax-loader.gif >";
		Effect.BlindUp('FormularioRegistro');
		
		var error = 0
	
		//validacion de los campos
		if(document.label.label_name.value == ""){
			error = 1;	
		}

		if(document.label.home_page.value == ""){
			error = 1;	
		}
		
		if(error==0){
		
			setTimeout("ValidaFormularioRegisterLabel(true,true)", 2000);
		} else {
			setTimeout("ValidaFormularioRegisterLabel(true,false)", 2000);
		}
	}
}
function ResultadoFormularioRegistroLabel(respuesta,MostrarFormulario){
	
	var mensaje = respuesta;
  
    document.getElementById('ResultadoRegistro').innerHTML=mensaje;
	
	if(MostrarFormulario){
		Effect.BlindDown('FormularioRegistro');
	}
	
	
	}

//funciones para el customize artists profile
function CustomizeArtist(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/artist-profile-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}

function CustomizeArtist(IDArtista){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/artist-profile-ajax.php?IDArtista="+IDArtista;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}
function SaveArtistProfile(){
	document.getElementById("div_upload").innerHTML="<strong>Creating, Please Wait ...</strong><br><img src=images/ajax-loader.gif >";
	Effect.BlindDown('div_upload');
	Effect.BlindUp('form_div_upload');
	
	setTimeout("document.form_upload.submit()", 1000);
}
function ResultadoCustomizeArtist(estado,MostrarFormulario) {
    
    var mensaje = estado;
  
    document.getElementById('div_upload').innerHTML=mensaje;
	if(MostrarFormulario){
		Effect.BlindDown('form_div_upload');
	}
	
    }

//funciones uploaad music
function UploadtrackMusic(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/upload-track-ajax.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
}
function ChangeUploadMusic(){
		if(document.type.SelectType.options[document.type.SelectType.selectedIndex].text == "Release"){
			Effect.BlindDown('chart');
			Effect.BlindUp('track');
		}
		else{
			Effect.BlindDown('track');
			Effect.BlindUp('chart');
		}
	}
function RespuestaUploadTrack(estado) {
    
    var mensaje = estado;
  document.getElementById("LinkUpload").innerHTML = "<a onclick='upload_track_music(); return false;' href='#'>Upload Track Music Now</a><br />";
    document.getElementById('div_upload').innerHTML=mensaje;
	Effect.BlindDown('chart');
    }
	

	
	
	function RespuestaCreateDemo(estado) {
    
    var mensaje = estado;
    document.getElementById('OptionMusicManager').innerHTML=mensaje;
	Effect.BlindDown('OptionMusicManager');
	
	setTimeout("CargarInformacion('manager_track()')", 1000);
	
    }
function SendFormChart(){
		document.getElementById("LinkUpload").innerHTML = "<img src=images/ajax-loader_.gif><strong>Upload in Progress</strong>";
		document.getElementById("div_upload").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Processing</strong>";
		Effect.BlindUp('chart');
		setTimeout("ValidarUploadChart()", 3000);
}



























function SubirTrackRelease(DIVFormulario,Formulario){
	
	document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Processing</strong>";		
	Effect.BlindUp(DIVFormulario);
	setTimeout("ValidarSubirTrackRelease('"+DIVFormulario+"','"+Formulario+"')", 3000);
	
}
function ValidarSubirTrackRelease(DIVFormulario,Form){
		
		var error = 0;
		document.getElementById(Form).Track.style.border='';
		document.getElementById(Form).TrackName.style.border='';
		
		if(document.getElementById(Form).Track.value == "" && !error){
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Seleccione un track<br></strong>";
			document.getElementById(Form).Track.style.border='#F00 solid 1px';
			Effect.BlindDown(DIVFormulario);
			error = 1;
		}
		
		if(document.getElementById(Form).TrackName.value == "" && !error){
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Seleccione un nombre del track<br></strong>";
			document.getElementById(Form).TrackName.style.border='#F00 solid 1px';
			Effect.BlindDown(DIVFormulario);
			error = 1;
		}
		
		
		
		
				
		if(error==0){
			
			document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Upload Track, please wait...</strong>";
			document.getElementById(Form).submit();
		}
		
	
}


function RespuestaSubirTrackRelease(estado) {
    
    var mensaje = estado;
    document.getElementById('OptionMusicManager').innerHTML=mensaje;
	Effect.BlindDown('OptionMusicManager');
	
	setTimeout("CargarInformacion('manager_track()')", 1000);
	
}



function SubirTrackSolo(ID){
		document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Processing</strong>";		
		Effect.BlindUp('SubirTRack'+ID);
		setTimeout("ValidarSubirTrackSolo("+ID+")", 3000);
}

function ValidarSubirTrackSolo(ID){
		
		var error = 0;
		document.getElementById("FormSubirTrackSolo"+ID).categories.style.border='';
		document.getElementById("FormSubirTrackSolo"+ID).ArtWork.style.border='';
		document.getElementById("FormSubirTrackSolo"+ID).Label.style.border='';
		
		
		if(document.getElementById("FormSubirTrackSolo"+ID).categories.value == "null"){
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Choose genre<br></strong>";
			document.getElementById("FormSubirTrackSolo"+ID).categories.style.border='#F00 solid 1px';
			Effect.BlindDown('SubirTRack'+ID);
			error = 1;
		}
		
		
		if(document.getElementById("FormSubirTrackSolo"+ID).ArtWork.value == "" && error==0){ 
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Charge the art work of your track or release (jpg, gif, png)<br></strong>";
			document.getElementById("FormSubirTrackSolo"+ID).ArtWork.style.border='#F00 solid 1px';
			Effect.BlindDown('SubirTRack'+ID);
			error = 1;
				
		}
		
		if(document.getElementById("FormSubirTrackSolo"+ID).Label.value == "" && error==0){ 
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Label name needed<br></strong>";
			document.getElementById("FormSubirTrackSolo"+ID).Label.style.border='#F00 solid 1px';
			Effect.BlindDown('SubirTRack'+ID);
			error = 1;
				
		}
		
		if(document.getElementById("FormSubirTrackSolo"+ID).Track.value == "" && error==0){ 
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Track needed<br></strong>";
			document.getElementById("FormSubirTrackSolo"+ID).Track.style.border='#F00 solid 1px';
			Effect.BlindDown('SubirTRack'+ID);
			error = 1;
				
		}
		
		if(document.getElementById("FormSubirTrackSolo"+ID).TrackName.value == "" && error==0){ 
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Track name needed<br></strong>";
			document.getElementById("FormSubirTrackSolo"+ID).TrackName.style.border='#F00 solid 1px';
			Effect.BlindDown('SubirTRack'+ID);
			error = 1;
				
		}
		
				
		if(error==0){
			
			document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Uploading Track, please wait...</strong>";
			document.getElementById("FormSubirTrackSolo"+ID).submit();
			
			
		}
	
	}
	
	function CancelarOperacionSubirTrackSolo(ID){
		document.getElementById("OptionMusicManager").innerHTML="";
		document.getElementById("IFRAMESUBIRTRACK").src="";
		Effect.BlindDown('SubirTRack'+ID);
	}



function CrearRelease(ID){
		document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Processing</strong>";		
		Effect.BlindUp('FormularioCreacionReleaseNuevo'+ID);
		setTimeout("ValidarCreacionRelease("+ID+")", 3000);
}

function ValidarCreacionRelease(ID){
		
		var error = 0;
		document.getElementById("FormCreacionRelease"+ID).categories.style.border='';
		document.getElementById("FormCreacionRelease"+ID).Chart.style.border='';
		document.getElementById("FormCreacionRelease"+ID).ArtWork.style.border='';
		document.getElementById("FormCreacionRelease"+ID).Label.style.border='';
		
		
		if(document.getElementById("FormCreacionRelease"+ID).categories.value == "null"){
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Choose genre<br></strong>";
			document.getElementById("FormCreacionRelease"+ID).categories.style.border='#F00 solid 1px';
			Effect.BlindDown('FormularioCreacionReleaseNuevo'+ID);
			error = 1;
		}
		
		if(document.getElementById("FormCreacionRelease"+ID).Chart.value == "" && error==0){
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Release name needed<br></strong>";
			document.getElementById("FormCreacionRelease"+ID).Chart.style.border='#F00 solid 1px';
			Effect.BlindDown('FormularioCreacionReleaseNuevo'+ID);
			error = 1;
			
		}
		
		if(document.getElementById("FormCreacionRelease"+ID).ArtWork.value == "" && error==0){ 
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Charge the art work of your track or release (jpg, gif, png)<br></strong>";
			document.getElementById("FormCreacionRelease"+ID).ArtWork.style.border='#F00 solid 1px';
			Effect.BlindDown('FormularioCreacionReleaseNuevo'+ID);
			error = 1;
				
		}
		
		if(document.getElementById("FormCreacionRelease"+ID).Label.value == "" && error==0){ 
			document.getElementById("OptionMusicManager").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Label name needed<br></strong>";
			document.getElementById("FormCreacionRelease"+ID).Label.style.border='#F00 solid 1px';
			Effect.BlindDown('FormularioCreacionReleaseNuevo'+ID);
			error = 1;
				
		}
		
				
		if(error==0){
			
			document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Creating release, please wait...</strong>";
			document.getElementById("FormCreacionRelease"+ID).submit();
		}
	
	}


function RespuestaCrearRelease(estado) {
    
    var mensaje = estado;
    document.getElementById('OptionMusicManager').innerHTML=mensaje;
	Effect.BlindDown('OptionMusicManager');
	
	setTimeout("CargarInformacion('manager_track()')", 1000);
	
}






















function ValidarUploadChart(){
		var error = 0;
		if(document.uploadchart.categories.value == "null"){
			document.getElementById("div_upload").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Choose genre<br></strong>";
			Effect.BlindDown('chart');
			error = 1;
		}
		if(document.uploadchart.Chart.value == "" && error==0){
			document.getElementById("div_upload").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Release name needed<br></strong>";
			Effect.BlindDown('chart');
			error = 1;
			
		}
		
		if(document.uploadchart.ArtWork.value == "" && error==0){ 
			document.getElementById("div_upload").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Charge the art work of your track or release (jpg, gif, png)<br></strong>";
			Effect.BlindDown('chart');
			error = 1;
				
		}
		
		var ntrack = 0;
		if(document.uploadchart.track1.value != "")
			ntrack++;
		if(document.uploadchart.track2.value != "")
			ntrack++;
		if(document.uploadchart.track3.value != "")
			ntrack++;
		if(document.uploadchart.track4.value != "")
			ntrack++;
		if(document.uploadchart.track5.value != "")
			ntrack++;
		if(document.uploadchart.track6.value != "")
			ntrack++;
		
		
		
		if(ntrack <3 && error==0){ 
			document.getElementById("div_upload").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Minimum 3 tracks<br></strong>";
			Effect.BlindDown('chart');
			error = 1;
				
		}
		
		if(error==0){
			
			document.getElementById("div_upload").innerHTML="<img src=images/ajax-loader.gif > <br><strong>Creating release, please wait...</strong>";
			document.uploadchart.submit();
		}
		else
		{
			document.getElementById("LinkUpload").innerHTML = "<a onclick='upload_track_music(); return false;' href='#'>Upload Track Music Now</a><br />";
			}
	
	}
function ActualizaInformacionPreceso(texto){
		var t = document.getElementById("div_upload").innerHTML;
		document.getElementById("div_upload").innerHTML = t+"<br>"+texto;
		
	}
function SendFormTrack(){
		document.getElementById("LinkUpload").innerHTML = "<strong><img src=images/ajax-loader_.gif>Upload in Progress</strong>";
		document.getElementById("div_upload").innerHTML="<strong><img src=images/ajax-loader.gif > <br>Processing</strong>";
		Effect.BlindUp('track');
		setTimeout("ValidarUploadTrack()", 3000);
	}
function ValidarUploadTrack() {
		var error = 0;
		if(document.UploadTrack.categories.value == "null"){
			document.getElementById("div_upload").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Choose genre<br></strong>";
			Effect.BlindDown('track');
			error = 1;
		}
		
		if(document.UploadTrack.ArtWork.value == "" && error==0){
			document.getElementById("div_upload").innerHTML = "<strong><img src=images/error.png align='absmiddle' /><br>Charge the art work of your track or release (jpg, gif, png)<br></strong>";
			Effect.BlindDown('track');
			error = 1;
				
		}
		
		if(error==0){
			
			document.getElementById("div_upload").innerHTML="<img src=images/ajax-loader.gif > <br>Uploading Track, Please Wait…";
			document.UploadTrack.submit();
		}
		else{
			document.getElementById("LinkUpload").innerHTML = "<a onclick='upload_track_music(); return false;' href='#'>Upload Track Music Now</a><br />";
			}
	
	}
function RespuestaUploadTrack2(estado) {
    
    var mensaje = estado;
  document.getElementById("LinkUpload").innerHTML = "<a onclick='upload_track_music(); return false;' href='#'>Upload Track Music Now</a><br />";
    document.getElementById('div_upload').innerHTML=mensaje;
	Effect.BlindDown('track');
    }

//funciones de manager track
function manager_track(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/music-manager-ajax.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	
	
}
function CreateDemo(ID){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/music-manager-ajax.php?op=create-demo&id="+ID;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=RespCreateDemo
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}

}
function UploadMoreTrack(IDArtist,IDRelease){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/music-manager-ajax.php?op=upload-more-track&idartist="+IDArtist+"&idrelease="+IDRelease;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=RespUploadMoreTrack
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}

}
function RespUploadMoreTrack(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif ><br>Upload More Track";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("OptionMusicManager").innerHTML=respuesta;
		//Effect.BlindDown('OptionMusicManager');
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
		
	}
	
}
function RespCreateDemo(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif ><br>Create Demo...";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("OptionMusicManager").innerHTML=respuesta;
		//Effect.BlindDown('OptionMusicManager');
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
		
	}
	
}
function CargaGenreIndex(id){
	
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/index-genre-subgenre-ajax.php?id="+id
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	setTimeout("CargarTop10("+id+")", 5000);
	setTimeout("slider()", 3000);
	//setTimeout("galeriaartista()", 3000);
	
	
}

function CargaSubGenreIndex(id){
	
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/index-subgenre-ajax.php?id="+id
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	setTimeout("CargarTop10("+id+")", 5000);
	setTimeout("slider()", 3000);
	//setTimeout("galeriaartista()", 3000);
	
	
}

function galeriaartista(){
	new Ferdinand.Slider('test');	
}

//funciones my accoubnt
function MyAccount(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/My-Account-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}

function TrackList(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/Track-List-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}

function ReleaseList(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/Release-List-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}
function LabelList(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/Label-List-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}
function Label(ID){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/Label-ajax.php?Label="+ID;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
}


function Buscar()
{
	
	//document.formsearch.busqueda.options[document.formsearch.busqueda.selectedIndex].value
	var busqueda=document.formsearch.busqueda.options[document.formsearch.busqueda.selectedIndex].value;
	var criterio = document.formsearch.criterio.value;
	switch (busqueda)
	{
		case 'Artists'	: CargarInformacion('BuscarArtist(\''+criterio+'\')'); break;
		case 'Tracks'	: CargarInformacion('BuscarTrack(\''+criterio+'\')'); break;
		case 'Releases'	: CargarInformacion('BuscarRelease(\''+criterio+'\')'); break;
		case 'Labels'	: CargarInformacion('BuscarLabels(\''+criterio+'\')'); break;
		
		
	}
}

function BuscarArtist(criterio){
		XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/artist-ajax.php?search="+criterio;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}

}

function BuscarTrack(criterio){
		XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Track-List-ajax.php?search="+criterio;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}

}
function BuscarRelease(criterio){
		XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Release-List-ajax.php?search="+criterio;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}

}

function BuscarLabels(criterio){
		XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Label-List-ajax.php?search="+criterio;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}

}







//funciones ajax para crear los artistas
function create_artist()
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/create-artist-ajax.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function create_artist2(ID)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/create-artist-ajax.php?op=editar&id="+ID;
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function cambiarestado_crate_artist(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("contenedor").innerHTML="<img src=images/ajax-loader.gif >";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("contenedor").innerHTML=respuesta;
		Effect.BlindDown('contenedor');
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
	}
	
}

function send_create_artist()
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		var Formulario = document.getElementById('form_create_artist');
        var longitudFormulario = Formulario.elements.length;
        var cadenaFormulario = ""
        var sepCampos
         sepCampos = ""
         for (var i=0; i <= Formulario.elements.length-1;i++)
		{
        	cadenaFormulario += sepCampos+Formulario.elements[i].name+'='+encodeURI(Formulario.elements[i].value);
        	sepCampos="&";
		}
		url = "php_ajax/create-artist-ajax.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.setRequestHeader('Content-Type', 'multipart/form-data;');
		XMLHttp.setRequestHeader("Connection", "close");

		XMLHttp.onreadystatechange=cambiarestado_send_crate_artist
		XMLHttp.send(cadenaFormulario)
	}else{
		alert ('Error');
	}
	return false;
}

function cambiarestado_send_crate_artist(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("result_create_artist").innerHTML="<img src=images/ajax-loader.gif >";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("result_create_artist").innerHTML=respuesta;
		Effect.BlindDown('result_create_artist');
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
	}
	
}


//funciones para lista de artiistas
function artist()
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/artist-ajax.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=cambiarestado_artist
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}



function view_artist(id)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/artist-ajax.php?artist="+id;
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=cambiarestado_artist
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function cambiarestado_artist(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("contenedor").innerHTML="<img src=images/ajax-loader.gif >";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("contenedor").innerHTML=respuesta;
		Effect.BlindDown('contenedor');
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
	}
	
}









function ManagerArtist()
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/manager-artist.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}




function ManagerArtist(op,id)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		Effect.BlindUp('contenedor');
		url = "php_ajax/manager-artist.php?op="+op+"&id="+id;
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}
function MostrarCart()
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		Effect.BlindUp('contenedor');
		url = "php_ajax/Cart-ajax.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}



function LoadGenres()
{
	categoria=document.uploadchart.categories.value;
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php/subcat.php?id_cat="+categoria;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=cambiarestado_cat
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	
	
}

function LoadGenres2()
{
	categoria=document.FormCreacionRelease.categories.value;
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php/subcat.php?id_cat="+categoria;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=cambiarestado_cat
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	
	
}

function LoadGenres4(ID)
{
	categoria=document.getElementById("FormSubirTrackSolo"+ID).categories.value;
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php/subcat.php?id_cat="+categoria;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=function() { 
			var respuesta;
			if (XMLHttp.readyState==2){
			document.getElementById("subcategorias"+ID).innerHTML="<img src=images/ajax-loader.gif >";
		}
		if (XMLHttp.readyState==4){
			respuesta= XMLHttp.responseText;
			document.getElementById("subcategorias"+ID).innerHTML=respuesta;
		}
		
		};
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	
	
}

function LoadGenres5(ID)
{
	categoria=document.getElementById("FormCreacionRelease"+ID).categories.value;
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php/subcat.php?id_cat="+categoria;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=function() { 
			var respuesta;
			if (XMLHttp.readyState==2){
			document.getElementById("subcategoriasr"+ID).innerHTML="<img src=images/ajax-loader.gif >";
		}
		if (XMLHttp.readyState==4){
			respuesta= XMLHttp.responseText;
			document.getElementById("subcategoriasr"+ID).innerHTML=respuesta;
		}
		
		};
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	
	
}

function cambiarestado_cat(){
	
	var respuesta;
			if (XMLHttp.readyState==2){
			document.getElementById("subcategorias"+ID).innerHTML="<img src=images/ajax-loader.gif >";
		}
		if (XMLHttp.readyState==4){
			respuesta= XMLHttp.responseText;
			document.getElementById("subcategorias"+ID).innerHTML=respuesta;
		}
}

function cambiarestado_cate(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("subcategorias2").innerHTML="<img src=images/ajax-loader.gif >";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("subcategorias2").innerHTML=respuesta;
	}
	
}
function LoadGenresTrack()
{
	categoria=document.UploadTrack.categories.value;
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php/subcat.php?id_cat="+categoria;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=cambiarestado_catTrack
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	
	
	
}

function cambiarestado_catTrack(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("subcategorias2").innerHTML="<img src=images/ajax-loader.gif >";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("subcategorias2").innerHTML=respuesta;
	}
	
}








function carga_upload(id)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/upload-ajax.php";
		XMLHttp.open ("POST", url, true);
		XMLHttp.onreadystatechange=cambiarestado_upload
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}







function cambiarestado(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("contenedor").innerHTML="<img src=images/ajax-loader.gif >";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("contenedor").innerHTML=respuesta;
	}
	
}

function cargarsearch(id, type){
	
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "funcionesajax.php?id="+id+"&type="+type;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=cambiarestado
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
	Effect.BlindDown('contenedor');
}

function agregar_carro(id)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Cart-ajax.php?op=add-track&id="+id;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargarCarro
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
}


function CargarCarro(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("cart").innerHTML="<div align=\"center\" style=\"width:100%\"><strong>Please Wait.</strong><br><img src=images/ajax-loader.gif ></div>";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("cart").innerHTML=XMLHttp.responseText;
		//Effect.BlindDown('cart');
	}
	
}




function delete_cart(id)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "cart-ajax.php?op=delete-track&id="+id;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=cambiarestado_cart
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
}



function cambiarestado_upload(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("apDiv1").style.display="";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("contenedor").innerHTML=respuesta;
		document.getElementById("apDiv1").style.display="none";
		Effect.BlindDown('contenedor');
	}
	
}

function cambiarestado_player(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("player").innerHTML="<img src=images/ajax-loader.gif >";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("player").innerHTML=respuesta;
	}
	
}



function cambiarestado_cart(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("contenedor").innerHTML="<img src=images/ajax-loader.gif >";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("contenedor").innerHTML=respuesta;
	}
	
}

function CambiarPlayer(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("player").innerHTML="<img src=images/ajax-loader.gif >";
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("player").innerHTML=respuesta;
	}
	
}

function SetPlayer(id){

	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/player_ajax.php?id="+id;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CambiarPlayer
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
}






function DeleteTrackRelease(ID)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/music-manager-ajax.php?op=delete-track-release&id="+ID;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=RespDeleteTrackOptionManagerMusic
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}

}

function DeleteRelease(ID)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/music-manager-ajax.php?op=delete-release&id="+ID;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=RespDeleteTrackOptionManagerMusic
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}

}

function RespDeleteTrackOptionManagerMusic(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif ><br>Deleting Track Please Wait...";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("OptionMusicManager").innerHTML=respuesta;
		//Effect.BlindDown('OptionMusicManager');
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
		//Effect.Highlight('OptionMusicManager');
		setTimeout("CargarInformacion('manager_track()')", 1000);
		
	}
	
}

function CreateRelease(){
	
	document.getElementById("OptionMusicManager").innerHTML="<img src=images/ajax-loader.gif ><br>Creating Release Please Wait...";
	div = document.getElementById("apDiv1");
	div.style.display = '';
	
}

function DeterminarPrecio(ID,PRECIO,LLAMADA){
	
	var mp3 = document.getElementById("mp3"+ID);
	var wav = document.getElementById("wav"+ID);
	
	if(LLAMADA=='mp3')
	{
		wav.checked = "";
		mp3.checked = "checked";
		var P = parseFloat(PRECIO); 
		document.getElementById("precio"+ID).innerHTML="&euro; " + P.toFixed(2);
		
	}
	else
	{
		mp3.checked = "";
		wav.checked = "checked";
		var P = parseFloat(PRECIO) + parseFloat("1");
		document.getElementById("precio"+ID).innerHTML="&euro; " +P.toFixed(2);
	}
	
	
	
}





function BusquedaArtistas(Criterio)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Busqueda-Artistas-ajax.php?"+Criterio;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function BusquedaRelease(Criterio)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Busqueda-Release-ajax.php?"+Criterio;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function PerfilArtista(ID)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Perfil-Artista-ajax.php?id="+ID
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function SalesInformation()
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Sales-Information-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function SalesInformation(MES,ANO)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Sales-Information-ajax.php?MES="+MES+"&ANO="+ANO;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}

function PerfilArtista2(ID,RELEASE)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		
		url = "php_ajax/Perfil-Artista-ajax.php?id="+ID+"&release="+RELEASE;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=CargaRespuesta
		XMLHttp.send('')
	}else{
		alert ('Error');
	}
	
}




function DeleteItemCart(ID)
{
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/Cart-ajax.php?op=delete-track&id="+ID;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=RespDeleteItemCart
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}

}

function RespDeleteItemCart(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("OptionCart").innerHTML="<img src=images/ajax-loader.gif ><br>Deleting Track Please Wait...";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("OptionCart").innerHTML=respuesta;
		//Effect.BlindDown('OptionMusicManager');
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
		//Effect.Highlight('OptionMusicManager');
		setTimeout("CargarInformacion(\'MostrarCart()\');", 1000);
		
	}
	
}

function EnviaFormularioCart()
{
	document.getElementById("OptionCart").innerHTML="<strong>processing your purchase ...</strong><br><img src=images/ajax-loader.gif >";
	Effect.BlindUp('DivFormCart');
	setTimeout("document.Cart.submit()",1000);	
}

function ResultadoCheckout(respuesta){
	
	var mensaje = respuesta;
  
    document.getElementById('DivFormCart').innerHTML=mensaje;
	Effect.BlindDown('DivFormCart');
	Effect.BlindUp('OptionCart');
	
}


function MostrarTop10()
{
	CargarTop10();
}

function CargarTop10(){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/Top10-ajax.php";
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=RespTop10;
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
}

function CargarTop10(Genre){
	XMLHttp= crearInstancia();
	if (XMLHttp){
		url = "php_ajax/Top10-ajax.php?Genre="+Genre;
		XMLHttp.open ("GET", url, true);
		XMLHttp.onreadystatechange=RespTop10;
		XMLHttp.send(null)
	}else{
		alert ('Error');
	}
}

function RespTop10(){
	var respuesta;
	if (XMLHttp.readyState==2){
		document.getElementById("Top10").innerHTML="<img src=images/ajax-loader.gif ><br>Loading Top 10";
		div = document.getElementById("apDiv1");
		div.style.display = '';
	}
	if (XMLHttp.readyState==4){
		respuesta= XMLHttp.responseText;
		document.getElementById("Top10").innerHTML=respuesta;
		div = document.getElementById("apDiv1");
		div.style.display = 'none';
		
	}
	
}
