$(document).ready(function(){ 
	$(document).pngFix();
	setInterval('slideSwitch()', 5000 );
	$('.webform').validate({
		rules: {
			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());
			},
			success: function(label) {
				label.html('&nbsp;').addClass('checked');
			}
		}
	});
	$('select.related_menu').change(function(){
	   var url = $(this).val();
       window.location.href = url;       
	});
});
function slideSwitch() {	
	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');
	});
};
