var globalI=0;

function sIR() { //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 pI() { //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=pI.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 fO(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=fO(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function sI() { //v3.0
  var i,j=0,x,a=sI.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=fO(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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();
}

function preCarga() {
pI('img/k/b_izda/aloj_o.gif','img/k/b_izda/not_o.gif','img/k/b_izda/ent_o.gif','img/k/b_izda/bus_o.gif','img/k/b_izda/don_o.gif','img/k/b_izda/rec_o.gif','img/k/b_izda/bod_o.gif','img/k/b_izda/for_o.gif','img/k/b_izda/cha_o.gif','img/k/b_izda/reg_o.gif','img/k/b_dcha/bie_o.gif','img/k/b_dcha/ins_o.gif','img/k/b_dcha/res_o.gif','img/k/b_dcha/car_o.gif','img/k/b_dcha/coc_o.gif','img/k/b_dcha/sug_o.gif','img/k/b_dcha/esp_o.gif','img/k/b_dcha/men_o.gif','img/k/b_dcha/lin_o.gif','img/k/b_dcha/mas_o.gif','img/k/b_dcha/cont_o.gif','img/k/b_dcha/cena_o.gif')
}

function envia(i) {
//Hace un submit del formulario numero i
document.forms[i].submit();
}

function comprueba() {
 //devuelve 1 si todos los campos que se pasan como argumento del formulario
 // representado por el primer argumento tiene valor. 0 en caso contrario
 var f = comprueba.arguments[0];
 var i;
 for (i=0; i!= document.forms[f].elements.length-1; i++) {
     if (document.forms[f].elements[i].value == "")
         return false;
 }
 return true;
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = fO(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function OBW(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Abre ampliaciones de fotos
function abreImagen(rest) {
         if (globalI == 0) globalI=1;
         var foto_gr = "img/"+rest+"/fotos_big/big_0"+globalI+".jpg";
         var path = "fotos.htm?"+foto_gr;
         var size = "width=400,height=300";
         window.open(path,'Imagen',size);
}
function abreSugerencias(foto_gr,size) {
         var path = "fotos.htm?"+foto_gr;
         window.open(path,'Imagen',size);
}

function click_banner(cid) {
    window.open("http://www.azulindigo.com/adcenter/adclick.cgi?manager=adcycle.com&cid="+cid+"&b=1&id=IDNUMBER&refer=http://www.comeralacarta.com");
}