//************************************************************************************//
function abrirVentana()
{
	var accion = 'asp/comprobarlogin.asp?login=' + document.form.login.value;
	if (document.form.login.value=="")
		alert("Debe introducir un nombre de usuario para poder comprobar si existe.");
	else
		window.open(accion, 'LOGIN','resizable=no,toolbar=no,scrollbars=no,alwaysRaised=yes,width=500,height=170,screenX=200,screenY=200,status=yes');
}
//************************************************************************************//
//************************************************************************************//
function ventana(fichero, ancho, alto)
{
var aux, aux1, aux2;
	aux1=parseInt(ancho,10)+20;
	aux2=parseInt(alto,10)+24;
  	aux = window.open('','AMSYSTEM','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+aux1+',height='+aux2);
	var doc = aux.document;
	doc.open('text/html', 'replace');
	doc.write('<HTML><HEAD><TITLE>AM System S.L.</TITLE></HEAD><BODY><img src="'+fichero+'"></BODY></HTML>');
	doc.close();

  
}
//************************************************************************************//

//************************************************************************************//
function CambioTD(numero,color)
{	
	//window.document.all(numero).bgColor=color;
	numero.style.backgroundColor=color;	
}
//************************************************************************************//


//************************************************************************************//
function CambioFONT(numero,color)
{	
	//window.document.all(numero).bgColor=color;
	numero.style.color=color;	
}
//************************************************************************************//


//************************************************************************************//
function OcultaCapas(capa,ocult)	
{	
		
	if (ocult==0) 
	{
		capa.style.visibility='hidden';			
	}
	else
	{			
		capa.style.visibility='visible';			
	}
}
//************************************************************************************//

//************************************************************************************//
function PosicionCapas(capa,obj)	
{
	var si=false;
	var x;
	var posicion;
	var version='';
	var explorador=navigator.appVersion;
	
	if (explorador.search('MSIE'))
	{
		posicion=explorador.search('MSIE');
		posicion=posicion+5;		
		for (x=posicion;explorador.charAt(x)!=';';x++)
		{
			version=version+explorador.charAt(x);			
		}
				
		if (eval(version)>=5.5) si=true;	
	
	}
	else
	{
		si=true;	
	}


	if ((obj!=null) && (si==true))
	{
		var p=[0,0];
		var obj1=obj;				
		while(obj1!=null)
		{
  			p[0]+=obj1.offsetLeft;
  			p[1]+=obj1.offsetTop;
  			obj1=obj1.offsetParent;			
		}																		
		capa.style.pixelTop=p[1];				
		capa.style.pixelLeft=p[0]+obj.offsetWidth-capa.style.pixelWidth;	
	}
}
//************************************************************************************//

//************************************************************************************//
function cambiaimagen(objeto,nombre)
{	
	objeto.src=nombre;			
}
//************************************************************************************//


//************************************************************************************//
function cambiacajas(numero)
{
	var si=false;
	var x;
	var posicion;
	var version='';
	var explorador=navigator.appVersion;
	
	if (explorador.search('MSIE'))
	{
		posicion=explorador.search('MSIE');
		posicion=posicion+5;		
		for (x=posicion;explorador.charAt(x)!=';';x++)
		{
			version=version+explorador.charAt(x);			
		}
				
		if (eval(version)>=5.5) si=true;	
	
	}
	else
	{
		si=true;	
	}
	
	if (si==true) document.all('cajas').filters[0].Apply();
	
	if (numero==7) numero=1;
	
	document.all('cajas').src="imagenes/cajas/0"+numero+".jpg";	
	
	if (si==true) document.all('cajas').filters[0].Play();	
	
	numero++;
	var texto="cambiacajas('"+numero+"')";
	setTimeout(texto,5000)
}
//************************************************************************************//

//*********** MUESTRA U OCULTA CELDAS (NO FUNCIONA EN FIREFOX)******//

function MostrarCeldas(elem) 
	{

	var miID = 'celda' + elem;
	for (i=1; i <= 6; i++) 
		{
		var item_tr = document.getElementById('celda0' + i);

		if (item_tr) 
			{ 
			if (item_tr.name == miID) 
				{
				item_tr.style.display = "";
				} 
			else 
				{
				item_tr.style.display = "none";
				}
			}
		}
	}
	

<!-- MUESTRA U OCULTA DIVS //////////////////////////////////////////////////
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MostrarDiv() { //v6.0
   
  var i,p,v,obj,args=MostrarDiv.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'inline':(v=='hide')?'none':v; }
    obj.display=v; }
}

function MostrarDiv1() { //v6.0
	alert ("hola");
  var i,p,v,obj,args=MostrarDiv1.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'inline':(v=='hide')?'none':v; }
    obj.display=v; }
}



//-->










function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}