	animaciones = new Array()

	cont = 0

	cont2 = 0

	navegador = navigator.appName

	cambiandoPagina = false

	Ventana = ''



	function ver(id)

	{

		document.getElementById('bloque1').style.display = 'none';

		document.getElementById('bloque2').style.display = 'none';

		document.getElementById(id).style.display = '';

	}



	function maximizar()

    {

		/*if (window.width != screen.width && window.height != screen.height)

		{

			window.moveTo(0,0);

			window.resizeTo(screen.width,screen.height);

		}*/

		expandir_fondo()

    }



	function expandir_fondo()

	{

		img = document.getElementById('imagen_fondo');

		if (navegador == 'Netscape')

		{

			img.width = window.innerWidth

			img.height = window.innerHeight

		}

		else

		{

			img.width = document.body.clientWidth

			img.height = document.body.clientHeight

		}

		//centrar_marco()

	}



	function centrar_marco()

	{

		div = document.getElementById('marco');

		t1 = (document.body.clientHeight / 2)

		//div.style.top = t1 - 278

		//div.style.top = 0

	}



	function posicionar_marco_inicial()

	{

		div = document.getElementById('bloque0');

		t1 = (document.body.clientHeight / 2)

		div.style.height = t1 - 270

	}



	window.onresize = expandir_fondo



	function rollover(div,src,tipo)

	{

		if (cambiandoPagina) return

		if (src == '1') SRC = B2

		else SRC = B1



		img = document.getElementById('b' + div)

		img.src = SRC

		x_array = new Array()

		x_array[0] = 'boton' + div

		x_array[1] = tipo

		animaciones[div] = x_array

		cont++

		if (cont == 1) animar()

	}



	function animar()

	{

		for (imagen in animaciones)

		{

			arr = animaciones[imagen]

			img = document.getElementById(arr[0])



			if (img.style.top == '') img.style.top = img.offsetTop + 'px'



			if (arr[1] == '+')

			{

				if (animaciones[imagen][0] != '')

				{

					img.style.top = parseInt(img.style.top) + 2

					if (parseInt(img.style.top) >= -6)

					{

						img.style.top = -6

						cont--

						delete(animaciones[imagen])

					}

				}

			}

			else

			{

				if (animaciones[imagen][0] != '')

				{

					img.style.top = parseInt(img.style.top) - 2

					if (parseInt(img.style.top) <= -17)

					{

						img.style.top = -17

						cont--

						delete(animaciones[imagen])

					}

				}

			}

		}



		if (cont > 0)

		{

			setTimeout("animar()",40);

		}

	}



	function menu_accion(pagina,idioma)

	{

		if (cambiandoPagina) return

		cambiandoPagina = true

		top.location.href = 'http://kitesurfingtarifa.com/web2.0/public/kite/index.php?pagina='+pagina+'&idioma='+idioma

	}



	function Transp(obj)

	{

		obj.style.opacity = .70

		obj.style.filter = "alpha(opacity=70)"

	}



	function Opaca(obj)

	{

		obj.style.opacity = 1

		obj.style.filter = "alpha(opacity=100)"

	}



	function CambiarIdioma(I,pagina)

	{

		if (cambiandoPagina) return

		menu_accion(pagina,I)

	}



	function CambiarImagen(ima,src)

	{

		ima.src = src

	}



	function FiltrarBusqueda(idioma)

	{

		d1 = document.BuscadorPrincipal.c0.value

		d2 = document.BuscadorPrincipal.c1.value

		d3 = document.BuscadorPrincipal.c2.value

		d4 = document.BuscadorPrincipal.c3.value

		d5 = document.BuscadorPrincipal.c4.value

		d6 = document.BuscadorPrincipal.c5.value

		

		top.location.href = 'http://kitesurfingtarifa.com/web2.0/public/kite/index.php?pagina=2&action=FiltrarBusqueda&idioma='+idioma+'&b1='+d1+'&b2='+d2+'&b3='+d3+'&b4='+d4+'&b5='+d5+'&b6='+d6

	}



	function BusquedaEspecifica(idioma)

	{

		d1 = document.BuscadorPrincipal.What.value



		if (d1 == '')

		{

			campo = document.getElementById('BuscadorTotal')

			campo.className = 'MarcarbotonBuscar1'

			alert(".................... ?")

			campo.focus()

			return

		}

		

		top.location.href = 'http://kitesurfingtarifa.com/web2.0/public/kite/index.php?pagina=2&action=BusquedaEspecifica&idioma='+idioma+'&b1='+d1

	}



	function FiltrarBusqueda2(idioma)

	{

		d1 = document.BuscadorPrincipal.c0.value

		d2 = document.BuscadorPrincipal.c1.value

		d3 = document.BuscadorPrincipal.c2.value

		d4 = document.BuscadorPrincipal.c3.value

		d5 = document.BuscadorPrincipal.c4.value

		d6 = document.BuscadorPrincipal.c5.value

		

		top.location.href = 'http://kitesurfingtarifa.com/web2.0/public/wind/index.php?pagina=2&action=FiltrarBusqueda&idioma='+idioma+'&b1='+d1+'&b2='+d2+'&b3='+d3+'&b4='+d4+'&b5='+d5+'&b6='+d6

	}



	function BusquedaEspecifica2(idioma)

	{

		d1 = document.BuscadorPrincipal.What.value



		if (d1 == '')

		{

			campo = document.getElementById('BuscadorTotal')

			campo.className = 'MarcarbotonBuscar1'

			alert(".................... ?")

			campo.focus()

			return

		}

		

		top.location.href = 'http://kitesurfingtarifa.com/web2.0/public/wind/index.php?pagina=2&action=BusquedaEspecifica&idioma='+idioma+'&b1='+d1

	}



	function CambiarClase(clase,obj)

	{

		obj.className = clase

	}



	function ExpandeContrae(ID1,ID2)

	{

		div = document.getElementById(ID1)

		img = document.getElementById(ID2)



		max = 540



		if (div.offsetHeight == max)

		{

			div.style.height = 0

			img.src = 'http://www.kitesurfingtarifa.com/imagenes/desplegable1.gif'

		}

		else

		{

			div.style.height = max

			img.src = 'http://www.kitesurfingtarifa.com/imagenes/desplegable2.gif'

		}

	}



	function PAUSE(n)

	{

		date = new Date();

		s = date.getMilliseconds() + n;

		t = 0



		do

		{

			date = new Date();

			t++

		}

		while(date.getMilliseconds()+t < s);

	}



	function IrA_Href(obj)

	{

		if (obj.value == '') return

		en = document.getElementById(obj.value)

		coor = findPos(en)

		div = document.getElementById("ArticulosNuevos")

		div.scrollTop = coor[1] - 120

		//alert (en.offsetTop)

		//location.href = '#' + obj.value

		//obj.selectedIndex = 0

	}



	function VerArticulo(ID,idioma,tabla)

	{

		location.href= "?pagina=2&idioma="+idioma+"&action=VerArticulo&id="+ID+"&tb="+tabla

	}



	function AmpliarImagen(IMG,X,Y)

	{

		if (Ventana != '') CerrarVentana()

		xp = screen.width

		yp = screen.height

		LEFT = (xp / 2) - (X / 2)

		TOP = (yp / 2) - (Y / 2)



		LINK = "inc/preview_imagen.php?imagen="+IMG+"&X="+X+"&Y="+Y

		

		if (navigator.appName == "Microsoft Internet Explorer")

		{

			X1 = 50; Y1 = 92

		}

		else

		{

			X1 = 28; Y1 = 70

		}



		if (X != 0 && Y != 0)

		{

			CARACTERISTICAS = "width="+(X+X1)+",height="+(Y+Y1)+",top="+TOP+",LEFT="+LEFT+',scrollbars=yes'

		}

		else

		{

			CARACTERISTICAS = ""

		}



		Ventana = window.open(LINK,"Imagen",CARACTERISTICAS)

	}

	

	function AmpliarImagenGaleria(DIR,IMG,X,Y)

	{

		if (Ventana != '') CerrarVentana()

		xp = screen.width

		yp = screen.height

		LEFT = (xp / 2) - (X / 2)

		TOP= (yp / 2) - (Y / 2)



		IMA = "http://kitesurfingtarifa.com/GaleriaFotos/" + DIR + "/" + IMG

		LINK = "inc/preview_imagen_Galeria.php?imagen="+IMA+"&X="+X+"&Y="+Y



		CARACTERISTICAS = "width="+(X+28)+",height="+(Y+70)+",top="+TOP+",LEFT="+LEFT+',scrollbars=yes'



		Ventana = window.open(LINK,"Imagen",CARACTERISTICAS)

	}



	function AmpliarImagenGaleria2(DIR,IMG,X,Y)

	{

		if (Ventana != '') CerrarVentana()

		xp = screen.width

		yp = screen.height

		LEFT = (xp / 2) - (X / 2)

		TOP= (yp / 2) - (Y / 2)



		IMA = "http://kitesurfingtarifa.com/GaleriaFotos2/" + DIR + "/" + IMG

		LINK = "inc/preview_imagen_Galeria.php?imagen="+IMA+"&X="+X+"&Y="+Y



		CARACTERISTICAS = "width="+(X+28)+",height="+(Y+70)+",top="+TOP+",LEFT="+LEFT+',scrollbars=yes'



		Ventana = window.open(LINK,"Imagen",CARACTERISTICAS)

	}



	function CerrarVentana()

	{

		Ventana.close()

	}



	function findPos(obj)

	{

		var curleft = curtop = 0;



		if (obj.offsetParent)

		{

			do

			{

				curleft += obj.offsetLeft;

				curtop += obj.offsetTop;

			}

			while (obj = obj.offsetParent);

		}

		return [curleft,curtop];

	}



	function ActivarTransparenciaEnExplorer()

	{

		img = document.getElementsByTagName('img')



		for (i=0;i<img.length;i++)

		{

			if (img[i].src.toLowerCase().lastIndexOf('.png') != -1)

			{

				img[i].style.filter = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader» (src='"+img[i].src+"',sizingMethod='scale')"

			}	

		}

	}



	function PNG_loader()

	{
	   for(var i=0; i<document.images.length; i++) {

		  var img = document.images[i];

		  var imgName = img.src.toUpperCase();

		  if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {

			 var imgID = (img.id) ? "id='" + img.id + "' " : "";

			 var imgClass = (img.className) ? "class='" + img.className + "' " : "";

			 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";

			 var imgStyle = "display:inline-block;" + img.style.cssText;

			 if (img.align == "left") imgStyle += "float:left;";

			 if (img.align == "right") imgStyle += "float:right;";

			 if (img.parentElement.href) imgStyle += "cursor:hand;";

			 var strNewHTML = "<span " + imgID + imgClass + imgTitle

				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"

				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"

				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";

			 img.outerHTML = strNewHTML;

			 i--;

		  }

	   }

	}