// JavaScript Document

  window.onload = function() {

    settings = {

      tl: { radius: 0 },

      tr: { radius: 0 },

      bl: { radius: 7 },

      br: { radius: 7 },

      antiAlias: true,

      autoPad: false

    }

    var divObj = document.getElementById("header");

    var cornersObj = new curvyCorners(settings, divObj);

    cornersObj.applyCornersToAll();    

  }

	

	function opacity(id, opacStart, opacEnd, millisec) {

	  //speed for each frame

		var speed = Math.round(millisec / 100);

		var timer = 0;

		//determine the direction for the blending, if start and end are the same nothing happens

		if(opacStart > opacEnd) {

		  for(i = opacStart; i >= opacEnd; i--) {

			  setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));

				timer++;

			}

		}

		else if (opacStart < opacEnd) {

		  for (i=opacStart; i <= opacEnd; i++) {

				setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));

				timer++;

			}

		}

	}

	//change the opacity for different browsers

	function changeOpac(opacity, id) {

		var object = document.getElementById(id).style;

		object.opacity = (opacity / 100);

		object.MozOpacity = (opacity / 100);

		object.KhtmlOpacity = (opacity / 100);

		object.filter = "alpha(opacity=" + opacity + ")";

	}

	function text(texto) {

		var elemento;

		for (i=0;i<row.length;i++) {

			if (row[i] != "inicio") {

		    elemento = document.getElementById(row[i]);

		    elemento.src = "images/"+row[i]+".jpg";

			}

		}

		

		if (texto != "inicio") {

			elemento = document.getElementById(texto);

			elemento.src = "images/" + texto + "_over.jpg";

		}

		

		var textear = document.getElementById('texto-entrada');

		changeOpac(0,"texto-entrada");

		//textear.style.padding = "95px 35px 0 25px";

		//setTimeout("padinear('texto-entrada')",50);

		textear.style.padding = "55px 25px 0 25px";			

		textear.innerHTML = document.getElementById("texto"+texto).innerHTML;

		//alert(textear.style.padding);

		opacity('texto-entrada', 0, 100, 1400)

	}
	
	function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open('" + URL + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=460,left = 340,top = 230');");
}
