﻿

function PleaseWaitBoxDealerSearch(boxid, boxtitle, boxinfo, boxtop, boxleft) {

		
    this.Id = boxid;
    this.Title = boxtitle;
    this.Info = boxinfo;
    this.Top = boxtop;
    this.Left = boxleft;


    this.Hide = function() {
        var box = document.getElementById(this.Id);
        if (box != null) {
            box.style.display = "none";
            //Page_Overlay_hide();
        }
    }

    this.Show = function() {
        var box = document.getElementById(this.Id);
        if (box != null) {
            box.style.display = "block";
            //Page_Overlay_show();
        }

    }

    this.CreateBoxHtml = function() {


    	var addstyleaddributes = "";
    	var tempaddstyleaddtributes = "";

    	if (this.Top != null && this.Top != "") {
    		tempaddstyleaddtributes = tempaddstyleaddtributes + "top:" + this.Top + ";";
    	}

    	if (this.Left != null && this.Left != "") {
    		tempaddstyleaddtributes = tempaddstyleaddtributes + "left:" + this.Left + ";";
    	}

    	addstyleaddributes = "style=\"display:none;" + tempaddstyleaddtributes + "\"";

    	$('#' + this.Id).css("display", "block");
    	$('#' + this.Id).css("top", this.Top)
    	$('#' + this.Id).css("left", this.Left); ;
    	$('#' + this.Id).html("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"pleasewaitboxraster\"> " +
                        "    <tr> " +
                        "        <td> " +
                        "            <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"> " +
                        "                <tr> " +
                        "                    <td><div class=\"pleasewaitboxheader\">&nbsp;</div></td> " +
                        "                </tr> " +
                        "                <tr> " +
                        "                    <td><div class=\"pleasewaitboxheader\">" + this.Title + "</div></td> " +
                        "                </tr> " +
                        "                <tr> " +
                        "                    <td><div class=\"pleasewaitboxinfotext\">&nbsp;</div></td> " +
                        "                </tr> " +
                        "                <tr> " +
                        "                    <td><div class=\"pleasewaitboxinfotext\">" + this.Info + "</div></td> " +
                        "                </tr> " +
                        "            </table> " +
                        "        </td> " +
                        "        <td align=\"right\" valign=\"top\"><div class=\"ajaxloader\"></td> " +
                        "    </tr> " +
                        "</table> " );
    	
    }
}
