
;jQuery.lpplSlideBox || (function($) {

var hover_timer_id = undefined;

function __mouseOn( ) {
	if(hover_timer_id != undefined) {
        $(document).runTimeout(hover_timer_id);
	}
	$(this).toggleClass('slidebox_hover').animate({width: '400'}, 1000);
}

function __mouseOutAction( object ) {
	$(object).toggleClass('slidebox_hover').animate({width: '30'}, 1000);
	hover_timer_id = undefined;
}

function __mouseOut( ) {
	hover_timer_id = $(document).setTimeout( __mouseOutAction, 500, this );
}

function __clickSlider() {
    $this = $(this);
    if($this.hasClass('clicked')){
        $this.toggleClass('clicked').animate({width:30}, 1000, 'swing');
    } else {
        $this.toggleClass('clicked').animate({width:400}, 1000, 'swing');
    }
}

function __initSlideBox( config ){
    switch(config.action) {
        case 'hover': $(this).hover( __mouseOn, __mouseOut ); break;
        default: $(this).click( __clickSlider ); break;
    }
}


$.fn.extend({ lpplSlideBox : __initSlideBox });
})(jQuery);

