$(document).ready(function () {
    // dropdown menus
	$('#nav').find('ul').has('li .dropdown').each(function() {
        var $ul = $(this);
        var $trigger = $ul.find('li').has('a.dropdown');
        var $submenu = $ul.find('li.sublinks');

        $trigger.mouseenter(function () {
            //$submenu.show();
            $submenu.animate({opacity:'show'}, 200);
        });

		$ul.mouseleave(function(){
			//$submenu.hide();
            $submenu.animate({opacity:'hide'}, 200);
		});
	});

    // searchbar stuff
    var $search = $('#search');
    $search.focus(function () {
        if (this.value == 'Search...')
        {
            this.value = '';
            this.style.color = 'black';
            this.style.fontstyle = 'normal';
        }
    });
    $search.blur(function () {
        if (this.value == '')
        {
            this.value = 'Search...';
            this.style.color = '';
            this.style.fontstyle = '';
        }
    });
});

