 /* ==========================================
 jqToggle
 ============================================= */
 (function($) {
	//define plugin  with some default  settings
	$.jqToggle = { defaults: {  moreText: "Show"} };
	//extend jquery with the plugin
	$.fn.extend({
		jqToggle:function(config, fileNames) {
			//use defaults or properties supplied by user
			var config = $.extend({}, $.jqToggle.defaults, config);
			//return the jquery object for chaining and scan the selected elements
            return this.each(function() {
                var el = $(this);
                $(this).next().hide();
                var html = $(this).html() + ' <a class="aToggler" href="#">' + config.moreText + '</a>' ;
                $(this).html(html);
                // Add click handler
                el.click(function() {
                    $(this).next().slideToggle('fast');
                });
            });
		}
	});

})(jQuery);
/* ==========================================
 jqTips
 ============================================= */
(function($) {
	//define plugin  with some default  settings
	$.jqTips = { defaults: {  moreText: "Show"} };
	//extend jquery with the plugin
	$.fn.extend({
		jqTips:function(config, fileNames) {
			//use defaults or properties supplied by user
			var config = $.extend({}, $.jqTips.defaults, config);
			//return the jquery object for chaining and scan the selected elements
              $("body").append("<div id='jqTipsContainer'></div>");
            return this.each(function() {
                $(this).hover(function(e) {
                    $(this).mousemove(function(e) {
                        var tipY = e.pageY + 16;
                        var tipX = e.pageX + 16;
                        if (tipX <  ($(document).width()/2)){
                            $("#jqTipsContainer").css({'width':250, 'top': tipY, 'left': tipX});
                        }
                        else $("#jqTipsContainer").css({'width':250, 'top': tipY, 'left': e.pageX -200 + 16});
                    });
                    var title = $(this).attr('title') ;
                     $("#jqTipsContainer").html(title).stop(true,true).fadeIn("fast");
                    $(this).attr("title", "");
                    }, function() {
                    $("#jqTipsContainer").stop(true,true).fadeOut("fast");
                    $(this).attr('title', $("#jqTipsContainer").html());
                });
            });
		}
	});

})(jQuery);

