/* START SSN.Web.client_scripts.ssncontrols.ssnmodaldialog.js */
var m_downloadCss = false;

function GetSsnWindow(name) {
    if (getSSNWins() == null) return null;
    for (var i = 0; i < getSSNWins().length; i++)
        if (getSSNWins()[i]._name == name)
        return getSSNWins()[i];

    return null;
}

window.ssnopenWin = function(url, width, height, title, returnFunction, name) {
    //default value is true, the sizes includes frames sizes.
    return window.ssnopenWin(url, width, height, title, returnFunction, name, true);
}
window.ssn_isSafari = function() {
    var output = false;
    var html = document.getElementsByTagName("html")[0];
    if (html && html.className && html.className.indexOf("webkit") > -1) {
        output = true;
    }
    return output;
}
window.ssn_isFirefox = function() {
    var output = false;
    var html = document.getElementsByTagName("html")[0];
    if (html && html.className && html.className.indexOf("gecko") > -1) {
        output = true;
    }
    return output;
}
window.ssnopenWin = function(url, width, height, title, returnFunction, name, includeFramesDelta, cssClass) {
    var ssnWin = new SsnModalDialog(url, name);
    ssnWin.set_deltaIncluded(includeFramesDelta);
    ssnWin._createUI();
    ssnWin.set_url(url);
    ssnWin.set_visibleStatusbar(false);
    ssnWin.set_size(width, height);
    ssnWin.set_title(title);
    ssnWin.add_close(returnFunction);

    if (cssClass != null) {
        ssnWin._popupElement.className += (" " + cssClass);
    }
    ssnWin.center();
    ssnWin.set_overlay(true);
    return ssnWin;
}
function getMainWindow() {
    try {
        /*we execute this to test if we are hosted in a  frame 
        on another domain*/
        var test = parent.document;
        /*if everything is ok then this line should be executed with no problems*/
        return window.parent;
    } catch (ex) {
        return window;
    }
}
function getTopMainWindow() {
    try {
        /*we execute this to test if we are hosted in a  frame 
        on another domain*/
        var test = parent.document;
        /*if everything is ok then this line should be executed with no problems*/
        return window.top;
    } catch (ex) {
        return window;
    }
}
function getSSNWins() {
    try {
        return parent.ssnWins;
    }
    catch (ex) {
        //We are probably under a frame which is being hosted on another domain
        //thus, crossdomain calls are not allowed
        return window.ssnWins;
    }
}
function setSSNWins(val) {
    try {
        parent.ssnWins = val;
    }
    catch (ex) {
        //We are probably under a frame which is being hosted on another domain
        //thus, crossdomain calls are not allowed
        window.ssnWins = val;
    }
}

