// JavaScript Document

function mostrarBloque(idBloqueVer,ver,idBloqueLlamador)
{
//	try
//	{
	var charVer = "+";
	var charOcultar = "-";
	var sChar34=String.fromCharCode(34);	
	var datos= new getNavegador()
	var mostrar;
	var ocultar = "none";
	if (datos.nombre=="Microsoft Internet Explorer")
		mostrar="block";
	else
		mostrar="table-row";
	
	if (ver==true)
	{
		document.getElementById(idBloqueVer).style.display = mostrar;
		document.getElementById(idBloqueLlamador).innerHTML="<a href='Javascript:mostrarBloque(" + sChar34 + idBloqueVer + sChar34 + ",false," + sChar34 + idBloqueLlamador + sChar34 + ")'>" + charOcultar + "</a>";
	}
	else
	{
		document.getElementById(idBloqueVer).style.display = ocultar;
		document.getElementById(idBloqueLlamador).innerHTML="<a href='Javascript:mostrarBloque(" + sChar34 + idBloqueVer + sChar34 + ",true," + sChar34 + idBloqueLlamador + sChar34 + ")'>" + charVer + "</a>";		
	}
//	}catch(e)
//	{alert(e.message);}
}

function getNavegador()
{
	this.nombre = navigator.appName;
	this.codigo_nombre = navigator.appCodeName;
	this.version = navigator.appVersion.substring(0,4);
	this.plataforma = navigator.platform;
	this.javaEnabled = navigator.javaEnabled();
	this.pantalla_ancho = screen.width;
	this.pantalla_alto = screen.height;
}

function wopen(url, name, w, h)
{
  // Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  // IE5 and other old browsers might allow a window that is
  // partially offscreen or wider than the screen. Fix that.
  // (Newer browsers fix this for us, but let's be thorough.)
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  var win = window.open(url,name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=no');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}

function verLayer(idLayer,ver,actual)
{
	document.getElementById("HdnBotonDiv").value = "";
	document.getElementById("HdnTxtNuevoDiv").value = "";
	document.getElementById("TxtNuevoDiv").value = "";

	if (ver==true)
	{
		document.getElementById("LblErrorDiv").innerHTML = "";
		var posX = tempX + 15;
		var posY = tempY + 15;
		document.getElementById(idLayer).style.visibility = "visible";
		document.getElementById(idLayer).style.left = posX+"px";
		document.getElementById(idLayer).style.top = posY+"px";
		
		document.getElementById("HdnActual").value=actual;
		if (actual=="modelo")
			document.getElementById("HdnMarca").value=document.getElementById("CmbMarca").value;
			
	}
	else
	{
		var posX = 0;
		var posY = 0;
		document.getElementById(idLayer).style.visibility = "hidden";
		document.getElementById(idLayer).style.left = posX+"px";
		document.getElementById(idLayer).style.top = posY+"px";
	}
}


function verProgress()
{
	document.getElementById("tblProgress").style.visibility = "visible";
}

function verCelda(celda)
{
	var esIE = false;
	if (navigator.appName=="Microsoft Internet Explorer")
		esIE = true;

	var ver="table-row"; if (esIE){ver="block"}
	document.getElementById(celda).style.display = ver;
}