/* INICIALIZACIONES */
			$(document).ready(function(){
				$('ul.listaBandas li,ul.listaBandas2 li').hover(function(){
									$(this).find('span').animate({height:'80px'},{queue:false,duration:250});
								}, function(){
										$(this).find('span').animate({height:'2px'},{queue:false,duration:250});
				});
				$(".menuevents, .menureleases").hide();
				
				$("#homeb, #news, #releasesmenu, #album, #comps, #single, #eventsmenu, #events, #rumble, #tour, #management, #radio,  #blog, #contact").blend();
				
				$("a[rel^='prettyPhoto']").prettyPhoto();

				$("#homeb, #news, #management, #radio, #store, #blog, #contact").click(function(){				
							$(".menureleases").slideUp();	
							$(".menuevents").slideUp();	
							$("#single").css('background-position','-118px -6px');
							$("#comps").css('background-position','-66px -6px');
							$("#album").css('background-position','-9px -6px');
							$("#events").css('background-position','-9px -6px');
							$("#rumble").css('background-position','-55px -6px');
							$("#tour").css('background-position','-115px -6px');
				});
				$("#homeb").click(function(){
					
					//$(".main").load("home.php");
					$(this).css('background-position','-41px 103px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 63px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$("#contact").css('background-position','-549px 63px');
				});
				$(".banda").click(function(){								
						$(".menureleases").hide();
						$("#homeb").css('background-position','-41px 63px');
						$("#management").css('background-position','-285px 103px');
						var id = $(this).attr("tabindex");
						$(".main").load("management_artist.php?id=" + id,{},function(){
							$('#s2').cycle({ 
								fx:     'scrollLeft', 
								timeout: 0, 
								next:   '#next2', 
								prev:   '#prev2' 
							});
							$("#artist_combo").change(function(){
								var id = $(this).val(); 	
								trece(id);
							});
						});
				});
				$("#news").click(function(){
					
					//news();		
					$("#homeb").css('background-position','-41px 63px');
					$(this).css('background-position','-96px 103px');
					$("#releasesmenu").css('background-position','-151px 63px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$("#contact").css('background-position','-549px 63px');	
				
					//return false;					
				});
				$("#releasesmenu").click(function(){
					$(".menuevents").hide();	
					$(".menureleases").slideDown();	
					$(this).css('background-position','-151px 103px');
					return false;
				});	
				$("#album").click(function(){
				
					cargaAlbum();
					$("#homeb").css('background-position','-41px 63px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 103px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$("#events").css('background-position','-9px -6px');
					$("#rumble").css('background-position','-55px -6px');
					$("#tour").css('background-position','-115px -6px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$("#contact").css('background-position','-549px 63px');
					$(this).css('background-position','-9px -38px');
					$("#comps").css('background-position','-66px -6px');
					$("#single").css('background-position','-118px -6px');
				//	return false;
				});	
				$("#comps").click(function(){
				
					//cargaComps();
					$("#homeb").css('background-position','-41px 63px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 103px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$("#events").css('background-position','-9px -6px');
					$("#rumble").css('background-position','-55px -6px');
					$("#tour").css('background-position','-115px -6px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$("#contact").css('background-position','-549px 63px');
					$("#album").css('background-position','-9px -6px');
					$(this).css('background-position','-66px -38px');
					$("#single").css('background-position','-118px -6px');
					//return false;
				});	
				$("#single").click(function(){
					
					//cargaSingle();
					$("#homeb").css('background-position','-41px 63px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 103px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$("#events").css('background-position','-9px -6px');
					$("#rumble").css('background-position','-55px -6px');
					$("#tour").css('background-position','-115px -6px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$("#contact").css('background-position','-549px 63px');
					$("#album").css('background-position','-9px -6px');
					$("#comps").css('background-position','-66px -6px');
					$(this).css('background-position','-118px -38px');
					//return false;
				});	
				$("#eventsmenu").click(function(){

					//$(".main").load("events.php");
					$(".menureleases").hide();		
					$(".menuevents").slideDown();
					$("#homeb").css('background-position','-41px 63px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 63px');
					$("#single").css('background-position','-118px -6px');
					$("#comps").css('background-position','-66px -6px');
					$("#album").css('background-position','-9px -6px');
					$(this).css('background-position','-227px 103px');
					$("#events").css('background-position','-9px -6px');
					$("#rumble").css('background-position','-55px -6px');
					$("#tour").css('background-position','-115px -6px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$("#contact").css('background-position','-549px 63px');
					return false;
				});
				$("#events").click(function(){			
					
					$(this).css('background-position','-9px -38px');
					$("#rumble").css('background-position','-55px -6px');
					$("#tour").css('background-position','-115px -6px');
					$("#eventsmenu").css('background-position','-227px 103px');
					//return false;
				});	

				$("#rumble").click(function(){
				
					//rumble();
					$("#events").css('background-position','-9px -6px');
					$(this).css('background-position','-55px -38px');
					$("#tour").css('background-position','-115px -6px');
					$("#eventsmenu").css('background-position','-227px 103px');
					//return false;
				});	
				$("#tour").click(function(){
				
				//	tour();
					$("#events").css('background-position','-9px -6px');
					$("#rumble").css('background-position','-55px -6px');
					$(this).css('background-position','-115px -38px');
					$("#eventsmenu").css('background-position','-227px 103px');
				//	return false;
				});		

				
				$("#management").click(function(){
					
					$("#homeb").css('background-position','-41px 63px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 63px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$(this).css('background-position','-285px 103px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$("#contact").css('background-position','-549px 63px');	

				//	return false;	 				
				});				
			
				$("#store").click(function(){
					$("#homeb").css('background-position','-41px 63px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 63px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$(this).css('background-position','-441px 103px');
					$("#contact").css('background-position','-549px 63px');
				});
				$("#contact").click(function(){
				//	$(".main").load("contact.php");
					$("#homeb").css('background-position','-41px 63px');
					$("#news").css('background-position','-96px 63px');
					$("#releasesmenu").css('background-position','-151px 63px');
					$("#eventsmenu").css('background-position','-227px 63px');
					$("#management").css('background-position','-285px 63px');
					$("#radio").css('background-position','-385px 63px');
					$("#store").css('background-position','-441px 63px');
					$(this).css('background-position','-549px 103px');
					//return false;
				});

				
				
				$("#LegalNotice").click(function(){
					$('#legal').show();
					$('.jqmOverlay').show();
					return false;
				});
				$("#PrivacyPolice").click(function(){
					$('#privacy').show();
					$('.jqmOverlay').show();
					return false;
				});
				$(".cerrar").click(function(){
					$('#alerta').hide();
					$('#alerta_right').hide();
					$('#legal').hide();
					$('#privacy').hide();
					$('.jqmOverlay').hide();	
				});
				
				$("#newsletter").click(function(){
					check_mail();
				});
			});
			
////////////////////////////////// F U N C I  O N E S
var items_per_page =28;
function GetRelease(num,path,cat){
	if(!num || num=="")
		{
				$.post("getrelease.php", {idLanzamiento:num,u:1,cat:cat},
				   function(data){
					 $(".txt_cd h2").text(data.Nombre); 
					 $(".txt_cd h3").text(data.subtitulo); 
					 $(".txt_cd p").html(data.Descripcion);					 
					 $("#image_cd").html("<img src='"+path + data.Foto+"'>"); 
				   }, "json");
		}
		else
		{
				$.post("getrelease.php", {idLanzamiento:num,r:1,cat:cat},
				   function(data){
					 $(".txt_cd h2").text(data.Nombre); 
					 $(".txt_cd h3").text(data.subtitulo); 
					 $(".txt_cd p").html(data.Descripcion); 
 					 $("#image_cd").html("<img src='"+path + data.Foto+"'>"); 
					 alert(path + data.Foto);
					
/*					alert(data.Nombre + "\n" +
						  data.subtitulo + "\n" +
						  data.Descripcion + "\n" +
						  data.Foto + "\n"
						  );
					*/
				   }, "json");
		}
}
function Comps(total_registros,path,cat){
	
	//GetRelease("",path,cat);
	var opt = {callback: pageselectCallback};
	opt.items_per_page=28; // calculo de links
	opt.num_display_entries=8;
	opt.next_text=" &gt; Next ";
	opt.prev_text=" &lt; Previous ";
	opt.num_edge_entries = 2;
	$("#Pagination").pagination(total_registros,opt);

	function pageselectCallback(page_index, jq){
			//var total_registros =17;
			var items_per_page =28; // resultado
			var max_elem = Math.min((page_index+1) * items_per_page, total_registros);
			var newcontent = '';
			$.get("getrelease.php", { b:(page_index * items_per_page), l:items_per_page,v:1,cat:cat },
			function(data){
					  $('.main #Searchresult').html(data);
			});
			return false;
		}
}
function News(total_registros){
	
	var opt = {callback: pageselectCallbackNwes};
	opt.items_per_page=3;
	opt.num_display_entries=5;
	opt.next_text=" &gt; Next ";
	opt.prev_text=" &lt; Previous ";
	$("#Pagination").pagination(total_registros,opt);
	function pageselectCallbackNwes(page_index, jq){
		var items_per_page =3; // resultado
		var max_elem = Math.min((page_index+1) * items_per_page, total_registros);
		var newcontent = '';
		$.get("getnews.php", { b:(page_index * items_per_page), l:items_per_page ,v:1},
		function(data){
				    $('#Searchresult').html(data);
					$(".read").click(function(){
							var id= $(this).attr("tabindex");
						    $(".main").load("news_inside.php?id=" + id,{},function(){
									$(".volver").click(function(){
										 $(".main").load("news.php",{},function(){
														$.post("getnews.php", {c:1},
														function(data){
															 News((data.cantidad-2));
														}, "json");
													});
										 return false;
									});
							}); 
					});
		});
		return false;
	}
}
function Manage(total_registros){
	
	var opt = {callback: pageselectCallbackManage};
	opt.items_per_page=15 ;
	opt.num_display_entries=5;
	opt.next_text=" &gt; Next ";
	opt.prev_text=" &lt; Previous ";
	$("#Pagination").pagination(total_registros,opt);
	
	function pageselectCallbackManage(page_index, jq){
		var items_per_page =15 ; // resultado
		var max_elem = Math.min((page_index+1) * items_per_page, total_registros);
		var newcontent = '';
		$.get("getmanagement.php", { b:(page_index * items_per_page), l:items_per_page ,v:1},
		function(data){
				 
				   $('#Searchresult').html(data);
				   
				   
				   
				   
				   $(".artist").click(function(){
						
						var id=$(this).attr("id");
						$(".cont_management").load("management_artist.php?id=" + id,{},function(){
																					 
			
							$("a[rel^='prettyPhoto']").prettyPhoto({
									animationSpeed: 'normal', /* fast/slow/normal */
									padding: 40, /* padding for each side of the picture */
									opacity: 0.35, /* Value betwee 0 and 1 */
									showTitle: false, /* true/false */
									allowresize: true, /* true/false */
									counter_separator_label: '-', /* The separator for the gallery counter 1 "of" 2 */
									theme: ' dark_rounded ', /* light_rounded / dark_rounded / light_square / dark_square */
									callback: function(){}
								});

							$('#s2').cycle({ 
								/*fx:     'scroll',*/
								timeout: 0, 
								next:   '#next2', 
								prev:   '#prev2' 
							});
							$("#artist_combo").change(function(){
								var id=$(this).val();
								trece(id);
							});
						});	
					});

		});
		return false;
	}
}
function Store(cat){
	//alert(cat);
   var total_registros;
   if(cat==undefined || cat==""){
	   $.post("getstore.php", {c:1},
	   function(data){
				total_registros=data.cant;
				var opt = {callback: pageselectCallbackManage};
				opt.num_edge_entries=1;
				opt.items_per_page=9 ;
				opt.num_display_entries=5;
				opt.next_text=" &gt; Next ";
				opt.prev_text=" &lt; Previous ";
				$("#Pagination").pagination(total_registros,opt);
				
				function pageselectCallbackManage(page_index, jq){
					var items_per_page =9 ; // resultado
					var max_elem = Math.min((page_index+1) * items_per_page, total_registros);
					var newcontent = '';
					$.get("getstore.php", { b:(page_index * items_per_page), l:items_per_page},
					function(data){
						$('#Searchresult').html(data);
						producto(cat);
						Carrito();
						Vaciar();
						$("#contador").load("contador.php");
					});
					return false;
				}

	   }, "json");
	} else{
	   $.post("getstore.php", {c:1,catp:cat},
	   function(data){
				total_registros=data.cant;
				var opt = {callback: pageselectCallbackManage};
				opt.items_per_page=9 ;
				opt.num_edge_entries=1;
				opt.num_display_entries=5;
				opt.next_text=" &gt; Next ";
				opt.prev_text=" &lt; Previous ";
				$("#Pagination").pagination(total_registros,opt);
				function pageselectCallbackManage(page_index, jq){
					var items_per_page =9 ; // resultado
					var max_elem = Math.min((page_index+1) * items_per_page, total_registros);
					var newcontent = '';
					$.get("getstore.php", { b:(page_index * items_per_page), l:items_per_page,catp:cat},
					function(data){
						$('#Searchresult').html(data);
						producto(cat);
						Carrito();
						Vaciar();
						$("#contador").load("contador.php");
					});
					return false;
				}
	   }, "json");
	
	}
}
function Vaciar(){
	
	$(".vaciar").click(function(){
			$.ajax({  
			type: "POST",  
			url: "includes/func_carrito.php",  
			data: {action: "EmptyBasket"},  
			success: function(theResponse) {
					$("#items").load("store_menu.php");
					$("#contador").load("contador.php");
				}
			});  
	});
}
function Carrito(){

	$(".buy").click(function(){
			var productID = $(this).attr("id");
			
			$.ajax({  
			type: "POST",  
			url: "includes/func_carrito.php",  
			data: { productID: productID,Cantidad: 1, action: "addToBasket"},  
			success: function(theResponse) {
						$("#items").load("store_menu.php",{},function(){
							Delete();
						});
						$("#contador").load("contador.php");
				  }  
			});  
	});
}

function Delete(){
	
	$(".delete").click(function(){

	 var productID = $(this).attr("id");
		$.ajax({  
		type: "POST",  
		url: "includes/func_carrito.php",  
		data: {productID: productID,action: "DeleteItem"},  
		success: function(theResponse) {
						$("#items").load("store_menu.php",{},function(){
							Delete();	
							$("#contador").load("contador.php");
						});
			}
		}); 
		$("#contador").load("contador.php");
	});
}

function producto(cat){

	$(".detail").click(function(){
			
			var id = $(this).attr("id");
			$(".main").load("store_details.php?id=" + id,{},function(){
					
					$("#contador").load("contador.php");	
					$("#items").load("store_menu.php",{},function(){
							Delete();	
							$("#contador").load("contador.php");
					});
					
					$(".back").click(function(){
						doce();
					});
					
					$(".product").click(function(){
						var cat=$(this).attr("id");
						doce(cat);
					});		
					Vaciar();
					
					$(".add").click(function(){
						var productIDVal = $(this).attr("id");
							$.ajax({  
							type: "POST",  
							url: "includes/func_carrito.php",  
							data: { productID: productIDVal, action: "addToBasket",Cantidad:1},  
							success: function(theResponse) {
										$("#items").load("store_menu.php",{},function(){
											Delete();
										});
										$("#contador").load("contador.php");
								  }  
							});		
					});
					$(".add_no_logeado").click(function(){
							$('#alerta').show();
							$('.jqmOverlay').show();
							$('#errores').html("You Must Login or Sing Up.");

					});
					$(".link_login").click(function(){
						$(".main").load("store_login.php",{},function(){
								Registro();
						});
					});
					checkout();
					
			});
	});
}
function check_mail(){
		
		var filtro = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@+([_a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]{2,200}\.[a-zA-Z]{2,6}$/;
		if (!filtro.test($("#mail").val())) {
				
				$('#alerta').show();
				$('.jqmOverlay').show();
				$('#errores').html("Invalid e-mail adress.");
				$("#mail").val("");
				return false;
		}
		
			var mail = $("#mail").val();
			$.post("newsletter.php", { mail:mail},
					function(data){

						if(data==1){
						
							$('#alerta_right').show();
							$('.jqmOverlay').show();
							$('#mensaje_right').html("Your e-mail adress was registred.");
							$("#mail").val("");
							
						}else{
						
							$('#alerta').show();
							$('.jqmOverlay').show();
							$('#errores').html("Your e-mail already exists.");
							$("#mail").val("");
						}
					return false;
			});
}
function Registro(){ 
		$("#boton_registro").click(function(){
			var err="";
			var str="";
			var data=new String();
			var name=$("#name").val();
			if(name=="") err="<span>Name</span> field is empty.<br>";
			var lastname=$("#lastname").val();
			if(lastname=="") err=err+"<span>Lastname</span> field is empty.<br>";
			var number=$("#number").val();
			if(number=="") err=err+"<span>Number</span> field is empty.<br>";
			
			var mail=$("#mail").val();
			var filtro = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@+([_a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]{2,200}\.[a-zA-Z]{2,6}$/;
			if (!filtro.test($("#mail").val()))
				err=err+"<span>Email</span> field is not valid.<br>";
			
			var user=$("#user").val();
			if(user=="")err=err+"<span>User</span> field is empty.<br>";
			var password=$("#password").val();
			if(password=="") err=err+"<span>Password</span> field is empty.<br>";
			var adress=$("#adress").val();
			if(adress=="") err=err+"<span>Adress</span> field is empty.<br>";
			var city=$("#city").val();
			if(city=="") err=err+"<span>City</span> field is empty.<br>";
			var zip=$("#zip").val();
			if(zip=="") err=err+"<span>Zip</span> field is empty.<br>";
			var shipping=$("#shipping").val();
			if(err>""){
						$('#alerta').show();
						$('.jqmOverlay').show();
						$('#errores').html(err);

						return false;
			}
			else{
					$.post("access.php",{user:user,mail:mail,unique:1},
					function(data){
						 data  = jQuery.trim(data);
						 if(data.length>0)
							{
									$('#alerta').show();
									$('.jqmOverlay').show();
									$('#errores').html(data);
							}
							else
							{
								   $.post("access.php",{Nombre:name,Apellido:lastname,Telefono:number,Mail:mail,Usuario:user,Clave:password,adress:adress,city:city,zip:zip,shipping:shipping,insert:1},
								   function(data){
									 doce();
								   });
							}
					});
			}
		});
		$("#logout").click(function(){
				   $.post("access.php",{logout:1},
				   function(data){
						  doce();
				   });
			});
		 $("#boton_login").click(function(){
						var data = new String();
						var userlogin=$("#userlogin").val();
						var passwordlogin=$("#passwordlogin").val();
					   $.post("access.php",{user:userlogin,pass:passwordlogin,login:1},
					   function(data){
							data  = jQuery.trim(data);
							 if(data.length>0)
								{
									$('#alerta').show();
									$('.jqmOverlay').show();
									$('#errores').html("Invalid login.");
								}
							 else
								doce();
					   });
			});
}
function YouMustLogin(){
	
	$('#alerta').show();
	$('.jqmOverlay').show();
	$('#errores').html("You Must be Logged.");
}
function OlvidoPass(){

	$("#boton_forgot_pass").click(function(){
		 var campo = $("#data").val();		
		 if(campo!=""){					
	
				$.post("olvido.php", { campo:campo },
				   function(data){
							if(data.result=="OK"){
								document.formOlvido.reset();
								$('#alerta_right').show();
								$('.jqmOverlay').show();
								$('#mensaje_right').html("Mail width data access was sent.");
							}else{
								$('#alerta').show();
								$('.jqmOverlay').show();
								$('#errores').html("Mail or User ID is not valid.");
							}
				   }, "json");	
		   }else{
					$('#alerta').show();
					$('.jqmOverlay').show();
					$('#errores').html("Mail or User ID is not valid.");
		   }
	});
}
function Contact(){
	
	$("#boton_send").click(function(){
	
			// alert("hola");
	
			var err="";			
			var name=$("#name").val();
			if(name=="")err=err+"<span>Name</span> field is empty.<br>";
			
			var lastname=$("#lastname").val();
			if(lastname=="") err=err+"<span>Lastname</span> field is empty.<br>";
			
			var mail=$("#mail").val();
			var filtro = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@+([_a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]{2,200}\.[a-zA-Z]{2,6}$/;
			if (!filtro.test($("#mail").val()))
				err=err+"<span>Email</span> Adress is not valid.<br>";
			
			var messagge=$("#messagge").val();
			if(messagge=="") err=err+"<span>Messagge</span> field is empty.<br>";

			if(err>""){
						$('#alerta').show();
						$('.jqmOverlay').show();
						$('#errores').html(err);
						return false;
			}
			else{
					$.post("contact-php.php",{name:name,lastname:lastname,mail:mail,mensaje:messagge},
					function(data){
						 data  = jQuery.trim(data);
						 if(data.length>0)
							{
								document.formContact.reset();
								$('#alerta_right').show();
								$('.jqmOverlay').show();
								$('#mensaje_right').html("Your Message was sent.");
							}
					});
			}
	});

}
function checkout(){
		
	$("#checkout").click(function(){
			$(".main").load("store_cart.php",{},function(){
				$("#items").load("store_menu.php",{},function(){
				});
			$("#logout").click(function(){
				$.post("access.php",{logout:1},
				function(data){
					doce();
				});
			});
			$(".link_login").click(function(){
				$(".main").load("store_login.php",{},function(){
					Registro();
					OlvidoPass();
				});
			});
			$(".product").click(function(){
				var cat=$(this).attr("id");
				Store(cat);
			});
			
			  $(".back").click(function(){
				 doce();
			 });
			  Volcado();
			  Carrito();

		});
	});
}
function Volcado(){
	
		$("#volcado").load("store_cart_php.php",{},function(){
															
			$(".resultado").load("store_total.php");  
			$(".delete2").click(function(){
					
					var id  = $(this).attr("tabindex");
					$.ajax({  
					type: "POST",  
					url: "includes/func_carrito.php",  
					data: {action: "EliminarProducto",productID:id},  
					success: function(theResponse) {
							$("#items").load("store_menu.php");
							$("#contador").load("contador.php");
							Volcado();
						}
					});  

			});
			$(".vaciar").click(function(){
					$.ajax({  
					type: "POST",  
					url: "includes/func_carrito.php",  
					data: {action: "EmptyBasket"},  
					success: function(theResponse) {
							$("#items").load("store_menu.php");
							$("#contador").load("contador.php");
							$(".details").hide();
							$(".resultado").load("store_total.php");  
							Volcado();
						}
					});  
			});
			$(".QUANTITY").change(function () {
					var id  = $(this).attr("tabindex");
					var val = $(this).val();
					$.ajax({  
							type: "POST",  
							url: "includes/func_carrito.php",  
							data: { productID: id,Cantidad:val, action: "SetBasket"},  
							success: function(theResponse) {
										$("#items").load("store_menu.php");
										$("#contador").load("contador.php");
										$(".resultado").load("store_total.php");  
										Volcado();
								  }  
					});  
			 });
		});
}

			function cargaAlbum() {
			
				    $.post("getrelease.php", {t:1,cat:"Album"},
					function(data){
					 Comps(data.CANT,data.path,"Album");
					}, "json");
			
			}
			function cargaComps(){
				
				    $.post("getrelease.php", {t:1,cat:"Comp"},
					function(data){
					 Comps(data.CANT,data.path,"Comp");
					}, "json");

			
/*				$(".main").load("comps.php",{},function(data){
					$.post("getrelease.php", {t:1,cat:"Comp"},
					function(data){
					 Comps(data.CANT,data.path,"Comp");
					}, "json");
				}); 
*/			
			}
			function cargaSingle(){
			
				    $.post("getrelease.php", {t:1,cat:"Single"},
					function(data){
					 Comps(data.CANT,data.path,"Single");
					}, "json");
			
			
			}

			function event(id){			
				if(id)
					var target = "event.php?id=" + id;
				else
					var target = "event.php";
			
				$(".main").load(target,{},function(data){
					slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",9);
				});
			}				
			function rumble(id){
			
				if(id)
					var target = "rumbles.php?id=" + id;
				else
					var target = "rumbles.php";
			
				$(".main").load(target,{},function(data){
					slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",10);
				});
			}				
			function tour(id){
			
				if(id)
					var target = "tour.php?id=" + id;
				else
					var target = "tour.php";
			
			
				$(".main").load(target,{},function(data){
					slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",11);
				});
			}				

			function CargaManagement(){
				$(".main").load("management.php",{},function(){
					$.post("getmanagement.php", {c:1},
					function(data){
						Manage(data.cantidad);
					}, "json");
				}); 
				return false;		
			}
		//	http://server02/Future%20Sounds/web/management_artist.php?id=14
			function CargaArtist(){
				$(".main").load("management.php",{},function(){
					$.post("getmanagement.php", {c:1},
					function(data){
						Manage(data.cantidad);
					}, "json");
				}); 
				return false;		
			}
			
			function CargaHome(){
				$(".main").load("home.php",{},function(){
					$(".banda").click(function(){
						$(".menureleases").hide();
						$("#homeb").css('background-position','-41px 63px');
						$("#management").css('background-position','-285px 103px');
						
						var id = $(this).attr("tabindex");
						$(".main").load("management_artist.php?id=" + id,{},function(){
							$('#s2').cycle({ 
								fx:     'scrollLeft', 
								timeout: 0, 
								next:   '#next2', 
								prev:   '#prev2' 
							});
							$("#artist_combo").change(function(){
								var id = $(this).val(); 	
								trece(id);
							});
						});
					});
				});return false;
			}

			function CargaStore(){
				$(".main").load("store.php",{},function(){
					$("#items").load("store_menu.php",{},function(){
						Delete();											  
					});
					Store();
					Carrito();
					Vaciar();
					OlvidoPass();
					checkout();
					$("#logout").click(function(){
						$.post("access.php",{logout:1},
						function(data){
							doce();
						});
					});
					
					$(".link_login").click(function(){
						$(".main").load("store_login.php",{},function(){
							Registro();
							OlvidoPass();
						});
					});
				}); return false;
			}
			function CargaEvents(id){
			
				if(id==undefined)	{
					$(".main").load("events_event.php",{},function(data){
						slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",9);
					});
				}
				else
				{
					$(".main").load("events_event.php?id="+ id +"",{},function(data){
						slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",9);
					});
				}
				return false;
			}
			function CargaRumble(id){
				
				if(id==undefined)	{
					$(".main").load("events_rumbles.php",{},function(data){
						slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",9);
					});
				}
				else
				{
					$(".main").load("events_rumbles.php?id="+ id +"",{},function(data){
						slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",9);
					});
				}
				return false;
			}
			function  CargaTour(id){
				if(id==undefined){
					$(".main").load("events_tour.php",{},function(data){
						slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",9);
					});
				}
				else
				{
					$(".main").load("events_tour.php?id="+ id +"",{},function(data){
						slide("<? echo DIRECTORIO_EVENTOS_388x600 ?>",9);
					});
				}
				return false;
			}

			function trece(id) {
				$(".cont_management").load("management_artist.php?id=" + id,{},function(){
					$('#s2').cycle({ 
						fx:     'scrollLeft', 
						timeout: 0, 
						next:   '#next2', 
						prev:   '#prev2' 
					});
					$("#artist_combo").change(function(){
						var id=$(this).val();
						trece(id);
					});
					
					$("#management").click(function(){
						CargaManagement();
					});
					
				});
			}
			function doce(cat) {
				$(".main").load("store.php",{},function(){
					$("#items").load("store_menu.php",{},function(){
						Delete();											  
					});
					Store(cat);
					Carrito();
					Vaciar();
					OlvidoPass();
					checkout();
					$("#logout").click(function(){
						$.post("access.php",{logout:1},
						function(data){
							doce();
						});
					});
					$(".link_login").click(function(){
						$(".main").load("store_login.php",{},function(){
							Registro();
							OlvidoPass();
						});
					});
				}); 
			}
			
			/* function CargaRadio(){
				$(".main").load("radio.php");
				return false;
			} */

			function CargaContacto(){
				$(".main").load("contact.php",{},function(){
					Contact();
				});
				return false;
			}
			
			function CargaNews() {
				$(".main").load("news.php",{},function(){
					$.post("getnews.php", {c:1},
					function(data){
						 News((data.cantidad-2));
					}, "json");
				});
				return false;
			}
			
			function CargaAlbum() {
				$(this).css('background-position','-9px -38px');
				$("#comps").css('background-position','-66px -6px');
				$("#single").css('background-position','-118px -6px');
				
				$(".main").load("comps.php",{},function(data){
					$.post("getrelease.php", {t:1,cat:"Album"},
					function(data){
					 Comps(data.CANT,data.path,"Album");
					}, "json");
				}); 
				return false;
			}
			function CargaComp() {
				$("#album").css('background-position','-9px -6px');
				$(this).css('background-position','-66px -38px');
				$("#single").css('background-position','-118px -6px');
				
				$(".main").load("comps.php",{},function(data){
					$.post("getrelease.php", {t:1,cat:"Comp"},
					function(data){
					 Comps(data.CANT,data.path,"Comp");
					}, "json");
				}); 
				return false;
			}
			function CargaSingle() {
				$("#album").css('background-position','-9px -6px');
				$("#comps").css('background-position','-66px -6px');
				$(this).css('background-position','-118px -38px');
				
				$(".main").load("comps.php",{},function(data){
					$.post("getrelease.php", {t:1,cat:"Single"},
					function(data){
					 Comps(data.CANT,data.path,"Single");
					}, "json");
				}); 
				return false;
			}
			
			/* no habilitar */
			/* function CargaEventHighLight(){
				$(".main").load("events.php");
				return false;
			}  */



