$(document).ready(function(){
	$('#site-q').focus(function(){
		if($(this).val() == 'Search'){
			$(this).val('');
		}
	});
	
	$('#site-q').blur(function(){
		if($(this).val() == ''){
			$(this).val('Search');
		}
	})
	
	$('#rotate-nav').css('display', 'block');
	
	$('#more-information input[type="text"]').focus(function(){
		switch($(this).attr('name')){
			case 'name':	if($(this).val() == 'name'){
									$(this).val('');
							}
							break;
			case 'email' :  if($(this).val() == 'e-mail'){
								$(this).val('');
							}
							break;
		}
	});
	
	$('#more-information input[type="text"]').blur(function(){
		if($(this).val() == ''){
			switch($(this).attr('name')){
				case 'name' :	if($(this).val() == ''){
									$(this).val('name');
								}
								break;
				case 'email' :  if($(this).val() == ''){
									$(this).val('e-mail');
								}
								break;
			}
		}
	});
	
	$('#rotate-nav li a').click(function(){
		var cur_promo = $(this).attr('rel').substring(6);
		var prev_promo = $('#rotate-nav li .selected').attr('rel').substring(6);
			
		if($(this).attr('class') != 'selected'){
			$('#rotating-' + prev_promo).css('display', 'none');
			$('#rotate-nav li .selected').toggleClass('selected');

			$('#rotating-' + cur_promo).css('display', 'block');
			$(this).toggleClass('selected');
		}
	});
	
	$("#menu li").hover(
        function(){ $("ul", this).fadeIn("fast"); }, 
        function() { } 
    );
    
    if (document.all) {
        $("#menu li").hoverClass("sfhover");
    }
})

$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() { $(this).addClass(c);  },
            function() { $(this).removeClass(c); }
        );
    });
};