$(document).ready(function(){
	targetBlank.init();
	placeHolder.init();
        if(typeof($.fn.fancybox) !== 'undefined') {
            $('a[type=box]').fancybox();
        }

        if(typeof($.fn.jScrollPane) !== 'undefined') {
            $('#content').jScrollPane();
        }
});

var targetBlank = {
	init : function() {
		$('a[type=extern]').live('click',function(){
			$(this).attr('target','_blank');
		});
	}
}

var placeHolder = {

	items : null,

	init : function() {
		this.items = $('.hasPlaceholder');
		this.items.live('focus',this.focus);
		this.items.live('blur',this.blur);
		this.items.each(function(){
			$(this).data('placeholder',$(this).attr('value'));
			$(this).addClass('empty');
		});	
	},
	
	focus : function() {
		$(this).removeClass('empty');
		if($(this).val() === $(this).data('placeholder')) {
			$(this).val('');
		}
	},
	
	blur : function() {
		$(this).val($.trim($(this).val()));
		if($(this).val() === '') {
			$(this).val($(this).data('placeholder'));
			$(this).addClass('empty');
		}
	}
}
