/* Drop and go form menus */
function doSel(obj) {
	for (i = 1; i < obj.length; i++)
		if (obj[i].selected == true)
			eval(obj[i].value);
}



/* updates the top seach form based on selected option */
function hplChangeOption() { //v2.0
	// grab the selected value
	var sel = document.hplSearch.searchOption.selectedIndex;
	document.hplSearch.action = document.hplSearch.searchOption.options[sel].value;
	
	// make the change to required form values
	if (sel == 0) {
		//alert("for Books/DVDs/CDs");
		document.hplSearch.searchword.name = "term"; //horizon
		document.hplSearch.index.value = ".GW"; //anyword anywhere
		
	} else if (sel == 1) {
		//alert("for Titles");
		document.hplSearch.searchword.name = "term"; //horizon
		document.hplSearch.index.value = ".TW"; //title keyword
		
	} else if (sel == 2) {
		//alert("for Authors");
		document.hplSearch.searchword.name = "term"; //horizon
		document.hplSearch.index.value = ".CW"; //author keyword
		
	} else if (sel == 3) {
		//alert("Audio Books");
		document.hplSearch.searchword.name = "FreeFormCriteria"; //overdrive
		
		
	} else if (sel == 4) {
		//alert("Website");
		document.hplSearch.searchword.name = "search"; //modx
		
	}
}

function unhide(divID) {
       var item = document.getElementById(divID);
       if (item) {
         item.className=(item.className=='hidden')?'unhidden':'hidden';
       }
     }

function initMenu() {
  $('#faq ul').hide();
  $('#faq li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#faq ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }
$(document).ready(function() {initMenu();});
