//MOOTOOLS CODE
window.addEvent('domready', function() {

	var searchPlaceholder = $$('#rightcolumn .searchcontainer #searchKeyword');
	var placeholder = 'Keyword';
	if($defined(searchPlaceholder)) {
			searchPlaceholder.each(function(element) {

			// set default placeholder value
			element.set('value', placeholder);

			// add events
			element.addEvents({
				'focus': function() {
					if(this.value == placeholder) {
						this.set('value', '');
					}
				},
				'blur': function() {
					if(this.value == '') {
						this.set('value', placeholder);
					}
				}
			});

		// remove placeholder text on submission
			var form = element.getParent('form');
			form.addEvent('submit', function(){
				if(this.value == text) {
					this.set('value','');
				}
			});
	
		});
	}


});

// JQUERY CODE
(function($) {
	$(function(){
		$('#filter .filter_box').each(function() {
			// check more than 4 items
			if($('li', this).length > 4) {
				// hide list elements > 4 items
				$('li:gt(3)', this).addClass('hide_true');
				$(this).append('<p class="show_more"><a href="#" title="Show more item above">Show more</a></p>');
	
				// bind event to more link
				$('.show_more a', this).bind("click", function() {
					if($(this).text() == "Show more") {
						$(this).text('Show less');
						$(this).parents('.filter_box').find('li').removeClass('hide_true');
						$(this).parent().removeClass('show_more').addClass('show_fewer');
					} else {
						$(this).text('Show more');
						$(this).parents('.filter_box').find('li:gt(3)').addClass('hide_true');
						$(this).parent().removeClass('show_fewer').addClass('show_more');
					}
					return false;
				});
			}
		});
	});
})(jQuery);
