function mostrarOpciones(){
	if (document.getElementById('menuOpciones').style.display == "none"){
		document.getElementById('menuOpciones').style.display = "block";
	} else {
		document.getElementById('menuOpciones').style.display = "none";
	}
}

function mostrar(capa){
	if (document.getElementById(capa).style.display == "none"){
		document.getElementById(capa).style.display = "block";
	} else {
		document.getElementById(capa).style.display = "none";
	}
	if (capa == 'enlaces_patrocinados'){
		var capa2= 'mas_menos_patroc';
		var etiqueta= 'Enlaces Patrocinados';
	} else {
		var capa2= 'mas_menos_videos';
		var etiqueta= 'Vídeos Relacionados';
	}
	if (capa2){
		if ($(capa2).innerHTML.substr(0,1) == '+') {
			$(capa2).innerHTML = '- ' + etiqueta;
		} else {
			$(capa2).innerHTML = '+ ' + etiqueta;
		}
	}
}

function limpiar(element){
	var id= element.id;
	switch (id){
		case 'nv' : var valor = 'Nombre Vía';
								break;
		case 'nuv': var valor = 'Nº';
								break;
		case 'cp' : var valor = 'C.P.';
								break;
		case 'lop': var valor = 'Localidad';
								break;
		default: break;
	}
	if (element.value == valor){
		element.value='';
	}
}

function reponer(element){
	if (element.value == ''){
		var id= element.id;
		switch (id){
			case 'nv' : element.value = 'Nombre Vía';
									break;
			case 'nuv' : element.value = 'Nº';
									break;
			case 'cp' : element.value = 'C.P.';
									break;
			case 'lop' : element.value = 'Localidad';
									break;
			default: break;
		}
	}
}

function enviarForm(){
	if (document.search.q){
		if (document.search.q.value){
			if (document.search.nv){
				if (document.search.nv.value == 'Nombre Vía'){
					document.search.nv.value = '';
				}
			}
			if (document.search.nuv){
				if (document.search.nuv.value == 'Nº'){
					document.search.nuv.value = '';
				}
			}
			if (document.search.cp){
				if (document.search.cp.value == 'C.P.'){
					document.search.cp.value = '';
				}
			}
			if (document.search.lop){
				if (document.search.lop.value == 'Localidad'){
					document.search.lop.value = '';
				}
			}
			document.getElementById('search').submit();
		}
	}
}

function google_ss(w,id)
{
	window.status = w;
	return true;	
}

function google_cs()
{
	window.status = '';	
}
