function google(){
	window.open('http://www.google.es/search?hl=es&q='+document.location+'&btnG=Buscar+con+Google&meta=','','');
}

function meneame(){
 window.open('http://meneame.net/submit.php?url='+document.location,'','');
}

function yahoo(){
 window.open('http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+document.location+'&t='+escape(document.title),'','');
}

function technorati(){
 window.open('http://www.technorati.com/search/'+document.location+'?sub=postcosm','','');
}

function fresqui(){
 window.open('http://tec.fresqui.com/post','','');
}

function delicious(){
 window.open('http://del.icio.us/post?title='+escape(document.title)+'&url='+document.location,'','');
}

function correo(){
	location.href='mailto:?SUBJECT=Visita la web de Mundo Recambio y Taller &BODY=' + escape(location.href)
}

function facebook(){
	 window.open('http://www.facebook.com/share.php?u='+document.location,'','');
}

function wikio(){
	 window.open(' http://www.wikio.es/vote?url='+document.location,'','');
}

function seleccionarLetra(id) {
	document.getElementById('BuscadorLetra').value = id;
	document.frmBuscador.submit();
}


/*  form registro prensa */
/*
function checksRegistro(id) {
	if(id =='PrensaEm') {
		if(document.getElementById('PrensaEm').checked == true) { 
			document.getElementById('labelEmpresa').style.visibility = 'visible';
			document.getElementById('PrensaEmpresa').style.visibility = 'visible';
		} else {
			document.getElementById('labelEmpresa').style.visibility = 'hidden';
			document.getElementById('PrensaEmpresa').style.visibility = 'hidden';
		}
		document.getElementById('PrensaFr').checked = false;
	}
	
	if(id =='PrensaFr') {
		document.getElementById('labelEmpresa').style.visibility = 'hidden';
		document.getElementById('PrensaEmpresa').style.visibility = 'hidden';
		document.getElementById('PrensaEm').checked = false;
	}
}


function MyTrim(camp) {
	var valor = camp;
	while (''+valor.charAt(0)==' ') valor=valor.substring(1,valor.length);
	while (''+valor.charAt(valor.length)==' ') valor=valor.substring(0,valor.length-1);
	return valor;
}

function validarRegistro() {
	var msgError='';
	var error=0;

	if (MyTrim(document.getElementById('PrensaContacto').value) == '') {
		msgError += "No has introducido una persona de contacto. \n\r";
		error = 1;
	}
	
	if (MyTrim(document.getElementById('PrensaTlf1').value) == '') {
		msgError += "No has introducido un teléfono. \n\r";
		error = 1;
	}
	
	if (MyTrim(document.getElementById('PrensaMail').value) == '') {
		msgError += "No has introducido un e-mail. \n\r";
		error = 1;
	}else{
		var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
		if (!filter.test(document.getElementById('PrensaMail').value)){
			msgError += "El e-mail es incorrecto. \n\r";
			error = 1;
		}
	}
	
	if (error) alert(msgError);
	return error;
}
*/
/* final form registro prensa */

/* form recordar prensa */
/*
function validarRecordar() {
	var msgError='';
	var error=0;
	
	if (MyTrim(document.getElementById('PrensaMail').value) == '') {
		msgError += "No has introducido un e-mail. \n\r";
		error = 1;
	}else{
		var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
		if (!filter.test(document.getElementById('PrensaMail').value)){
			msgError += "El e-mail es incorrecto. \n\r";
			error = 1;
		}
	}
	
	if (error) alert(msgError);
	return error;
}
*/
/* final form recordar prensa */


function MyTrim(camp) {
	var valor = camp;
	while (''+valor.charAt(0)==' ') valor=valor.substring(1,valor.length);
	while (''+valor.charAt(valor.length)==' ') valor=valor.substring(0,valor.length-1);
	return valor;
}

function validarNews() {
	var msgError='';
	var error=0;

	if (MyTrim(document.getElementById('altanewsletter').value) == '') {
		msgError += "No has introducido tu e-mail. \n\r";
		error = 1;
	}else{
		var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
		if (!filter.test(document.getElementById('altanewsletter').value)){
			msgError += "Tu e-mail es incorrecto. \n\r";
			error = 1;
		}
	}
	if (error) alert(msgError);
	return error;
}

function abrir(url,height,width) {
	var navegador = navigator.appName ;
	if (navegador == "Microsoft Internet Explorer")  height = height+46; width = width+1;
	window.open(url,'','scrollbars=1,resizable=0,top=100,left=100,width='+width+',height='+height) ;
}

function validarCompra() {
	var msgError='';
	var valido=true;
	
	if (document.getElementById('ComprarNombre').value == '') {
		msgError += "No has introducido tu nombre. \n\r";
		valido = false;
	}	
	if (document.getElementById('ComprarApellidos').value == '') {
		msgError += "No has introducido tus apellidos. \n\r";
		valido = false;
	}
	if (document.getElementById('ComprarDireccion').value == '') {
		msgError += "No has introducido tu dirección. \n\r";
		valido = false;
	}
	if (document.getElementById('ComprarCodigopostal').value == '') {
		msgError += "No has introducido un código postal. \n\r";
		valido = false;
	}
	if (document.getElementById('ComprarEmail').value == '') {
		msgError += "No has introducido tu e-mail. \n\r";
		valido = false;
	}else{
		var filter=/^[A-Za-z][A-Za-z0-9_.]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;
		if (!filter.test(document.getElementById('ComprarEmail').value)){
			msgError += "El e-mail es incorrecto. \n\r";
			valido = false;
		}
	}
	if (document.getElementById('ComprarTelefono').value == '') {
		msgError += "No has introducido tu teléfono. \n\r";
		valido = false;
	}
	if (document.getElementById('ComprarCondiciones').checked == false) {
		msgError += "Tienes que aceptar las condiciones de privacidad. \n\r";
		valido = false;
	}
	
	if (!valido) alert(msgError);
	return valido;
}

function validaNumero(obj,defecte,on){
	if(on == 'onkeyup'){
		if(isNaN(obj.value)){
			obj.value = defecte;
			obj.selectionStart = 0;
		}
	}
	if(on == 'onchange'){
		if(isNaN(obj.value) || obj.value == ''){
			obj.value = defecte;
		}
	}
}

function activarEntero() {
	if(document.getElementById('entero').style.display == 'none') {
		document.getElementById('entero').style.display = 'block';
		document.getElementById('cortado').style.display = 'none';
		document.getElementById('seguirLeyendo').style.display = 'none';
		document.getElementById('cerrar').style.display = 'block';
	} else {
		document.getElementById('entero').style.display = 'none';
		document.getElementById('cortado').style.display = 'block';
		document.getElementById('seguirLeyendo').style.display = 'block';
		document.getElementById('cerrar').style.display = 'none';
	}
}