
// detectamos el tipo de navegador
	var isNS4=(document.layers)? true:false;
	var isIE4=(document.all && !document.getElementById)? true:false;
	var isIE5=(document.all && document.getElementById)? true:false;
	var isNS6=(!document.all && document.getElementById)? true:false;
	var isSafari = (navigator.userAgent.indexOf("Safari") >= 0) ? 1 : 0;
	var detect = navigator.userAgent.toLowerCase();
	var isXPlorer = (detect.indexOf("msie") !=-1);



/////////////////////////////////////////////////////////////////////////////////////////////
// función que muestra la fecha
/////////////////////////////////////////////////////////////////////////////////////////////

function fecha() { 
	meses = new Array ("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"); 
	data = new Date(); 
	index = data.getMonth(); 
	diasemana=new Array ("Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"); 
	day = new Date(); 
	
	indexday = data.getDay(); 
	if (indexday == 0) { 
		indexday = 7; 
	} 

	anno = data.getYear(); 
	if ( anno < 1900) { 
		anno = 1900 + anno; 
	} 

    saludo = "Buenas noches";
    hora = data.getHours();
    if ((hora >= 6) && (hora < 14)) {
      saludo = "Buenos días";
    }
    if ((hora >= 14) && (hora < 20)) {
      saludo = "Buenas tardes";
    }
    if (((hora >= 20) && (hora < 24)) || ((hora >= 0) && (hora < 6))) {
      saludo = "Buenas noches";
    }
    
	//document.write('<font>'); 
	document.write(saludo + ', hoy es ' + diasemana[indexday-1]+ "," + ' '+data.getDate()+ " de " + meses[index] + " de " + anno); 
	//document.write('</font>'); 
} 


/////////////////////////////////////////////////////////////////////////////////////////////
// función de centrado de ventanas popup
/////////////////////////////////////////////////////////////////////////////////////////////

var win = null;

function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',noresize'
	
	win = window.open(mypage,myname,settings)
	
	if(win.window.focus){
		win.window.focus();
	}
	
	return win;
}


/////////////////////////////////////////////////////////////////////////////////////////////////
// función para poner un mensaje en la barra de estado
/////////////////////////////////////////////////////////////////////////////////////////////////
		var barrabajo = " gacetadeltaxi.com "; 
		function barra()
		{
			window.status = barrabajo;
			timerID= setTimeout("barra()",1);
		}

/////////////////////////////////////////////////////////////////////////////////////////////////
// función para abrir una ventana CHROMELESS
/////////////////////////////////////////////////////////////////////////////////////////////////

function ChromelessWin(url, width, height) {
	theURL=url
	wname ="CHROMELESSWIN"
	W=width;
	H=height;
	windowCERRARa 		= "images/close_a.gif"
	windowCERRARd 		= "images/close_d.gif"
	windowCERRARo 		= "images/close_o.gif"
	windowNONEgrf 		= "images/none.gif"
	windowCLOCK			= "imgages/clock.gif"
	windowREALtit		= "  I.S.G.F. Informes Comerciales S.L."
	windowTIT 	    	= "<font face=verdana size=1>&nbsp; I.S.G.F. Informes Comerciales S.L.</font>"
	windowBORDERCOLOR   	= "#999999"
	windowBORDERCOLORsel	= "#999999"
	windowTITBGCOLOR    	= "#d2b48c"
	windowTITBGCOLORsel 	= "#ffe4b5"
	openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)
}



/////////////////////////////////////////////////////////////////////////////////////////////
// funciones de capas
///////////////////////////////////////////////////////////////////////////////////////////

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.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')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_modificar() { //v3.0
  var i,p,v,obj,args=MM_modificar.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;}
	obj.top=v; }
}

function visualizar() {
	MM_showHideLayers('dos','','show');
	MM_modificar('tres','','250','cuatro','','350');
}

function ocultar() {
	MM_showHideLayers('dos','','hide');
	MM_modificar('tres','','150','cuatro','','250');
}

function queformulario(capa,form) {
	//Navegador
	isNS4=(document.layers)? true:false;
	isIE4=(document.all && !document.getElementById)? true:false;
	isIE5=(document.all && document.getElementById)? true:false;
	isNS6=(!document.all && document.getElementById)? true:false;
	isSafari = (navigator.userAgent.indexOf("Safari") >= 0) ? 1 : 0;

	if(isNS4) {
		if (capa!=""){
			datCapa  = "document.layers['"+capa+"']";
			datForm  = "document.forms['"+form+"']";
			formulario=datCapa+"."+datForm;
			}
		else{
			formulario  = "document.forms['"+form+"']";
			}	
	}
	else if(isIE4){
		datCapa  = "document.all['"+capa+"']";
		datForm  = "document.forms['"+form+"']";
      	formulario=datForm;
	}
	else if(isIE5){
		datCapa = "document.getElementById('"+capa+"')";
		datForm  = "document.forms['"+form+"']";
		formulario=datForm;
	}
	else if (isNS6) {
		datCapa = "document.getElementById('"+capa+"')";
		datForm  = "document.forms['"+form+"']";
		formulario=datForm;
	}
	else if (isSafari) {
		datCapa = "document.getElementById('"+capa+"')";
		datForm  = "document.forms['"+form+"']";
		formulario=datForm;
	}

	


//alert("sss" + formulario);
//alert("ppp" + eval(formulario));
return formulario;
}

function centrarAncho(intAncho)
{
	return (window.screen.width-intAncho)/2;
}

function centrarAlto(intAlto)
{
	return (window.screen.height-intAlto)/2-80;
}










// ////////////////////////////////////////////////////////////////////////////////////////////////
// /// CODIGO PARA MOSTRAR Y OCULTAR CAPAS INDEPENDIENTEMENTE DEL EXPLORADOR //////////////////////
// ////////////////////////////////////////////////////////////////////////////////////////////////
var is_IE = (document.all) ? true : false;

// FORMA DE RECUPERAR UN ELEMENTO POR SU ID INDEPENDIENTE DEL EXPLORADOR USADO
function fm_getElementById(id)
{
	if(is_IE)
		return document.all[id];
	else 
		return document.getElementById(id);
}


function mostrar(capa, tabla, visible)
{
	var objCapa=fm_getElementById(capa);
	var objTabla=fm_getElementById(tabla);
	
	
	if (visible == '') { 
			
			if(objCapa.style.visibility=='hidden')
			{
					objCapa.style.visibility='visible';
					objCapa.style.height=objTabla.style.height;
					objCapa.style.display = '';
			}
			else
			{
			        objCapa.style.visibility='hidden';
					objCapa.style.height='0px';
					objCapa.style.display = 'none';
			}
	
	
	} else { 
		
			if (visible == 'true') {
				objCapa.style.visibility='visible';
				objCapa.style.height=objTabla.style.height;
				objCapa.style.display = '';
			} 
		
			if (visible == 'false') {
				objCapa.style.visibility='hidden';
				objCapa.style.height='0px';
				objCapa.style.display = 'none';
	 		}
		
	
	}

}
// ////////////////////////////////////////////////////////////////////////////////////////////////



//Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
function makevisible(cur,which){
	strength=(which==0)? 1 : 0.8
	
	if (cur.style.MozOpacity)
		cur.style.MozOpacity=strength
	else if (cur.filters)
		cur.filters.alpha.opacity=strength*100
}


