﻿
/// <reference name="MicrosoftAjax.js"/>
Type.registerNamespace("TraderMagazine");

TraderMagazine.Imprint = function() {
    TraderMagazine.Imprint.initializeBase(this);




}

TraderMagazine.Imprint.prototype = {
    initialize: function() {
        TraderMagazine.Imprint.callBaseMethod(this, 'initialize');
        this.init();


    },
    /// <summary>
    /// insert Imprint content
    /// </summary>
    initHandler: function() {
        //  $addHandler($get("Teaser_MenuBlog"), "click", MENU.getMainMenuPage);




    },

    /// <summary>
    /// get Imprint page
    /// </summary>
    init: function() {
        TradersMag.WebService.PageService.CreateImprint(this.insertImprintContent, GLOBALS.callError);
    },

    /// <summary>
    /// insert Imprint content
    /// </summary>
    insertImprintContent: function(html) {

    $get("Content").innerHTML = "<div style='padding:10px;background-color:#fff;'>" + html + "</div>";
        PAGE.initHandler();
    },

    /// <summary>
    // editor function : edit text
    /// </summary>
    editImprint: function() {
        var html = $get("ImprintContent").innerHTML;
        var c = "<TEXTAREA style='height:500px' id='ImprintEditor' class='ContactTextBox' name='ImprintEditor'>" + html + "</TEXTAREA>";
        c += "<br><br><a onclick='PAGE.saveImprint()'>Speichern</a>";
        $get("ImprintContent").innerHTML = c;
    },
    /// <summary>
    // editor function : edit text
    /// </summary>
    saveImprint: function() {
        var c = $get("ImprintEditor").value;
        TradersMag.WebService.PageService.SaveImprint(c, PAGE.insertImprintContent, GLOBALS.callError);
    },
    dispose: function() {
        //Add custom dispose actions here
        TraderMagazine.Imprint.callBaseMethod(this, 'dispose');
    }
}
TraderMagazine.Imprint.registerClass('TraderMagazine.Imprint', Sys.Component);

if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