function SsnModalDialog(url, name) {
    this._index = 0;
    if (getSSNWins() == null)
        setSSNWins(new Array());
    else
        this._index = getSSNWins().length;

    getSSNWins()[this._index] = this;

    this.GetWindowManager = this.get_windowManager;
    this.BrowserWindow = window;

    // Html
    this._contentElement = null;
    this._contentCell = null;
    this._bodyLeftCell = null;
    this._bodyRightCell = null;
    this._titleElement = null;
    this._titleCell = null;
    this._titlebarElement = null;
    this._iframe = null;
    this._tableElement = null;
    this._popupElement = null;
    this._topResizer = null;
    this._iconElement = null;
    this._pageMask = null;
    this._buttonsElement = null;
    this._footerElement = null;

    // variables
    this._left = "";
    this._top = "";
    this._title = "";
    this._width = 300;
    this._height = 300;
    this._navigateUrl = url;
    this._zIndex = 2000;
    this._parameters = null;
    this._name = name;
    this._visibleStatusbar = true;
    this._isDeltaIncluded = true;

    // functions
    this._onClose = null;
    this.window = window;
}
SsnModalDialog.prototype._includeCss = function() {

}
SsnModalDialog.prototype._createUI = function() {
    if (!this._popupElement) {
        this._includeCss();
        this._zIndex = this._getNewZIndex();

        var rootDiv = getMainWindow().document.createElement("div");
        rootDiv.className = "radwindow radwindow_SSN-Window normalwindow";
        rootDiv.id = "dialog_" + this._index;
        rootDiv.style.zIndex = this._zIndex;

        var tableElement = this._createDefaultTable();
        tableElement.style.borderCollapse = "collapse";
        tableElement.cellSpacing = "0";
        tableElement.cellPadding = "0";
        this._tableElement = tableElement;
        this._tbodyElement = tableElement.firstChild;

        var classNames = ["corner topleft", "titlebar", "corner topright",
                                  "corner bodyleft", "windowcontent", "corner bodyright",
                                  "corner bodyleft", "statusbar", "corner bodyright",
                                  "corner footerleft", "footercenter", "corner footerright"];

        var rowClassNames = ["titlerow", "contentrow", "statusbarrow", "footerrow"];

        var index = 0;
        for (var i = 0; i < 4; i++) {
            var row = this._createDefaultRow(this._tbodyElement);
            row.className = rowClassNames[i];

            for (var j = 1; j <= 3; j++) {
                var cell = this._createDefaultCell(row);
                cell.className = classNames[index];
                index++;
            }
        }

        // title element
        var titleCell = this._tbodyElement.rows[0].cells[1];
        this._titleCell = titleCell;

        // resizer
        var topResizer = getMainWindow().document.createElement("div");
        topResizer.className = "topresize";
        this._topResizer = topResizer;
        this._titleCell.appendChild(this._topResizer);

        // titlebar element
        var titlebarTable = this._createDefaultTable();
        this._createDefaultRow(titlebarTable.firstChild);
        titlebarTable.className = "titlebarcontrols";
        this._titlebarElement = titlebarTable;
        this._titleCell.appendChild(this._titlebarElement);

        // icon
        var windowIcon = this._getIconElement();
        var iconCell = this._createDefaultCell(titlebarTable.firstChild.rows[0]);
        iconCell.className = "iconCell";
        /*iconCell.style.width = "15px";*/
        iconCell.appendChild(windowIcon);

        // title text
        var titleElement = this._getTitleElement();
        var titleCell = this._createDefaultCell(titlebarTable.firstChild.rows[0]);
        titleCell.appendChild(titleElement);
        this.set_title(this._title);

        // content cell
        var contentCell = this._tbodyElement.rows[1].cells[1];
        contentCell.vAlign = "top";
        this._contentCell = contentCell;

        //left and right frames cells... to get frameDelta
        var bodyLeftCell = this._tbodyElement.rows[1].cells[0];
        this._bodyLeftCell = bodyLeftCell;
        var bodyRightCell = this._tbodyElement.rows[1].cells[2];
        this._bodyRightCell = bodyRightCell;

        // iframe
        var childFrame = (document.all) ? getMainWindow().document.createElement("<iframe name='" + name + "'>") : getMainWindow().document.createElement("iframe");
        var divIframe = getMainWindow().document.createElement("div");

        //Create statusbar
        var stastusbarTable = this._createDefaultTable();
        stastusbarTable.style.width = "100%";
        this._statusCell = tableElement.rows[2].cells[1];
        this._statusCell.appendChild(stastusbarTable);
        this._createDefaultRow(stastusbarTable.firstChild);

        //Create statusbar message cell
        var statusMessageCell = this._createDefaultCell(stastusbarTable.firstChild.rows[0]);
        statusMessageCell.style.width = "100%";
        var messageInput = this._getStatusMessageElement();
        statusMessageCell.appendChild(messageInput);

        //Create statusbar resizer        
        var bottomResizerCell = this._createDefaultCell(stastusbarTable.firstChild.rows[0]);
        bottomResizerCell.style.width = "15px";
        var resizeDiv = getMainWindow().document.createElement('DIV');
        bottomResizerCell.appendChild(resizeDiv);
        this._bottomResizer = resizeDiv;

        divIframe.style.width = "100%";
        divIframe.style.height = "100%";

        childFrame.name = name;
        childFrame.allowTransparency = "true";
        childFrame.scrolling = "no";
        childFrame.style.border = "0px";
        childFrame.frameBorder = "0";
        this._iframe = childFrame;

        divIframe.appendChild(this._iframe);
        this._contentCell.appendChild(divIframe);

        $addHandler(this._iframe, "load", Function.createDelegate(this, this._onWindowUrlChanged));

        // footer
        var footer = this._tbodyElement.rows[3];
        this._footerElement = footer;

        this._popupElement = rootDiv;
        this._popupElement.appendChild(this._tableElement);
        this._addDialogToDocument(this._popupElement);

        this.set_size(this._width, this._height);

        //Create a back reference to parent RadWindow
        this._createBackReference();
    }
}
SsnModalDialog.prototype.set_visibleStatusbar = function(value) {
    if (this._statusCell) {
        var statusHeight = this._statusCell.clientHeight;
        this._visibleStatusbar = value;
        this._statusCell.parentNode.style.display = value ? "" : "none";
        this.set_height(this._height - statusHeight);
    }
}
SsnModalDialog.prototype.get_visibleStatusbar = function() {
    if (this._statusCell) {
        return this._visibleStatusbar;
    }
}
SsnModalDialog.prototype._getNewZIndex = function() {
    return this._zIndex + 3 * this._index;
}
SsnModalDialog.prototype._addDialogToDocument = function(obj) {
    var form = getMainWindow().document.forms[0];
    form.insertBefore(obj, form.firstChild);
}
SsnModalDialog.prototype._getIconElement = function() {
    if (this._iconElement == null) {
        var iconElement = getMainWindow().document.createElement("a");
        iconElement.className = "windowicon";
        this._iconElement = iconElement;
    }
    return this._iconElement;
}
SsnModalDialog.prototype._getTitleElement = function() {
    if (!this._titleElement) {
        this._titleElement = getMainWindow().document.createElement("em");
    }
    return this._titleElement;
}
SsnModalDialog.prototype._getStatusMessageElement = function() {
    if (null == this._statusMessageElement) {
        var el = getMainWindow().document.createElement("INPUT");
        el.readOnly = "readonly";
        el.setAttribute("unselectable", "on");
        this._statusMessageElement = el;
    }
    return this._statusMessageElement;
}
SsnModalDialog.prototype._onWindowUrlChanging = function() {
    //Show the loading sign
    var input = this._getStatusMessageElement();
    if (input) Sys.UI.DomElement.addCssClass(input, "loading");
}
SsnModalDialog.prototype._onWindowUrlChanged = function() {
    var input = this._getStatusMessageElement();
    if (input) {
        //Hide the loading sign
        Sys.UI.DomElement.removeCssClass(input, "loading");
    }
    //Set title		  
    try {
        if (this._iframe.contentWindow.document.title) this.set_title(this._iframe.contentWindow.document.title);
    } catch (e) { };
    var objHtml = this._iframe.contentWindow.document.getElementsByTagName('html')[0];
    objHtml.className += " ssnwin";
}
SsnModalDialog.prototype._createDefaultTable = function() {
    var tableElement = getMainWindow().document.createElement("table");
    tableElement.align = "left";
    var tBody = getMainWindow().document.createElement("tbody");
    tableElement.appendChild(tBody);
    return tableElement;
}
SsnModalDialog.prototype._createDefaultRow = function(parentElement) {
    var row = getMainWindow().document.createElement("tr");
    parentElement.appendChild(row);
    return row;
}
SsnModalDialog.prototype._createDefaultCell = function(parentElement) {
    var cell = getMainWindow().document.createElement("td");
    parentElement.appendChild(cell);
    return cell;
}

