﻿//<![CDATA[
//Here we do the tool tips
$(document).ready(function() {
    $("input:text,input:password").each(function() {
        this.toolTipText = this.title;
        $(this).removeAttr("title");
        this.errorMsg = $(this).next('span.errorMsg').text();
        $(this).next('span.errorMsg').remove();
    })
    .focus(function(e) {

        //alert($(this).parent().width());
        if (this.toolTipText) {
            liWidth = $(this).parents("li").width() + 4;
            $(this).parents("li").prepend("<div class='popupToolTip'><div class='popupToolTipText'>" + this.toolTipText + "</div></div>");

            $(".popupToolTip").hide().css({ marginLeft: liWidth + "px", marginTop: "-5px" }).fadeIn('fast');

            $newPopUp = $(".popupToolTipText");
            $newPopUp.fadeIn('fast');
            if ($newPopUp.height() < 25) {
                $newPopUp.height(25);
            }
        }
    })
    .bind("onmouseover", function() { return false; })
    .blur(function() {
        $(".popupToolTip").remove();
        $(this).removeClass('tbError');
        var subId = this.id.substring(0, this.id.lastIndexOf("_"));
        // $("#"+subId+"_ResultDiv").hide().css({marginLeft: $(this).width() + 4 + "px", marginTop: "-5px" }).fadeIn('fast');

    });
});
