brand.customerService = {}

brand.customerService.faq = {
    activeId: null,
    
    init: function() {
        // get drop down                
        var menu = $("faq-questions");
        var self = this;
        self.showAnswer(menu.value);
        menu.onchange = function() {
            self.showAnswer(menu.value);
        }
    },
    showAnswer: function(questionId) {
        var activeNode = $(this.activeId);
        if (activeNode) {
            activeNode.style.display = "none";
        }
        var answerNode = $(questionId);
        if (answerNode) {
            answerNode.style.display = "block";
        }
        this.activeId = questionId;
    }
}

/*COG Jun10 2010 - Validating form fields based on the question chosen*/
brand.customerService.contact_us = {
    activeId: null,

    init: function() {
        // get drop down    
        var menu = $("form--contact_us--field--QUESTION");
        var self = this;
        self.showMandatory(menu.value);
        menu.onchange = function() {
            self.showMandatory(menu.value);
        }
    },
    showMandatory: function(questionId) {
        var f = $$( '.notalwaysrequired');
		var g = $$( '.alwaysrequired');

        if (questionId == 1 || questionId == 4 || questionId == 6 || questionId == 7) {
            for(var i=0; i<f.length; i++) {
                f[i].removeClassName("hidden");
            }
         } else {
            for(var i=0; i<f.length; i++) {
                f[i].addClassName("hidden");
            }
         }
    }
} 
/*COG Jun10 2010 - Validating form fields based on the question chosen - end*/

