function Test()
{
    alert("Test");
}

function ShowAds(show)
{
    if (show == false)
    {
        divAd1.style.display = 'none'; 
        divAd2.style.display = 'none'; 
    }
}

function GetClientHeight()
{
    return document.body.clientHeight;
}

function Popup(divName, hidePopup)
{
    var divPopup = document.getElementById(divName);
    
    if (hidePopup == false)
    {
        var scrollTop = window.pageYOffset ||
               document.body.scrollTop ||
               document.documentElement.scrollTop;

        var clientHeight = document.body.clientHeight ||
               document.documentElement.clientHeight;
               
        var clientWidth = document.body.clientWidth ||
               document.documentElement.clientWidth;
               
        var divHeightOffset = 65;
        var divWidthOffset = 170;
            
        divPopup.style.top = Math.round((clientHeight / 2) - divHeightOffset + scrollTop) + 'px';  
        divPopup.style.left = Math.round((clientWidth / 2) - divWidthOffset) + 'px';  
        divPopup.style.display = 'block';
    }
    else
    {
        divPopup.style.display = 'none'; 
    }       
}

function LockFormControls()
{   
    // Content page.
    var form = document.getElementById('aspnetForm');
    
    // Non content page
    if (form == null)    
        form = document.getElementById('form1')
    
    // Uknown form
    if (form == null)    
        return;    
               
    var elem = document.getElementById(form.name).elements;
    
    if (elem != null)
    {                        
        for(var i = 0; i < elem.length; i++)
        {
            if (elem[i].type != "hidden")
            {   
                window.setTimeout("document.getElementById('" + elem[i].id + "').disabled=true;",0);                    
            }
        }             
        
        document.body.style.cursor = 'wait';
    }
}

/**
 * Simple encryption to hide email addresses from crawlers in webpages.
 * This code is Free Software provided under an MIT License.
 * Written by Diego Doval: bnaeQ0bvPXOnZQYgaZqp1ZQO
 * http://www.dynamicobjects.com/d2r/
 */
var key = "BAD4@.56CEGFHIJKLVWdfTUhijXYZbacemngMNOPQRSopqrstuvz018923klwxy7";
var base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@.0123456789";
function generateMailLink(encoded, linkText)
{  
  document.write("<a class=cr hr"+"ef=\"ma"+"ilto"+":"+decode(encoded)+"\">"
    +linkText+"</"+"a>");
}

function decode(str)
{
  return codec(key, base, str);
}

function codec(from, to, str)
{
  var codedResult = "";
  for (i = 0; i < str.length; i++) {
    current = str.charAt(i);
    idx = from.indexOf(current);
    nextVal = (idx == -1) ? current : to.charAt(idx);
    codedResult += nextVal;
  }
  return codedResult;
}

