var abierto = 0;
function cambiaFaq(id){
	if (abierto == id) {
		abierto = 0;
		$("#faq" + id).slideUp("slow");
	} else {
		if (abierto != 0) {
			$("#faq" + abierto).slideUp("slow");
			abierto = 0;
		}
		abierto = id;
		$("#faq" + id).slideDown("slow");
		
	}
}
$(document).ready(function(){

	$('a[href^=#]').not('a[href$=#]').bind('click',function(){
		var anch = $(this).attr('href').split('#');
		anch = anch[1];
		var node = $('a[name='+anch+']'); 
		if( node.length > 0 ){
			if($.browser.msie){
				node.css({zoom:'1'});
			}
			$('html').animate({
				scrollTop: node.offset()['top']
			}, 500 );
		} 
		return false;
	})

})

function validaEmail(email) {
    var respuesta = false;
    if (email.length > 0 && email.indexOf("@") > -1 && email.lastIndexOf(".") > -1 && (email.indexOf("@") < email.lastIndexOf("."))) {
        respuesta = true;
    } else {
        respuesta = false;
    }
    return respuesta;
}
function copyErrorFormulario(err) {
    //return "Se han detectado los siguientes errores en el formulario:<br><br>- " + err.join("<br />- ");
    return popup_detectado_errores + "<br><br>- " + err.join("<br />- ");
}