SsnModalDialog.prototype.fitToContent = function(doc) {
    var w, h;
    if (doc.documentElement && (doc.documentElement.scrollWidth || doc.documentElement.scrollHeight)) {
        w = doc.documentElement.scrollWidth;
        h = doc.documentElement.scrollHeight;
    } else if (getMainWindow().document.body) {
        w = doc.body.scrollWidth;
        h = doc.body.scrollHeight;
    }
    this.set_size(w, h);
    this.center();
}
SsnModalDialog.prototype.set_url = function(url) {
    if (this._iframe == null) return;
    this._onWindowUrlChanging();
    this._iframe.src = url;
}
SsnModalDialog.prototype.set_size = function(width, height) {
    if (this._popupElement != null) {
        this.set_width(width);
        this.set_height(height);
    }
}
SsnModalDialog.prototype.set_width = function(value) {
    if (value == null) return;
    var contentW = value;
    var frameW = value;
    var isDeltaIncluded = this.get_deltaIncluded();
    if (isDeltaIncluded) {
        contentW = parseInt(contentW) - parseInt(this.get_width_delta());
    }
    else {
        frameW = parseInt(frameW) + parseInt(this.get_width_delta());
    }

    this._width = frameW;
    var isFireFox = this.window.ssn_isFirefox && this.window.ssn_isFirefox();
    this._popupElement.style.width = frameW + (isFireFox ? 0 : 2) + "px";
    //    this._popupElement.style.width = frameW + (this.window.ssn_isFirefox() ? 0 : 2) + "px";
    this._iframe.style.width = contentW + "px";
    //Find Out object that holds the 24 witdh 24px width//this._contentCell.clientWidth + (detectBrowser() == "ff" ? 0 : 0) + "px";
}
SsnModalDialog.prototype.set_height = function(value) {
    if (value == null) return;
    var contentH = value;
    var frameH = value;
    var isDeltaIncluded = this.get_deltaIncluded();
    if (isDeltaIncluded) {
        contentH = parseInt(contentH) - parseInt(this.get_height_delta());
    }
    else {
        frameH = parseInt(frameH) + parseInt(this.get_height_delta());
    }
    this._height = frameH;
    this._popupElement.style.height = frameH + "px";
    this._iframe.style.height = contentH + "px";
}
SsnModalDialog.prototype.set_overlay = function(value) {
    if (value) {
        var pageMask = getMainWindow().document.createElement("div");
        pageMask.id = "pageMask_" + this._index;
        pageMask.style.width = Viewport.getMainScrollWidth() + "px";
        pageMask.style.height = Viewport.getMainScrollHeigth() + "px";
        pageMask.style.zIndex = this._zIndex++;
        pageMask.style.display = "block";

        pageMask.className = "modalDialogPageMask";

        this._popupElement.style.zIndex = this._zIndex;
        this._pageMask = pageMask;
        this._addDialogToDocument(this._pageMask);
    }
    else {
        this._pageMask.parentNode.removeChild(this._pageMask);
        this._pageMask = null;
    }
}
SsnModalDialog.prototype.center = function() {
    this.centerOnX(-1);
}
SsnModalDialog.prototype.centerOnX = function(top) {
    if (this._popupElement == null) return;
    var topValue = top;

    var pageWidth = Viewport.getMainWidth();
    var pageHeight = Viewport.getMainHeight();
    if (top == -1) {
        topValue = (pageHeight - this._height) / 3;
        if (topValue < 0) {
            topValue = 0;
            //            this._popupElement.style.cssFloat = "left";
            //            this._popupElement.style.position = "absolute";
            Sys.UI.DomElement.addCssClass(this._popupElement, "moveWin");
        }
        else {
            //            this._popupElement.style.position = "fixed";
            Sys.UI.DomElement.addCssClass(this._popupElement, "staticWin");
        }

        topValue += "px";
    }
    this._popupElement.style.left = (pageWidth - this._width) / 2 + "px";

    this._popupElement.style.top = topValue;
}
SsnModalDialog.prototype.close = function() {

    this._popupElement.style.display = "none";
    this._pageMask.style.display = "none";

    this._pageMask.parentNode.removeChild(this._pageMask);
    this._popupElement.parentNode.removeChild(this._popupElement);

    if (this._onClose != null) this._onClose(this, this._parameters);
    // Removing the ssnwindows
    var newssnWins = new Array();
    for (var i = 0; i < getSSNWins().length; i++) {
        if (getSSNWins()[i]._name != this._name) {
            newssnWins[newssnWins.length] = getSSNWins()[i];
        }
    }
    setSSNWins(newssnWins);
}
SsnModalDialog.prototype.set_title = function(text) {
    if (this._titleElement == null) return;
    this._title = text;
    this._titleElement.innerHTML = this._title;
}
//SsnModalDialog methods
SsnModalDialog.prototype.add_close = function(returnFunction) {
    if (returnFunction != null) this._onClose = returnFunction;
}
//UPDATE 040708
SsnModalDialog.prototype.set_deltaIncluded = function(value) {
    this._isDeltaIncluded = value;
}
SsnModalDialog.prototype.get_deltaIncluded = function(value) {
    return this._isDeltaIncluded;
}
//Methods to get difference of sizes between content and frame
SsnModalDialog.prototype.get_width_delta = function() {
    return (this._bodyLeftCell.clientWidth + this._bodyRightCell.clientWidth);
}
SsnModalDialog.prototype.get_height_delta = function() {
    var statusH = 0;
    if (this.get_visibleStatusbar()) {
        statusH = this._statusCell.clientHeight
    }
    return (this._titleCell.clientHeight + statusH + this._footerElement.clientHeight);
}
SsnModalDialog.prototype.get_top = function() {
    return this._popupElement.style.top;
}
SsnModalDialog.prototype.get_windowManager = function() {
    return this._windowManager;
}
SsnModalDialog.prototype.set_windowManager = function(manager) {
    this._windowManager = manager;
}
SsnModalDialog.prototype._createBackReference = function() {
    var theWnd = this;

    if (!theWnd.Argument) theWnd.Argument = {};

    var oIframe = this._iframe;

    try {
        oIframe.radWindow = theWnd;

        if (oIframe.contentWindow != null) {
            oIframe.contentWindow.radWindow = theWnd;
        }
    }
    catch (e) { }
}

