// *** DECLARO LAS VARIABLES PARA LA FECHA DE LAS COOKIS *** 
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (365 * 24 * 60 * 60 * 1000));//1 aņo mas desde ahora

// *** AGREGAR A FAVORITOS ***
function favoritos() { 
if (window.sidebar&&window.sidebar.addPanel)
 window.sidebar.addPanel("Halcry.com","http://www.halcry.com/ns6side.htm","");
else 
 var bookmarkurl="http://www.halcry.com"
 var bookmarktitle="Halcry.com"
 window.external.AddFavorite(bookmarkurl,bookmarktitle)
   } 

// *** IMAGENES DE INTERCAMBIO ***
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_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.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];}
}

// *** EFECTO IMAGEN FANTASMA ***
function high(which2)
{theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2)
{clearInterval(highlighting)
which2.filters.alpha.opacity=40
}
function highlightit(cur2)
{if(cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if(window.highlighting)
clearInterval(highlighting)
}

// *** POPUP ***
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// *** POPUP INICIO ***
function openINICIO(theURL,winName,features) { //v2.0
  window.open('/stand_rural/index.htm','Sucursales','width=561,height=337');
}

// *** POPUP SURCURSALES ***
function openSUCURSALES0101(theURL,winName,features) { //v2.0
  window.open('/sucursales/0101.htm','Sucursales','width=690,height=470');
}

function openSUCURSALES0102(theURL,winName,features) { //v2.0
  window.open('/sucursales/0102.htm','Sucursales','width=690,height=470');
}

function openSUCURSALES0103(theURL,winName,features) { //v2.0
  window.open('/sucursales/0103.htm','Sucursales','width=690,height=470');
}

function openSUCURSALES0104(theURL,winName,features) { //v2.0
  window.open('/sucursales/0104.htm','Sucursales','width=690,height=470');
}

function openSUCURSALES02(theURL,winName,features) { //v2.0
  window.open('/sucursales/02.htm','Sucursales','width=690,height=290');
}

function openSUCURSALES03(theURL,winName,features) { //v2.0
  window.open('/sucursales/03.htm','Sucursales','width=690,height=290');
}

function openSUCURSALES04(theURL,winName,features) { //v2.0
  window.open('/sucursales/04.htm','Sucursales','width=690,height=290');
}

// *** ESCALA EL POPUP AL TAMAŅO DEL CONTENIDO ***
var i=0;
function escalaPOPUP() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +20, document.images[0].height+65-i);
}

// *** CAJA DESPL DISPARA ***
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// *** ESCRIBE LAS COOKIES DEL SITIO *** 
		function SetCookie (name,value,expires,path,domain,secure) 
		{
			document.cookie = name + "=" + escape (value) +
			((expires) ? "; expires=" + expires.toGMTString() : "") +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			((secure) ? "; secure" : "");
		 }

// *** LEE LAS COOKIS DEL SITIO *** 
		function GetCookie (name) 
		{
		  var arg = name + "=";
		  var alen = arg.length;
		  var clen = document.cookie.length;
		  var i = 0;
		  while (i < clen) 
		  {
		    var j = i + alen;
		    if (document.cookie.substring(i, j) == arg)
		      return getCookieVal (j);
		    i = document.cookie.indexOf(" ", i) + 1;
		    if (i == 0) break; 
		  }
		  return "block";
		}
		function getCookieVal (offset) 
		{
		  var endstr = document.cookie.indexOf (";", offset);
		 if (endstr == -1)
		   endstr = document.cookie.length;
		 return unescape(document.cookie.substring(offset, endstr));
		}

// *** BARRA DE ESTADO DESACTIVADA *** 
function hidestatus(){
window.status=''
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus
// sets layer z-index
function setZIndex(id, z_index) {
	document.getElementById(id).style.zIndex = z_index;
}
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_showHideLayers() { //v6.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 detectScreenRes() {
	if (screen.width > 800 && screen.height > 600) 	{
		MM_showHideLayers('cjaon','','show');
	} else 	{
		MM_showHideLayers('cajon','','hide');
	}
}
