function submitArticleConfigFinder(id, select)
{
    if (select == 'c_1') {
        $("#c_2").val("");
        $("#c_3").val("");
    } else if (select == 'c_2') {
        $("#c_3").val("");
    }
    $('#' + id).submit();
//    if (select) {
//        select.form.submit();
//    }
}

function getCookie(name)
{
    var start = document.cookie.indexOf( name + "=" );
    var len = start + name.length + 1;
    if ((!start) && (name != document.cookie.substring(0, name.length))) {
        return null;
    }
    if (start == -1) return null;
    var end = document.cookie.indexOf(";", len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len, end));
}

function setCookie(cookiename, value, expiredays) {
    var exdate= new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie = cookiename + "=" + escape(value) + ((expiredays==null) ? "" : ";expires=" + exdate.toGMTString());
}

function initBillboard()
{
//    if (billboardArgs) {
        var id = billboardArgs[0].id;

        // check if cookie has been set
        var cookie = getCookie('hide_' + id);
        if (cookie) return;

//        if (id) {

            var node = document.getElementById(id);
//            billboardArgs.push(node);
            openBillboard(node.parentNode);
// now done in template itself because this won't work in ie
//            swfobject.createSWF.apply(swfobject, billboardArgs);
//        }
//    }
}

function openBillboard(node)
{
    if (node) {
        node.className = node.className.replace(/nodisplay/, '');
    }
}

function closeBillboard(id)
{
    var node = document.getElementById(id);
    if (node) {
        node.parentNode.className += ' nodisplay';
    }
}

function closeBillboardForever(id)
{
    closeBillboard(id);

    // set expiration date for cookie
    var date = new Date();
    date.setDate((date.getDate() + 30)); // set to 30 days

    // set cookie
    var cookiestring = 'hide_' + id + '=1; expires=' + date;
    document.cookie = cookiestring;
}

