$(document).ready(function() {
	var lang = $('meta:first').attr('lang');
	
	$(document).pngFix();
	
	$('a[rel=external]').click(function(){
		this.target = "_blank";
	});
	
	if($.browser.msie && $.browser.version<7){
		//alert('kkk');
		$('body').css({'background' : 'url(/media/img/bg_body.jpg) center center no-repeat', 'background-attachment' : 'fixed'})
	}else{
		$.backstretch("/media/img/bg_body.jpg", {speed: 150});
	}
	
	/*
	$('#newsLetter').focus(function(){
		if($(this).val() == 'your e-mail'){
			$(this).val('');
			$(this).css({'color':'#282828'})
		}
	})
	
	$('#newsLetter').blur(function(){
		if($(this).val() == '' || $(this).val() == 'your e-mail'){
			$(this).val('your e-mail');
			$(this).css({'color':'#bbb'})
		}
	})
	
	$('#newsLetterBtn').bind('click', function(){
		var email = $('#newsLetter').val();
		if(!validMail(email)){
			$('#error').html('Your e-mail is not correct.');
		}else{
			$.ajax({
				url		: '/new/ajax.php',
				type	: 'POST',
				data	: {
					emailAdres : email
				},
				success	: function(){
					$('#newsLetter').attr('disabled', 'disabled');
					$('#newsLetter').css({
						'color'	: '#00aa00'
					})
					$('#error').html('');
					$('#newsLetter').val('You are now subscribed for the newsletter.')
					
				}
			
			})	
		}
	})*/
	/*
	$('body').click(function(){
		$('#loginform').hide();
	})
	
	$('#loginform').click(function(event){
		event.stopPropagation();
	});
	$('#login #loginBtn').removeAttr('href').click(function(event){
		//if('#loginform').css()
		event.stopPropagation();
		$('#loginform').toggle();
	})
	*/
	Cufon.replace('h1, h2');
	Cufon.replace('#menu li a, #submenu li a',{hover: true});
	Cufon.replace('#menu li span, #submenu li span',{hover: true});
	Cufon.replace('#login a',{hover: true});
	if($('#banner img').length > 1){
		$("#banner").easySlider({
			auto: true, 
			continuous: true,
			pause: 5000
		});
	}
	$('.enlarge').fancybox();
	/*
	$('#menu li:eq(6) a').attr({
		'href': '/forum/', 
		'target': '_blank'
	})
	
	$('#menu li:eq(11) a').attr({
		'href': '/beeldenbank/', 
		'target': '_blank'
	})
	*/
	/*$('.enlarge').tooltip({
		track: true,
		showURL: false
	});*/
});

