/*------------------INICIO DEL CÓDIGO PARA CAMBIAR IMAGENES POR EVENTO --------------*/

var Img0 = new Image();
var Img1 = new Image();
var Img2 = new Image();
var Img3 = new Image();
var Img4 = new Image();
var Img5 = new Image();
var Img6 = new Image();
var Img7 = new Image();
var Img8 = new Image();
var Img9 = new Image();
var Img10 = new Image();
var Img11 = new Image();

Img0.src = "Files/pg1_button_nav_right.gif";
Img1.src = "Files/pg1_button_nav_right_over.gif";
Img2.src = "Files/pg1_button_nav_left.gif";
Img3.src = "Files/pg1_button_nav_left_over.gif";
Img4.src = "Files/pg1_button_nav_up.gif";
Img5.src = "Files/pg1_button_nav_up_over.gif";
Img6.src = "Files/pg1_button_nav_down.gif";
Img7.src = "Files/pg1_button_nav_down_over.gif";
Img8.src = "Files/pg1_ca0001.jpg";
Img9.src = "Files/pg1_ca0003.jpg";
Img10.src = "Files/pg1_ca0002.jpg";
Img11.src = "Files/pg1_ca0004.jpg";

function ChangeImg_navRight(sImg) 
{
	// if (document.readyState != "complete") return;
	window.event.cancelBubble = true;
	nav_right.style.display = "";
	bFirstMouse = "False";
	nav_right.src = sImg;
}

function ChangeImg_navLeft(sImg) 
{
	// if (document.readyState != "complete") return;
	window.event.cancelBubble = true;
	nav_left.style.display = "";
	bFirstMouse = "False";
	nav_left.src = sImg;
}

function ChangeImg_1(sImg) 
{
	// if (document.readyState != "complete") return;
	window.event.cancelBubble = true;
	imagen_1.style.display = "";
	bFirstMouse = "False";
	imagen_1.src = sImg;
}

function ChangeImg_2(sImg) 
{
	// if (document.readyState != "complete") return;
	window.event.cancelBubble = true;
	imagen_2.style.display = "";
	bFirstMouse = "False";
	imagen_2.src = sImg;
}

var estado=false; 
var sones = "<embed id=sonido src='Files/dee.wav' autostart=true>"; 
function cambiar()    { 
    estado = !estado; 
    document.getElementById("fantasma").innerHTML = (estado) ? sones : ""; 
} 

/*------------------FIN DEL CÓDIGO PARA CAMBIAR IMAGENES POR EVENTO -----------------*/

/*------------------INICIO DEL CÓDIGO PARA TEXTO EN LA BARRA DE ESTADO --------------*/

function scrollit_r2l(seed)
{
	var msg="FABRICAMOS RESORTES DE TENSION, COMPRESION, TORSION Y FORMAS DE ALAMBRE."
	var out = " ";
	var c   = 1;
	if (seed > 100) 
	{
		seed--;
		var cmd="scrollit_r2l(" + seed + ")";
		timerTwo=window.setTimeout(cmd,100);
	}
	else if (seed <= 100 && seed > 0) 
	{
		for (c=0 ; c < seed ; c++) 
		{
			out+=" ";
		}
		out+=msg;
		seed--;
		var cmd="scrollit_r2l(" + seed + ")";
	    window.status=out;
		timerTwo=window.setTimeout(cmd,100);
	}
	else if (seed <= 0) 
	{
		if (-seed < msg.length) 
		{
			out+=msg.substring(-seed,msg.length);
			seed--;
			var cmd="scrollit_r2l(" + seed + ")";
			window.status=out;
			timerTwo=window.setTimeout(cmd,100);
		}
		else
		{
			window.status=" ";
			timerTwo=window.setTimeout("scrollit_r2l(100)",75);
		}
	}
}

/*------------------FIN DEL CÓDIGO PARA TEXTO EN LA BARRA DE ESTADO -----------------*/

/*------------------INICIO DEL CÓDIGO PARA FUNCIONES INICIALES ----------------------*/

