﻿var min=8;
var max=28;

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",""));
      }
      else
      {
         var s = 12;
      }
      if(s!=max) 
      {
         s += 1;
      }
      p[i].style.fontSize = s+"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",""));
      } 
      else 
      {
         var s = 12;
      }
      if(s!=min) 
      {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}

function printPage() 
{
	window.print();
}

function test() {
    alert(1); 
    alert(document.getElementByTagName('ctl00$SearchSite$lbtnSearchDummy').value); alert(2);
    alert(1);
    document.getElementByTagName("ctl00$SearchSite$lbtnSearchDummy").click();
    alert(2);
    
}
function Cover(bottom, top, ignoreSize) {
    top.style.display = 'none';
    var location = Sys.UI.DomElement.getLocation(bottom);
    var locationContainer = Sys.UI.DomElement.getLocation(document.getElementById('ctl00_maincontainer'));
    top.style.position = 'absolute';
    top.style.top = location.y + 'px';
    top.style.left = location.x - locationContainer.x + 'px';
}
function HideSearchResult(element) {
    element.style.display = 'none';
}
function ShowPopup(element) {
    modalPopup = $find(element);
    
    modalPopup.show();
}

function ShowArticleImagePopup(imageName) {
    modalPopup = $find('mpeArticleImage');
    var image = document.getElementById('imgArticleBig');
    image.src = "Images/media/fotos/" + imageName;
    setTimeout("modalPopup.show()", 300);
}


function showPrintPopup(imageName, captionValue) {
    modalPopup = $find('mpeArticlePrintPopup');
    var image = document.getElementById('printImgArticleBig');
    image.src = "Images/media/pacshots/" + imageName;
var caption = document.getElementById('printImgCaption');
    caption.innerHTML = captionValue;
    setTimeout("modalPopup.show()", 300);
}

function ClickHereToPrint() {
    try {
        var oIframe = document.getElementById('ifrmPrint');
        oIframe.style.display = '';
        var oContent = document.getElementById('divToPrint').innerHTML;
        var oDoc = (oIframe.contentWindow || oIframe.contentDocument);
        if (oDoc.document) oDoc = oDoc.document;
        oDoc.write("<html>");
        oDoc.write("<head></head><body onload='this.focus(); this.print();'>");
        oDoc.write(oContent + "</body></html>");
        oDoc.close();
    }
    catch (e) {
        //Give Error
    }
} 
