// Popups

function popUp(URL, ancho, alto, scroll) {
day = new Date();
id = day.getTime();

if (scroll=="no"){
eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=0,toolbar=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ ancho +",height="+ alto +",left = 315,top = 265');");

}else {

eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=1,toolbar=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ ancho +",height="+ alto +",left = 315,top = 265');");
}
}

/// Spoilers
/// Script creado por Juan Miguel Garcia
/// De uso exclusivo en MagicEvolution.com
/// y MagicMadrid.es

function aspoiler(capa){
	//capa.style.display = 'block';
	mostrar=capa;
	document.getElementById(mostrar).className="spoilera";
}


function cspoiler(capa){
	//capa.style.display = 'none';
	ocultar=capa;
	document.getElementById(ocultar).className="spoiler";
}

/// Mostrador de cartas

this.imagePreview = function(){	
	xOffset = 10;
	yOffset = 30;

	$("a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		$("body").append("<p id='preview'><img src='http://gatherer.wizards.com/Handlers/Image.ashx?name="+ this.t +"&amp;type=card' alt='"+this.t+"' /></p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    	}, function(){
			this.title = this.t;	
			$("#preview").remove();
	});	
	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function(){
	imagePreview();
});
/// Fin del Mostrador de cartas
