function fnNuevaVentana(url, win, cnf) {
	var win = null;
	cnf['left'] = 0;
	cnf['top'] = 0;
	if (cnf['width'] > screen.width) cnf['width'] = screen.width - 20;
	if (cnf['height'] > screen.height) cnf['height'] = screen.height - 20;		
	var winl = (screen.width - cnf['width']) / 2;
	var wint = (screen.height - cnf['height']) / 2;
	if (winl > 0) cnf['left'] = winl;
	if (wint > 0) cnf['top'] = wint;	
	var settings = '';
	for(var key in cnf) { settings += ' ' + key + '=' + cnf[key] + ','; }
	win = window.open(url, win, settings);
	win.window.focus();
	return false;
}
$(document).ready(function() {
    $("#mostrar").click(function(event) { $("#caja").slideToggle(2000,"easeOutBounce"); });
	$('.easing').hover(
		function () { 
			$(this).animate({ paddingLeft: '5px' }, {duration: 150, easing: 'easeOutBounce'})
		},			
		function () {
			$(this).animate({ paddingLeft: '0px' }, {duration: 50, easing: 'easeOutBounce'})
		}
	);	
	$("#Contacto").validate({
		rules: {
			NombreApellidos: { required : true }, 
			Empresa: { required : true }, 
			Cargo: { required : true }, 
			Email: { required : true }, 
			Telefono: { required : true  }, 
			Legal: { required : true }, 
			/*Email: { required : true }, 
			Telefono: { required : true, number : true, minlength : 9, maxlength : 9  }, 
			Legal: { required : true }, */
		}
	});
	$("a.accesibilidad").click(function(){ return fnNuevaVentana(this.href, 'ac', {width:400,height:300}); });
	$("a.autorizacion").click(function(){ return fnNuevaVentana(this.href, 'au', {width:600,height:400}); });
});