function enableButton(isEnable) {
    this.isEnable = isEnable;
    if (isEnable) {
        if (this._url) $(this).attr("href", this._url);
        this.className = 'ssnwindowbutton btndef btn';
    }
    else {
        if (this.href) this._url = this.href;
        $(this).removeAttr("href");
        this.className = 'ssnwindowbutton btndisabled btn';
    }
}

$(document).ready(function() {
    $(".btndisabled").each(
        function() {
            this.enable = enableButton;
            this.enable(false);
        }
    )
});

function Viewport() {
}

Viewport.getMainWidth = function() {
    var x;
    if (getTopMainWindow().innerHeight) {
        x = getTopMainWindow().innerWidth;
    } else if (getMainWindow().document.documentElement && getMainWindow().document.documentElement.clientHeight) {
        x = getMainWindow().document.documentElement.clientWidth;
    } else if (getMainWindow().document.body) {
        x = getMainWindow().document.body.clientWidth;
    }
    return x;
}
Viewport.getMainHeight = function() {
    var y;
    if (getTopMainWindow().innerHeight) {
        y = getTopMainWindow().innerHeight;
    } else if (getMainWindow().document.documentElement && getMainWindow().document.documentElement.clientHeight) {
        y = getMainWindow().document.documentElement.clientHeight;
    } else if (getMainWindow().document.body) {
        y = getMainWindow().document.body.clientHeight;
    }
    return y;
}

