if (typeof $Qtip == "undefined") var $Qtip = {

    init: function() {
        $( ".help-tooltip" ).each(
            function( ){

                tooltip_text = $("#" + this.id + "-text" ).html();
                tooltip_title = $("#" + this.id + "-title" ).html();

                $('#'+this.id).qtip({

                    content: {
                        text: tooltip_text,
                        title: {
                            text: tooltip_title
                        }
                    },
                    style: {
                        border: {
                            width: 2,
                            radius: 8,
                            color: '#6699CC'
                        }
                    } 
                    // By default its shown onMouseOver
                    //show: { when: { event: 'click' } }
                });

            }
        );
    },

    ajaxInit: function(id_elem, service, method, params, renderCallback) {

                $('#'+id_elem).qtip({
                    content: {
                        text: '<img src="css/images/loading.gif" alt="Loading...">'
                        /*title: {
                            text: tooltip_title
                        }*/
                    },
                    style: {
                        border: {
                            width: 2,
                            radius: 8,
                            color: '#6699CC'
                        }
                    },
                    
                    api: {
                        onRender: function() {
                                    $Client.hiddenReq(
                                        service,
                                        method,
                                        params,
                                        function (data) {
                                            renderCallback(id_elem, data);
                                        }
                                    );
                        }
                    }
                });
    }

}



