var Site = {
	start: function() {
	    ListDisplay.start();
    }
};

var ListDisplay = {
    start: function(){
        $$('.categorylist').each(function(ul, i){
            ul.getChildren().each(function(li,x){
                if(!li.hasClass('selected'))
                    li.addClass('unselected');

// SB disabled event to expand menu
//                li.addEvent('click', function() {
//                    ListDisplay.CloseAllCategories();
//                    li.removeClass('unselected');
//                });
            });
        });
    },

    CloseAllCategories: function(){
        $$('.categorylist').each(function(ul, i){
            ul.getChildren().addClass('unselected');
         });
    }
};

window.addEvent('domready', Site.start);


function popupwin(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function ToggleItem(myItem) {
	if (myItem.style.visibility != 'hidden')
		HideItem(myItem);
	else
		ShowItem(myItem);
	return false;
}
function ShowItem(myItem) {
	myItem.style.visibility = 'visible';
	myItem.style.display = '';
}
function HideItem(myItem) {
	myItem.style.visibility = 'hidden';
	myItem.style.display = 'none';
}


function checkSearch(me) {
	var objKW = me.strKeywords;
	if (objKW.value=='' || objKW.value=='search..' || objKW.value.length<5) {
		alert('please enter a search term of 5 characters or more');
		objKW.select();
		return false;
	} else {
		return true;
	}
}