<!-- funcion jquery para el resalte de las zonas del mapa -->
$(function() {
   $('.map').maphilight();
});

<!-- funcion jquery para el carrusel de la tienda -->
$(function() {
    $(".carruselnovedades").jCarouselLite({
        easing: "backout",
		auto: 1000,
    	speed: 2000,
		visible:4	
		
    });
});

<!-- funcion jquery para el popup modal de las imagenes -->
$(function() {
	// Use this example, or...
	//$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	//$('#gallery a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	//$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above
});

<!-- funcion para mostrar o ocultar capas -->
var state = 'none';
function showhide(layer_ref) {
	if (state == 'block') {
		state = 'none';
 	} else {
		state = 'block';
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
	hza = document.getElementById(layer_ref);
	hza.style.display = state;
	}
}

/*
Strip whitespace from the beginning and end of a string
Input : a string
*/
function trim(str)
{
	return str.replace(/^\s+|\s+$/g,'');
}

/*
Make sure that textBox only contain number
*/
function checkNumber(textBox)
{
	while (textBox.value.length > 0 && isNaN(textBox.value)) {
		textBox.value = textBox.value.substring(0, textBox.value.length - 1)
	}
	
	textBox.value = trim(textBox.value);
/*	if (textBox.value.length == 0) {
		textBox.value = 0;		
	} else {
		textBox.value = parseInt(textBox.value);
	}*/
}

/*
	Check if a form element is empty.
	If it is display an alert box and focus
	on the element
*/
function isEmpty(formElement, message) {
	formElement.value = trim(formElement.value);
	
	_isEmpty = false;
	if (formElement.value == '') {
		_isEmpty = true;
		alert(message);
		formElement.focus();
	}
	
	return _isEmpty;
}

/*
	Set one value in combo box as the selected value
*/
function setSelect(listElement, listValue)
{
	for (i=0; i < listElement.options.length; i++) {
		if (listElement.options[i].value == listValue)	{
			listElement.selectedIndex = i;
		}
	}	
}

function clearMe(formfield){
	var datas =new Array(
						'Autor',
						'Titulo',
						'Descripcion corta',
						'Descripcion del Producto',
						'Titulo del anuncio',
						'Descripcion del anuncio',
						'Descripcion de la Categoria',
						'Contenido de la noticia',
						'Buscar',
						'Contenido',
						'Nombre',
						'Nombre del Producto',
						'Nombre de la Categoria',
						'Telefono',
						'Direccion E-mail',
						'Particular o Empresa',
						'Asunto',
						'Provincia',
						'Poblacion',
						'Localidad',
						'Anunciante',
						'Telefono',
						'Precio',
						'Cantidad',
						'Usuario',
						'Password',
						'0',
						'Ninguno',
						'Escriba aqui su consulta');
	
	// aqui lo que hago es unir todas las cadenas en una y le pido que me devuelva el valor en el que empieza. Si es 0 es que no existe, si es mayor que 0 (me devuelve el numero donde empieza, lo borro
	if (datas.join().indexOf(formfield.value)>=0) formfield.value='';
}

 
