/**
 * Interface plugin
 * @desc Requires jQuery-1.3.2
 */


(function($) {
	
	var opt;
	var timerMessage;
	
	$.fn.iFace = function (options) {
		
		opt = $.extend({
		
			
		
		}, options);
				
		return this.each(function () {
			
			this;
		
		});
		
	};
	
	$.fn.extend({
		
		initInterface: function () {
		
				$('input.date').each(function () {
	
					$(this).datepicker( { dateFormat: 'dd-mm-yy' } );
				
				});
		
				$('div.header-login-action').find('a').click(function () {
				
					$(document).showLogin();
				
				});
	
				$('[name=username]').focus(function () { 
				
					if ( $(this).val() == 'Gebruikersnaam' ) {
					
						$(this).val('');
					
					}
					
				}).blur(function () { 
				
					if ( $(this).val() == '' ) {
					
						$(this).val('Gebruikersnaam');
					
					}
					
				});
				
				$('[name=password]').focus(function () { 
				
					if ( $(this).val() == 'Wachtwoord' ) {
					
						$(this).val('');
					
					}
					
				}).blur(function () { 
				
					if ( $(this).val() == '' ) {
					
						$(this).val('Wachtwoord');
					
					}
					
				});
		
			},
		
		showLoginMsg: function (type, msg) {
		
				$('.errorMsgLogin').html(msg);
				$('.errorMsgLogin').addClass(type);
		
				$('.errorMsgLogin').show(300, function () {
				
						setTimeout( function () { $('.errorMsgLogin').hide(300) }, 3000 );
				
					});
		
			},
		
		showLogin: function () {
		
				$('.header-login-action').fadeOut(200);
		
				$('.header-top-red').animate({ height: '177px' }, 200, function () {
				
					$('.header-signup').fadeIn(300);
					$('.header-login').fadeIn(300);
				
				});
		
			},
			
		hideLogin: function () {
		
				$('.header-signup').fadeOut(300);
				$('.header-login').fadeOut(300, function () {
					
						$('.header-top-red').animate({ height: '28px' }, 200, function () { 
						
							$('.header-login-action').fadeIn(200);
						
						});
					
					});
		
			}
		
	});

})(jQuery);