/* Begin FAQ */
initCommon();
/*
 * Shows and hides a section in frequently asked questions.  Pretty self explanitory but it's passed a general id that it uses to
 * change elements for the particular section to get the desired effect.
 */
function showFAQSection(sectionTitle){
    if (sectionTitle != "") {//intentionally broad comparison, we want all falsy values
        answerElem = $('a_' + sectionTitle);
        questionElem = $('q_' + sectionTitle);
        containerElem = $('c_' + sectionTitle);

        if (answerElem.style.display == 'none') {
            answerElem.style.display = 'block';
            questionElem.style.background = 'url(/Images/Chrome/collapse000.gif) no-repeat left 3px';
            containerElem.style.backgroundColor = '#F0FFFF';
        }
        else {
            answerElem.style.display = 'none';
            questionElem.style.background = 'url(/Images/Chrome/expand000.gif) no-repeat left 3px';
            containerElem.style.backgroundColor = '#FFF';
        }
    }
}

/*
 * This function is Just for the FAQ page, but if a URL is entered with a hash (link to an anchor)
 * then it grabs the hash which is a div id and passes it to the showFAQSection function.
 */
if (top.location.hash != "") {//intentionally broad comparison, we want all falsy values
    var lastId = top.location.hash.substring(1); //remove the "#"
    Event.observe(window, 'load', showFAQSection(lastId));
}

/* End FAQ */

if ($('intelligenceReportSelect')){
	$('intelligenceReportSelect').observe('change',loadIntelligenceReport);
}

if ($('webinarSelect')) {
	$('webinarSelect').observe('change',loadWebinar);
}

function loadIntelligenceReport(e) {
       var el = e.element();
       window.open(el.value);
}

function loadWebinar(e) {
       var el = e.element();
       window.open(el.value);
}
