var site={
	loadValidation:function(){
		$('.webform').validate({
    		rules: {
    			// the errorPlacement has to take the table layout into account
    			errorPlacement: function(error, element) {
    				if(element.is(":radio"))
    					error.appendTo(element.parent().next().next());
    				else if(element.is(":checkbox"))
    					error.appendTo (element.next());
    				else
    					error.appendTo(element.parent().next());
    			},
    			// set this class to error-labels to indicate valid fields
    			success: function(label) {
    				// set &nbsp; as text for IE
    				label.html("&nbsp;").addClass("checked");
    			}
    		}
    	});
	},
    loadSlideSwitch:function(){
    	var $active = $('.slideshow span.active');
    	if ( $active.length == 0 ) $active = $('#slideshow span:last');
    	
    	var $next =  $active.next().length ? $active.next()
    		: $('.slideshow span:first');
    
    	$active.addClass('last-active');
    
    	$next.css({opacity: 0.0})
    		.addClass('active')
    		.animate({opacity: 1.0}, 1000, function() {
    			$active.removeClass('active last-active');
    	});
    },
    loadMenu:function(){
    	$('ul.sf-menu').superfish();
        var n = $('.menu ul li').length;
        //alert(n);
        $('.menu ul li').addClass('last');
    }
};
