$(document).ready(function() {
	loading();
	cargarTemplate('general');
});

var prev_opt = 'general';
function cargarTemplate(opc) {
	$("#DatosClub").slideUp('fast');
	$.ajax({
		type: "GET",
		url: "ajax_club_ficha.php",
		data: "d="+opc+"&id="+$("#id").val(),
		success: function(data){
			$("#opt_"+prev_opt).removeClass("selected");
			$("#opt_"+opc).addClass("selected");
			prev_opt = opc;
			$("#DatosClub").html(data); //carga la opcion de la ficha seleccionada
			$("#DatosClub").slideDown('normal');
		}
	});
}

function openImage(img){
	image= new Image();
	image.src=(img);
	openWindow(img);
}

function openWindow(img){
	if((image.width!=0)&&(image.height!=0)){
	viewImage(img);
	}
	else{
	stuff="openWindow('"+img+"')";
	stuff1=setTimeout(stuff,20);
	}
}
function viewImage(img){
	w=image.width+0;
	h=image.height+0;
	dims="width="+w+",height="+h;
	result=window.open(img,"",dims);
}


