//MULTIACEROS
// JavaScript Document


titulobarra = "COMPAÑIA MULTIACEROS S.A";
cad_statusbar = "COMPAÑIA MULTIACEROS S.A";
cad_rightclick = "COMPAÑIA MULTIACEROS S.A";

//document.title = titulobarra; 

//scrolltitle();
//statuss();
//disableRightClick();

//******DESPLAZA TEXTO DE BARRA DE TITULO DEL NAVEGADOR
scrl = titulobarra;
function scrolltitle() {
  scrl = scrl.substring(1, scrl.length) + scrl.substring(0, 1);
 document.title = scrl;
 setTimeout("scrolltitle()", 300);

 }

//***********************************/


//***********TEXTO DE LA BARRA DE ESTADO
function statuss()
	{
	 window.status = cad_statusbar;
	 setTimeout("statuss()", 1);
	 
	}

//*********************************************/

//****************DESHABILITA CLICK DERECHO DLE RATON
function disableRightClick(e)
{
  var message = cad_rightclick;
  
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}

//****************************************************/


// FLASHFIX **************************************************
// JavaScript Document
// script para quitar el marco de "haga click aqui para activar y usar este control" generado por IE al insertar objetos flash
// se puede cambiar la etiqueta usando div en vez de span o viceversa

var bo_ns_id = 0;
function startIeFix() {
  if (isIE()) {
    document.write('<span id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}
function endIeFix() {
  if (isIE()) {
    document.write('</span>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"));
    document.write(theCode);
  }
}
function isIE() {
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if (strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0) {
    if (parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6) {
      return false;
    }
    if (strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  } else {
    return false;
  }
}

//*********************************************************************/

//************************ recargar la página y borra variables GET, despues de un tiempo determinado
function recargar(tiempo)
{
	if (!tiempo)
		tiempo = 1;

	ruta = String(window.location);
	fin = ruta.indexOf("?");
	if (fin == -1)
		fin = ruta.length ;
	
	ruta = ruta.substring(0,fin);


	setTimeout("window.location ='"+ruta+"' ;",tiempo) ;
}
//********************************/


//*********************  redireccionar la página despues de un tiempo determinado
function redireccionar(ruta,tiempo)
{
	if (!tiempo)
		tiempo = 1;

	setTimeout("window.location ='"+ruta+"' ;",tiempo) ;
}

//*****************************/


//*******************	CAMBIAR EL COLOR DE UNA FILA
function cambiacolor(fila)
{
document.all[fila].bgColor ="#EAF5FA";
}
function quitacolor(fila)
{
document.all[fila].bgColor ="";
}

//*******************	CAMBIAR EL COLOR DE UN CAMPO DE FORMULARIO
function cambiacolor_campo(campo)
{
document.getElementById(campo).style.background ="#FF0000";
}
function quitacolor_campo(campo)
{
document.getElementById(campo).style.backgroundColor ="";
document.getElementById(campo).style.border = "solid" ;
document.getElementById(campo).style.borderWidth = "1" ;
document.getElementById(campo).style.borderColor = "silver";

}

//**********************************/

//********** OBJETO AJAX COMPATIBLE CON FIRENTES NAVEGADORES
function nuevoAjax() {
	var objetoAjax=false;
    try {
	    /*Para navegadores distintos a internet explorer*/
   	 	objetoAjax = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e1) {
    	try {
        	/*Para explorer*/
        	objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
    	}
    	catch (e2) {
        	objetoAjax = false;
    	}
    }
	if (!objetoAjax && typeof XMLHttpRequest != 'undefined') {
    	objetoAjax = new XMLHttpRequest();
    }
    return objetoAjax;
}

//****************************************************

