$(document).ready(function() {
	//$(document).pngFix();
	$('#mainMenu li:not(.active)').hover(
		function () {
			$('.background a', this).animate({backgroundPosition: "0 0"}, 
			{duration:500});
		}, 
		function () {
			$('.background a', this).animate({backgroundPosition: "0 51px"}, 
			{duration:500});
		}
	);

	var border = RUZEE.ShadedBorder.create({ corner:6, shadow:12 });
	border.render($('.roundedshadow'));
	var bordernoright = RUZEE.ShadedBorder.create({ corner:6, shadow:12,  border:0, edges: 'tlb'});
	bordernoright.render($('.roundedshadownoright'));


/*	$.sifr({ path: 'fileadmin/templates/3digit-2009-R3/fonts/', save: 1});
	$('.futura-medium').sifr({font: 'futura-medium'});
	$('.futura-medium-italic').sifr({font: 'futura-medium-italic'});
	$('.futura-condensed-medium').sifr({font: 'futura-condensed-medium'});
	$('.futura-condensed-extrabold').sifr({font: 'futura-condensed-extrabold'});
*/	
	
	$('div#toggleContact').click().toggle(function() {
		$('#contactBox').animate({
			width: 'show',
			opacity: 'show'
		}, 'slow');
		$('#toggleContact').animate({
			marginRight: '-3px'
			});
	}, function() {
		$('#contactBox').animate({
			width: 'hide'
			/* opacity: 'hide' */
		}, 'slow');
	});

	$("#kontakt").validate({
			errorElement: "div",
			errorPlacement: function(error, element) {
				 error.appendTo( element.parent() ).hide().fadeIn('slow');
			},
			success: function(label) {
				label.text("OK!").addClass("success").hide().fadeIn('slow');
			}
		});
		
	$("#agentur-kontakt").validate({
			errorElement: "div",
			errorPlacement: function(error, element) {
				 error.appendTo( element.parent() ).hide().fadeIn('slow');
			},
			success: function(label) {
				label.text("OK!").addClass("success").hide().fadeIn('slow');
			}
	});
	
	// content slider for submenu items
	
	//$("#menuSub li a").click(function () {
	//	$("#menuSub .act").removeClass("act");
	//	loadContent(this);
	//	$(this).parent().addClass("act");
	//	return false;
	//})
	
	// function to load the content of link target
	
	function loadContent(url) {
		$('.highlightBox .content').fadeTo('1000', 0, function () {
			$('.highlightBox .content').load($(url).attr("href") + " .content", '' , function () {
				$('.highlightBox .content').fadeTo('1000', 1);
			}
			);
			}
		);
	}
});
