$(document).ready(function(){

	// links legal
	$('#avisolegal').click(function(e){
		var url = $(this).attr('href');
		var w = 600;
		var h = 700;
		var x = screen.width/2 - w/2;
		var y = screen.height/2 - h/2;
		wfeatures = 'width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=yes,resizable=no';
		window.open(url,'Aviso_legal',wfeatures);
		e.stopPropagation();
		return false;
	});
	$('#avisolegal2').click(function(e){
		var url = $(this).attr('href');
		var w = 600;
		var h = 700;
		var x = screen.width/2 - w/2;
		var y = screen.height/2 - h/2;
		wfeatures = 'width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=yes,resizable=no';
		window.open(url,'Aviso_legal',wfeatures);
		e.stopPropagation();
		return false;
	});
	$('#avisolegal3').click(function(e){
		var url = $(this).attr('href');
		var w = 600;
		var h = 700;
		var x = screen.width/2 - w/2;
		var y = screen.height/2 - h/2;
		wfeatures = 'width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=yes,resizable=no';
		window.open(url,'Aviso_legal',wfeatures);
		e.stopPropagation();
		return false;
	});
	$('#avisolegal4').click(function(e){
		var url = $(this).attr('href');
		var w = 600;
		var h = 700;
		var x = screen.width/2 - w/2;
		var y = screen.height/2 - h/2;
		wfeatures = 'width='+w+',height='+h+',left='+x+',top='+y+',scrollbars=yes,resizable=no';
		window.open(url,'Aviso_legal',wfeatures);
		e.stopPropagation();
		return false;
	});

});

/**
 * Abre una ventana con la url dada
 */
function abrirPopup(url, w, h, sbars) {
	
	var migX = w/2;
	var migY = h/2;

	var x = screen.width/2 - migX;
	var y = screen.height/2 - migY;

	valors = 'width='+w+',height='+h+',left='+x+',top='+y+',scrollbars='+sbars+',resizable=no';

	window.open(url,'',valors);

} // abrirPopup
