function resizeFont(element_id, amount, min, max)
{
    amount = Number(amount);
    var font = document.getElementById(element_id);
    doResize(font, amount, min, max);
}

function resizeFontClass(tag_name, class_name, amount, min, max)
{
    amount = Number(amount);
    var all_tags = document.getElementsByTagName(tag_name);
    for (var i = 0; i < all_tags.length; i++)
    {
        if (all_tags[i].className == class_name)
        {
            var font = all_tags[i];
            doResize(font, amount, min, max);
        }
    }
}

function doResize(font, amount, min, max)
{
    var old_size = "12px";
    if (document.defaultView && document.defaultView.getComputedStyle)
    {
        old_size = parseInt(document.defaultView.getComputedStyle(font, "").getPropertyValue("font-size").replace('px', '').replace('em', '').replace('pt', ''));
    }
    else if (font.currentStyle)
    {
        old_size = parseInt(font.currentStyle.fontSize.replace('px', '').replace('em', '').replace('pt', ''));
    }

    if (amount == 0 || old_size == 0)
    {
        return false;
    }
    if (old_size+amount < min)
    {
        font.style.fontSize = min;
    }
    else if (old_size+amount > max)
    {
        font.style.fontSize = max;
    }
    else
    {
        font.style.fontSize = (old_size+amount)+"px";
    }
}


function initSmoothScroll()
{
    window.addEvent('domready',function() { new SmoothScroll({ duration:3000 }, window); });
}

function setCookie(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

if(navigator.cookieEnabled)
{
    var rgex = /cmpid=([0-9]+)/;
    
    if (rst = window.location.toString().match(rgex))
    {
        if (rst[1].length > 0)
        {
            setCookie('_cmpid', rst[1], 1);
        }
    }
}