(function($){

    var methods = {
        
        pondasiPlugin:function(box_content){
            
            //tambahkan sheet of paper
            $(this).before('<div id=\"black-shadow\" class=\"black-shadow\"></div><!-- back heet of paper --><div id=\"back-sheet-of-paper\" class=\"back-sheet-of-paper\"><!-- header sheet of paper --><div class=\"header-sheet-of-paper\"><!-- tombol close sh --><img id=\"close-button" class=\"close-button\" src=\"http://localhost/baliincentive/images/pelengkap/close-button.png\" title=\"Close sheet of paper\" /><!-- logo bali incentive --><img id=\"logo-bali-incentive\" class=\"logo-bali-incentive\" src=\"http://localhost/baliincentive/images/logo/bali-incentive-2.png\" title=\"Bali Incentive\" /></div><!-- body sheet of paper --><div id=\"body-of-paper\" class=\"body-of-paper\"><div id=\"border-of-paper\" class=\"border-of-paper\"></div></div><!-- footer sheet of paper --><div id=\"footer-of-paper\" class=\"footer-of-paper\"></div></div><script type=\"text/javascript\">$(document).ready(function(){/*jika tombol zoom di click*/ $(\"#zoom-in\").click(function(){/*show black shadow*/$(\"#black-shadow\").fadeIn(300);/*back sheet of paper*/$(\"#back-sheet-of-paper\").fadeIn(300);/*isi content*/ $(\"#border-of-paper\").html($(\"#isi-content\").html());});/*jika black shadow di click*/$(\"#close-button\").click(function(){/*show black shadow*/$("#black-shadow").fadeOut(300);/*back sheet of paper*/$("#back-sheet-of-paper").fadeOut(300);});});</script>');
            
            //tambahkan div dan tombol zoom
            $(this).before('<!-- zoom content --><div class="wadah-tombol"><img src="http://localhost/baliincentive/images/pelengkap/zoom-in.png" title="Zoom content" class="zoom-in" id="zoom-in" /></div>');
            
            //tambahkan tombol up and down
            $(this).after('<script type="text/javascript">$(document).ready(function(){$("#scroll-up").bind({click:function(){$("'+box_content+'").upanddown("upClick");},mousedown:function(){$("'+box_content+'").animate({scrollTop:0},4000);},mouseup:function(){$("'+box_content+'").stop();}});$("#scroll-down").bind({click:function(){$("'+box_content+'").upanddown("downClick");},mousedown:function(){$("'+box_content+'").animate({scrollTop:$("'+box_content+'").html().length},10000);},mouseup:function(){$("'+box_content+'").stop();}});});</script><!-- scroll up --><img src="http://localhost/baliincentive/images/pelengkap/scroll-up.png" title="Scroll up" id="scroll-up" class="scroll-up" /><!-- scroll down --><img src="http://localhost/baliincentive/images/pelengkap/scroll-down.png" title="Scroll down" id="scroll-down" class="scroll-down" />');
            
        },
        upClick:function(){
            
            $(this).scrollTop($(this).scrollTop()-20);            
            //methods.downClick.apply(this);
        },
        downClick:function(){
            
            $(this).scrollTop($(this).scrollTop()+20);    
            
        }
        
    };

    $.fn.upanddown = function(method){
        
        // Method calling logic
        if(methods[method]){
            
            return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
            
        }else if(typeof method === 'object' || !method){
            
            return methods.pondasiPlugin.apply(this,arguments);
            
        }else{
            
            $.error('Method '+method+' does not exist on jQuery.tooltip');
            
        }
        
    };

})(jQuery);
