// JavaScript Document
function MM_reloadPage(init) 
{  //reloads the window if Nav4 resized
  if (init==true) with (navigator) 
  	{
	if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
		{
    	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; 
		}
	}
  	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
		location.reload();
}
MM_reloadPage(true);


function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  	window.open(theURL,winName,features);
}




/* POPUP */
function Popup(url,name,width,height,resize,scroll) {
	var dialogWin = new Object();
	dialogWin.width = width;
	dialogWin.height = height;
	now = new Date();
	var millis=now.getTime();
	var mstr=""+millis;
	if (navigator.appName == "Netscape") {
		dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
		dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
		var attr = 'screenX=' + dialogWin.left + ',screenY=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
	} else if (document.all) {
		dialogWin.left = (screen.width - dialogWin.width) / 2;
		dialogWin.top = (screen.height - dialogWin.height) / 2;
		var attr = 'left=' + dialogWin.left + ',top=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,status=no,directories=no';
	}
window.open(url,name,attr);
}

/* Mostrar u ocultar una capa */ 
var capa
  function mostrarOcultar(idCapa){
  if (document.layers) capa = eval("document." + idCapa);
  if (document.all) capa = eval(idCapa + ".style");
  if (document.getElementById) 
  	capa = eval('document.getElementById("' + idCapa + '").style');
	if ((capa.visibility == "hidden") || (capa.visibility == "hide")){
  		capa.visibility = (document.layers) ? "show" : "visible" ;
  		}else{
  			capa.visibility = (document.layers) ? "hide" : "hidden" ;
  			}
  	}

/* Trabajo En Sistemas 2006 */ 
function ToggleDisplay(cual) {
	var o=document.getElementById(cual);
	if (o.style.display=='none') {
		try { o.style.display='block'; } catch(e) { o.style.display='block'; }
		document.getElementById('flechita_' + cual).src='../imagenes/flechitaup.gif';
		document.cookie = cual + "=abierto; path=/";
	}
	else {
		o.style.display='none';
		document.getElementById('flechita_' + cual).src='../imagenes/flechitadown.gif';
		document.cookie = cual + "=cerrado; path=/";
	}

}

function contraerTodas() {
	var set=document.getElementById('listado_ids').value;
	set=set.split(',');
	for(var i=0;i < set.length; i++) {
		document.getElementById('ofertafull'+set[i]).style.display='none';
		try { document.getElementById('ofertaresumen'+set[i]).style.display='table-cell'; } catch(e) { document.getElementById('ofertaresumen'+set[i]).style.display='inline'; }
	}
}

function expandirTodas() {
	var set=document.getElementById('listado_ids').value;
	set=set.split(',');
	for(var i=0;i < set.length; i++) {
		document.getElementById('ofertaresumen'+set[i]).style.display='none';
		try { document.getElementById('ofertafull'+set[i]).style.display='table-cell'; } catch(e) { document.getElementById('ofertafull'+set[i]).style.display='inline'; }
		//document.getElementById('ofertavista'+set[i]).src='/imagenes/visto.gif';
	}
}


  


function ocultaaviso(cual) {
	document.getElementById(cual).style.visibility='hidden';
}

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_preloadimagenes() { //v3.0
  var d=document; if(d.imagenes){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadimagenes.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_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 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 abrirPopup(direccion, ancho, alto, sustituir){ 
var izquierda = (screen.availWidth - ancho) / 2; 
var arriba = (screen.availHeight - alto) / 2; 
var opciones = "fullscreen='0',toolbar='0',location='0',status='0',menubar='0',scrollbars='0',resizable='0',width=" + ancho + ",height=" + alto + ",left=" + izquierda + ",top=" + arriba; 
var ventana = window.open(direccion,"ventana",opciones,sustituir); 
} 