function VentanaEmergente(myurl) {
        var myWidth=1000;
        var myHeight=700;
        var myLeft=0;
        var myTop=0;
        var mywhoIsWindow;
        myLeft=(window.outerWidth / 2) + window.screenX - (myWidth / 2); 
        myTop=(window.outerHeight / 2) + window.screenY - (myHeight / 2);
        mywhoIsWindow=window.open(myurl, 'Emergente', 'width='+myWidth+',height='+myHeight+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=1,left='+myLeft+',top='+myTop+'');
        return true;
    }

/*------------------FIN DEL CÓDIGO PARA TEXTO EN LA BARRA DE ESTADO -----------------*/

/*------------------------- INICIO DEL CÓDIGO CREACION DE COOKIES -------------------*/

   var caution = false

   // name - name of the cookie
   // value - value of the cookie
   // [expires] - expiration date of the cookie
   // (defaults to end of current session)
   // [path] - path for which the cookie is valid
   // (defaults to path of calling document)
   // [domain] - domain for which the cookie is valid
   // (defaults to domain of calling document)
   // [secure] - Boolean value indicating if
   // the cookie transmission requires a secure transmission
   // * an argument defaults when it is assigned null as a placeholder
   // * a null placeholder is not required for trailing omitted arguments
   function setCookie(name, value, expires, path, domain, secure) {
      var curCookie = name + "=" + escape(value) +
         ((expires) ? "; expires=" + expires.toGMTString() : "") +
         ((path) ? "; path=" + path : "") +
         ((domain) ? "; domain=" + domain : "") +
         ((secure) ? "; secure" : "")
      if (!caution || (name + "=" + escape(value)).length <= 4000)
         document.cookie = curCookie
      else
         if (confirm("Cookie exceeds 4KB and will be cut!"))
            document.cookie = curCookie
   }

   // name - name of the cookie
   // * return string containing value
   // of specified cookie or null if cookie
   // does not exist
   function getCookie(name) {
      var prefix = name + "="
      var cookieStartIndex = document.cookie.indexOf(prefix)
      if (cookieStartIndex == -1)
         return null
      var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex +
         prefix.length)
      if (cookieEndIndex == -1)
         cookieEndIndex = document.cookie.length
      return unescape(document.cookie.substring(cookieStartIndex +
         prefix.length,
   cookieEndIndex))
   }

   // name - name of the cookie
   // [path] - path of the cookie
   // (must be same as path used to create cookie)
   // [domain] - domain of the cookie
   // (must be same as domain used to create cookie)
   // * path and domain default if assigned
   // null or omitted if no explicit argument proceeds
   function deleteCookie(name, path, domain) {
      if (getCookie(name)) {
         document.cookie = name + "=" +
         ((path) ? "; path=" + path : "") +
         ((domain) ? "; domain=" + domain : "") +
         "; expires=Thu, 01-Jan-70 00:00:01 GMT"
      }
   }

   // date - any instance of the Date object
   // * you should hand all instances of the
   // Date object to this function for "repairs"
   // * this function is taken from
   // Chapter 14, "Time and Date in JavaScript", in
   // "Learn Advanced JavaScript Programming"
   function fixDate(date) {
      var base = new Date(0)
      var skew = base.getTime()
      if (skew > 0)
         date.setTime(date.getTime() - skew)
   }

/*-------------------------- FIN DEL CÓDIGO CREACION DE COOKIES ---------------------*/

/*---------- FIN DEL CÓDIGO CREACION DE COOKIE PARA CONTADOR DE VISITAS -------------*/

/*------------------INICIO DEL CÓDIGO PARA FUNCIONES INICIALES ----------------------*/

function iniciales()
{
	// document.oncontextmenu = new Function('return false');
	// document.onmousedown = new Function('if(event.button & 2) alert("Resortes Detroit a deshabilitado esta función")')
	timerONE=window.setTimeout('scrollit_r2l(100)',500);
}

/*------------------FIN DEL CÓDIGO PARA FUNCIONES INICIALES -------------------------*/

