﻿var _oneSelected = false;
    
    var _expand = false;
    $(document).ready(function() {        
        $(".query").click(expand);
        $(".expander").click(expand);
    });
    
    function expand(){    
         if(_oneSelected)
            collapsAll();
         
         $box = $(this).parents().filter(".roundedcornr_box_634775");
         
         if($box.find(".extended").is(':visible'))
         {
            
            $box.find(".roundedcornr_top_634775").css("background", "url(/templates/images/roundedcornr_634775_tr.png) no-repeat top right");
            $box.find(".roundedcornr_content_634775").css("background", "transparent url(/templates/images/roundedcornr_634775_r2.png) repeat-y scroll right top");
            $box.find(".roundedcornr_bottom_634775 div").css("background", "url(/templates/images/roundedcornr_634775_br.png) no-repeat bottom right");
            $box.find(".expander").css("background", "transparent url(/templates/images/faqDown.png) 8px 6px no-repeat");
            $box.find(".FAQitems").css("cursor", "pointer");
            $box.find(".FAQitems").css("height", "20px");
            $box.find(".extended").hide();            
            $box.find(".expander").css("top", "0px");
            $box.find(".query").click(expand);
         }
         else
         {
            $box.find(".roundedcornr_top_634775").css("background", "url(/templates/images/roundedcornr_634775_tr_blue.png) no-repeat top right");
            $box.find(".roundedcornr_content_634775").css("background", "transparent url(/templates/images/roundedcornr_634775_r2_blue.png) repeat-y scroll right top");
            $box.find(".roundedcornr_bottom_634775 div").css("background", "url(/templates/images/roundedcornr_634775_br_blue.png) no-repeat bottom right");
            $box.find(".expander").css("background", "transparent url(/templates/images/faqCross.png) 8px 6px no-repeat");
            $box.find(".expander").css("width","30px");
            $box.find(".expander").css("float","left");
            $box.find(".FAQitems").css("height", "100%");
            $box.find(".FAQitems").css("cursor", "text");
            $box.find(".extended").show();
            $box.find(".extended").css("height","100%");
            
            var iHeight = $box.find(".FAQitems").height()/2-10;
            $box.find(".expander").css("top", iHeight + "px");
            $box.find(".query").unbind("click");
            
            //$box.find(".expander").click(expand);
        }
    }

    
    function getFAQ(sE){
        $box2 = $("#"+sE);
        
        $box2.find(".roundedcornr_top_634775").css("background", "url(/templates/images/roundedcornr_634775_tr_blue.png) no-repeat top right");
        $box2.find(".roundedcornr_content_634775").css("background", "transparent url(/templates/images/roundedcornr_634775_r2_blue.png) repeat-y scroll right top");
        $box2.find(".roundedcornr_bottom_634775 div").css("background", "url(/templates/images/roundedcornr_634775_br_blue.png) no-repeat bottom right");
        $box2.find(".expander").css("background", "transparent url(/templates/images/faqCross.png) 8px 6px no-repeat");
        $box2.find(".expander").css("width","30px");
        $box2.find(".expander").css("float","left");
        $box2.find(".FAQitems").css("height", "100%");
        $box2.find(".FAQitems").css("cursor", "text");
        $box2.find(".extended").show();
        $box2.find(".extended").css("height","100%");
        var iHeight = $box2.find(".FAQitems").height()/2-10;
        $box2.find(".expander").css("top", iHeight + "px");
        $box.find(".query").unbind("click");
        location.href = "#" + sE;
    }