var onClickInClass = { //funciones que se basan en si la clase css existe en la estructura html
	agregar_texto : function(){

	}
}

var onClickInId = { //funciones que se basan en si la clase css existe en la estructura html
	agregar_texto : function(){

	}
}
var onMouseEnterLeave = { 
	boton : function(e){
                if (!$(e).hasClass("show")){
                    $('.ajaxbaja').corners("5px ");
                    e.title = null;
                    $(e).next().next().show();
                    $(e).addClass("show");

                }
                else{
                    $(e).next().next().hide()
                    $(e).removeClass("show");
                }
	},
        juntobo : function(e){
                if (!$(e).hasClass("show")){
                    $('.ajaxbaja').corners("5px ");
                    e.title = null;
                    $(e).next().show();
                    $(e).addClass("show");
                    $(e).prev().animate(
			{backgroundPosition:"0 -20px"},
			{duration:1})

                }
                else{
                    $(e).next().hide()
                    $(e).removeClass("show");
                    $(e).prev().animate(
			{backgroundPosition:"0 0"},
			{duration:1})

                }
	}

}


$(document).ready( function() {


        $("#libpag li").quickpaginate({ perpage: 3, showcounter: true, pager : $(".paginador") });
        $("#artpag li").quickpaginate({ perpage: 6, showcounter: true, pager : $(".paginador2") });
        $('#izque').innerfade({ animationtype: 'fade', speed: 1000, timeout:10000, type:'random',containerheight : 329 });

    $.each(onClickInClass, function (i) {
        if ($.isFunction(eval("onClickInClass."+i)) && $('*').hasClass(i)){
               $('.'+i).bind("click", function(e){eval("onClickInClass."+i+"(e)");return false;});
        }
    });

//   $.each(onClickInId, function (i) {
//       if ($.isFunction(eval("onClickInId."+i)) && $('*').id("#"+i)){
//               $('#'+i).bind("click", function(e){eval("onClickInId."+i+"(e)");return false;});
//       }
//    });
     $.each(onMouseEnterLeave, function (i) {
        if ($.isFunction(eval("onMouseEnterLeave."+i)) && $('*').hasClass(i)){
                $('.'+i).bind("mouseover", function(e){eval("onMouseEnterLeave."+i+"(this)")}).bind("mouseout", function(e){eval("onMouseEnterLeave."+i+"(this)")});
        }
    });
});

$.extend({ //extension de metodo jQuery
	id : function(id) {
		var id = id.split("#");
		return document.getElementById(id[1])?true:false;
	}
});
