/*
Shows a faq element and hides other FAQ elements;
*/
function ShowFaqElement(question, answer) {
    var questions = document.getElementById('questions_' + question);
    var im = document.getElementById('OpenClose_' + question);
    if (questions) {
        HideFaqElements(question); /* first hide everything */
        questions.style.display = "block";
        im.src = baseTheme +'/i/icon-faq-open.gif';
        var answers;
        if (answer != '') {
            answers = document.getElementById(answer);
            answers.style.display = "block";
        }
    }
}
function HideFaqElements() {
    //loop through all other question elements and hide them
    var container = document.getElementById("contentitem");
    var questionarray = container.getElementsByTagName("div");
    var imgarray = container.getElementsByTagName('img');
    if (questionarray) {
        for (var i = 0; i < questionarray.length; i++) {
            questionarray[i].style.display = "none";
            if (questionarray[i].id.toLowerCase().indexOf("pnlfaq") > 0) {
                //keep the 'FaqController' visible, name is found in the server side id of the FaqController usercontrol.
                questionarray[i].style.display = "block";
            }
        }
        if (imgarray) {
            for (var i = 0; i < imgarray.length; i++) {
                if (imgarray[i].id.substr(0, 4).toLowerCase() == "open") {
                    imgarray[i].src = baseTheme + '/i/icon-faq-close.gif';
                }
            }
        }
    }
}

function SetContainerHeights() {
    var leftcol = document.getElementById('homepage-leftcol');
    var rightcol = document.getElementById('homepage-rightcol');
    var newheight;
    if (leftcol.clientHeight > rightcol.clientHeight) {
        newheight = leftcol.clientHeight - 15;
        rightcol.style.height = newheight + 'px';
    }
    if (rightcol.clientHeight > leftcol.clientHeight) {
        newheight = rightcol.clientHeight - 15;
        leftcol.style.height = newheight + 'px';
    }
}

function SetInput(el, content) {
    if (el.value == '') {
        el.value = content
    }
}
function ClearInput(el, content) {
    if (el.value == content) {
        el.value = '';
    }
}

/*
Vertical slider methods for the News Control
*/
$(function() {$('#newscontainer .caption').textOverflow();});6
$(function() {$('#newscontainer').vTicker({ height: 190 }); });
/*
Newspaper style columns for the SiteMap
*/
$(function() {
$('#sitemapcolumns ul li').addClass("dontsplit");
$('#sitemapcolumns').columnize({ width: 275 });
});