//////codigo para flash

//alert (navigator.appName);
//alert (document.getElementById);
var movieName = "earth";

function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  }	else {
    return document[movieName]
  }
}

// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
  if (typeof(theMovie) != "undefined") {
    return theMovie.PercentLoaded() == 100;
  } else {
    return false;
  }
}


function forwardmovie(recibe) {
	
	if (movieIsLoaded(thisMovie(movieName))) {
		
		if (recibe==1)	{
			var recibe=("Desde 1996 construyendo Internet.");
		}
		if (recibe==2)	{
			var recibe=("Ofrecemos mucho más que diseño. Examine nuestra oferta en la sección de servicios.");
		}
		if (recibe==3)	{
			var recibe=("Lo mejor de esta empresa. Gracias a ellos seguimos en el negocio.");
		}
		if (recibe==4)	{
			var recibe=("Cuando nos acordamos escribimos aquí las últimas novedades.");
		}
		if (recibe==5)	{
			var recibe=("Expliquenos su problema... y le hablaremos de soluciones.");
		}
		
		thisMovie(movieName).GotoFrame(49);
		thisMovie(movieName).SetVariable("/:txt", recibe);
		//alert(recibe);
  	}
}

function backwardmovie() {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).GotoFrame(40);
  }
}


/*cambio fondo de imagen SQUARES*/
function swapSquares (squareSwap) {
	//alert("url(../images/" + squareSwap + ")");
	imageToSwap = "url(images/" + squareSwap + ")";
	imageSquare = document.getElementById("squares");
	imageSquare.style.backgroundImage = imageToSwap;
	}
	
function restoreSquares () {
	imageSquare = document.getElementById("squares");
	imageSquare.style.backgroundImage = "url(images/squares.gif)";
	}


//Minimo Ancho para explorer
//obtengo el Ancho de la ventana y ajusto el "cuerpo"

var resizing = "";

getWindowSize = function() {

	//Efecto min-width y max-width para EXPLORER
	if (navigator.appName.indexOf("Explorer") > 0) {//es EXPLORER
	
		minWidth = 870;
		
		windowWidth = document.body.clientWidth;
		
		//Elementos a reajustar
		itemReshape = document.getElementById("principal");
		
		currentWidth = "";
		
		//alert (windowWidth + "||" + minWidth);
				
		//Acomodo Columnas y Cuerpo
		//Es MENOR
		if (windowWidth <= minWidth) { 
			itemReshape.style.width = minWidth + "px";
		}
	
		//Es mayor		
		else {
			itemReshape.style.width = "100%";
		}
		
		
		//compruevo los valores
		/*
		var outPutVars = ""
		+ '<strong>windowWidth=' + windowWidth 
		+ '<strong>'
		+ '<br />';
   	
		
		document.getElementById("header").innerHTML = outPutVars;
		applyVars = document.getElementById("header");
		applyVars.style.fontSize = "11px";
		applyVars.style.lineHeight = "12px";
		*/
		
	}
	
}

resizeElement = function() {
	
	//defino el Alto minimo
	maxHeight = 150;
	
	//Efecto min-height
	if (navigator.appName.indexOf("Explorer") > 0) {//es EXPLORER
		//Elementos a reajustar
		documentDivs = document.getElementsByTagName ("div");
		//alert("documentDivs.length =" + documentDivs.length);
		for (i=0; i<documentDivs.length; i++) {
			if (documentDivs[i].className == "modCol") {
				//alert("documentDivs[i].className =" + documentDivs[i].className);
				if (documentDivs[i].offsetHeight < maxHeight) {
					documentDivs[i].style.height = maxHeight + "px"; 
				}
			}
			if (documentDivs[i].className == "modColBttm") {
				documentDivs[i].style.bottom = 0 + "px"; 
			}
		}
	}
}

setUpPage = function() {
	//alert ("settingUp!!");
	getWindowSize();
	resizeElement();
} 

window.onresize = getWindowSize;
window.onload = setUpPage;