Viewport.getWidth = function() {
    var x;
    if (self.innerHeight) {
        x = self.innerWidth;
    } else if (document.documentElement && document.documentElement.clientWidth) {
        x = document.documentElement.clientWidth;
    } else if (document.body) {
        x = document.body.clientWidth;
    }
    return x;
}

Viewport.getHeight = function() {
    var y;
    if (self.innerHeight) {
        y = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        y = document.documentElement.clientHeight;
    } else if (document.body) {
        y = document.body.clientHeight;
    }
    return y;
}

Viewport.getScrollLeft = function() {
    var x;
    if (self.pageXOffset || self.pageYOffset) {
        x = self.pageXOffset;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        x = document.documentElement.scrollLeft;
    } else if (document.body) {
        x = document.body.scrollLeft;
    }
    return x;
}

Viewport.getScrollTop = function() {
    var y;
    if (self.pageXOffset || self.pageYOffset) {
        y = self.pageYOffset;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        y = document.documentElement.scrollTop;
    } else if (document.body) {
        y = document.body.scrollTop;
    }
    return y;
}

Viewport.getScrollWidth = function() {
    var x;
    if (document.documentElement && (document.documentElement.scrollWidth || document.documentElement.scrollHeight)) {
        x = document.documentElement.scrollWidth;
    } else if (document.body) {
        x = document.body.scrollWidth;
    }
    return x;
}

Viewport.getScrollHeight = function() {
    var y;
    if (document.documentElement && (document.documentElement.scrollWidth || document.documentElement.scrollHeight)) {
        y = document.documentElement.scrollHeight;
    } else if (document.body) {
        y = document.body.scrollHeight;
    }
    return y;
}

Viewport.getMainScrollHeigth = function() {
    if (document.all)
        return getMainWindow().window.document.body.clientHeight;

    return getMainWindow().document.body.scrollHeight;
}

Viewport.getMainScrollWidth = function() {
    if (document.allE)
        return getMainWindow().window.document.body.clientWidth;

    return getMainWindow().document.body.scrollWidth;
}
/* END SSN.Web.client_scripts.ssncontrols.ssnmodaldialog.js */
/* START SSN.Web.client_scripts.ssn.ssnprint.js */
/// <reference name="MicrosoftAjax.js"/>
/// <reference path='~/client_scripts/ClientFoundation/Frameworks/JQuery/jquery.intellisense.js' />

var ssnprint_arealist = new Array();
var ssnprint_doc = null;
var ssnprint_iframe = null;
var ssnprint_button_text = '';
var ssnprint_button_classname = 'ssnPrintButton';
var button = null;

Type.registerNamespace("SANSIRNET.Controls");

