$(document).ready(function(){

	$("#top-nav li:has(ul)").addClass("root").find("a:first").addClass("sub");
	
	$("#top-nav li.root").hover(function () {
		$(this).children('ul:hidden').slideDown(500); 
	
		},function(){
			$(this).children('ul:visible').slideUp(500);
    	}
    );
	
$("#slidetabs").tabs("#slider > div.item", {effect: 'fade', rotate: true, fadeOutSpeed: 1500, fadeInSpeed: 1500}).slideshow({autoplay: true, clickable: false, interval: 4000});

	$('input[type="text"]').focus(function() {
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    $('input[type="text"]').blur(function() {
        if (this.value == ''){
        	this.value = this.defaultValue;
    	}
    });
	
    $(function() {
        $(".select").change(function() {
            if ($(this).val()) {
                window.location = $(this).val();
            }
        });
		
    });
	
	
var a = $("#content").height();
var b = $("#sidebar").height();
if ( a > b ) { $("#sidebar").height(a); } else { $("#content").height(b); };
	
});
