defaultStep=5
step=defaultStep

var URx = 'http://www.fundesarte.org/new/';
loadProv = new ajax();
loadGal = new ajax();
loadIMG = new ajax();
function showhide(var1) {
    if (document.getElementById(var1).style.display == 'inline')
        document.getElementById(var1).style.display = 'none';
    else
        document.getElementById(var1).style.display = 'inline';
};

var min=8;
var max=18;
function resetFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      p[i].style.fontSize = "14px"
      p[i].style.lineHeight = "22px"
   }
}

function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
         var sx = parseInt(p[i].style.lineHeight.replace("px",""));
      } else {
         var s = 14;
         var sx = 22;
      }
      if(s!=max) {
         s += 4;
         sx += 6;
      }
      p[i].style.fontSize = s+"px"
      p[i].style.lineHeight = sx+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
         var sx = parseInt(p[i].style.lineHeight.replace("px",""));
      } else {
         var s = 14;
         var sx = 22;
      }
      if(s!=min) {
         s -= 4;
         sx -= 6;
      }
      p[i].style.fontSize = s+"px"
      p[i].style.lineHeight = sx+"px"
   }
}

function getNumVar() {
    var str= window.location.toString();
    uri2 = str.split('#')
    uri2 = uri2[1];
    if (uri2 == undefined)
        uri2 = 'ESPANA';
    loadProv.get(URx+'loadProv.php?sel=1&prov='+uri2,'provDetails');
}

function changeProv(prov) {
    location.href='#/'+prov;
    loadProv.get(URx+'loadProv.php?sel=1&prov='+prov,'provDetails');
};

function scrollDivLeft(id){
document.getElementById(id).scrollLeft-=step
timerLeft=setTimeout("scrollDivLeft('"+id+"')",10)
}

function scrollDivRight(id){
document.getElementById(id).scrollLeft+=step
timerRight=setTimeout("scrollDivRight('"+id+"')",10)
}

function showClose() {
    document.getElementById('showclose').style.display = 'inline';
};

function hideClose() {
    document.getElementById('showclose').style.display = 'none';
};

function showOver(url, win, wi, he) {
    document.getElementById(win).style.display = 'block';
    document.getElementById(win+'table').style.width = wi+'px';
    document.getElementById(win+'table').style.height = he+'px';
    document.getElementById(win+'2').style.display = 'block';
    loadGal.get(url, win+'2');
};

function closeOver(win, url1, win2) {
    document.getElementById(win).style.display = 'none';
    document.getElementById(win+'2').style.display = 'none';
    loadGal.clear(win+'2');
    if (url1 && win2)
        loadGal.get(url1,win2);
};

function showRecaptcha() {
  Recaptcha.create("6LcHhAgAAAAAALgWY3Y733PX_Vrugm65sG2qiqtw", 'div_captcha', {
        theme: 'white',
        tabindex: 0,
        callback: Recaptcha.focus_response_field
  });
}

function saveSuscribe() {
    if (!document.getElementById('bol_email').value) {
        alert('Debe completar el email para suscribirse');
        return false;
    } else
        return true;
};

function showCal(nc) {
    loadProv.get(URx+'loadCal.php?nc='+nc,'wid_cal');
};