SANSIRNET.Controls.SSNPrint = function(element) {
    SANSIRNET.Controls.SSNPrint.initializeBase(this, [element]);
    this._ssnprint_button_text = null;
}
SANSIRNET.Controls.SSNPrint.prototype =
{
    initialize: function() {
        SANSIRNET.Controls.SSNPrint.callBaseMethod(this, "initialize");


        this._ssnprint_scanarea(this._ssnprint_button_text);
    },

    dispose: function() {
        SANSIRNET.Controls.SSNPrint.callBaseMethod(this, 'dispose');
    },
    _ssnprint_clear: function() {
        ssnprint_append_count = 0;
        $('iframe#ssniframe_printarea').remove();

        var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';

        iframe = document.createElement('IFRAME');

        $(iframe).attr({ style: iframeStyle,
            id: 'ssniframe_printarea'
        });
        document.body.appendChild(iframe);
        doc = iframe.contentWindow.document;
        $(document).find('link')
                    .filter(function() {
                        return $(this).attr('rel').toLowerCase() == 'stylesheet';
                    })
                    .each(function() {
                        doc.write('<link type="text/css" rel="stylesheet" href="' + $(this).attr("href") + '" >');
                    });

        doc.write('<table><tr>');
    },
    _ssnprint_append: function(val) {
        doc.write('<td height="' + val.height() + '" width="' + val.width() + '"'
            + ' style="vertical-align: top;">');
        doc.write(val.html());
        doc.write('</td>');
    },

    _ssnprint_print: function() {
        var print = this;
        // re-create a iframe for printarea
        this._ssnprint_clear();

        // insert printarea from page into the printable frame.
        jQuery.each(ssnprint_arealist, function(i, val) {
            print._ssnprint_append(val);
        });

        // end
        doc.write('</table></tr>');
        doc.close();

        // Print out
        var frameWindow = iframe.contentWindow;
        frameWindow.close();
        frameWindow.focus();
        frameWindow.print();
    },

    _ssnprint_button: function(where, pos) {
        where = $('#' + where);
        // check if theres not space for a button on this pane
        if (where == null || where.width() == 0) {
            // check if theres a pane before this one, and add the button there.
            if (pos > 0) {
                pos = pos - 1;
                this._ssnprint_button(ssnprint_arealist[pos].attr('id'), pos);
            }
        } else {

            var print = this;

            // Get info about the pane
            var where_top = where.position().top;
            var where_left = where.position().left;
            var where_width = where.width();

            // Create Button
            where.before('<div id="ssnprint_button" class="' + ssnprint_button_classname + '">' + ssnprint_button_text + '</div>');
            button = $('#ssnprint_button');

            // add onclick
            $('#ssnprint_button').click(function(e) {
                print._ssnprint_print();
            });

            // if position is not absolute, create a div on top of every area
            if (button.css("position") != "absolute") {

                var newdiv = null;
                jQuery.each(ssnprint_arealist, function(i, val) {
                    newdiv = document.createElement('DIV');
                    $(newdiv).css({ 'height': button.height() + "px", 'width': '100%', 'text-align': 'right' });
                    val.before(newdiv);
                });
                // put the button in the last div
                $(newdiv).append(button);
            } else {
                // Fix Top Position
                var button_top = button.position().top;
                button.css('top', (button_top + where_top + 'px'));
                // Fix Left Position
                var button_left = button.position().left;
                var button_width = button.width();
                button.css('left', (button_left + where_left + where_width - button_width) + 'px');
            }
        }
    },

    _ssnprint_scanarea: function(text) {
        ssnprint_button_text = text;
        var curr = null;
        // Find all printarea classes
        var i = 0;
        $('.ssnPrintArea').each(function() {
            curr = $(this);
            ssnprint_arealist[i] = curr;
            i++;
        });

        // If no button is in the skin
        if ($(".ssnPrintButton").length == 0) {
            // add a button to the last area found.
            if (curr != null) this._ssnprint_button(curr.attr('id'), i);
        }
    }
}

SANSIRNET.Controls.SSNPrint.registerClass('SANSIRNET.Controls.SSNPrint', Sys.UI.Control);
if (typeof (Sys) != 'undefined') {
    Sys.Application.notifyScriptLoaded();
}
/* END SSN.Web.client_scripts.ssn.ssnprint.js */
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {if(!$get('_ssnScriptManager_HiddenField')) return; $get('_ssnScriptManager_HiddenField').value += ';;SSN.Web:en-US:433d3685-8a0d-41bd-a3d4-56235369ec09:5f05213e:95e58aa2';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
