using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Globalization;
using System.Threading;
using System.Reflection;
using System.Resources; 


public partial class System_Settings_BrandingPreview : System.Web.UI.Page
{
    #region VariableDeclaration    
    
    ResourceManager rm;
    int loginEmployeeId;
    CultureInfo ci;
    string strSetAlert;

    #endregion

    #region PageLoad    
    
    protected void Page_Load(object sender, EventArgs e)
    {
        Random rnd = new Random();

        HtmlLink CssLink = new HtmlLink();
        CssLink.Href = "../css/PreviewStyleSheet.css?rnd=" + rnd.NextDouble();
        CssLink.Attributes.Add("Type", "text/css");
        CssLink.Attributes.Add("Rel", "StyleSheet");
        Head1.Controls.Add(CssLink);
        
        
      

        if (Session["Session_ActiveLanguage"] == null)
        {
            string str = "<script language=\"javascript\">";

            str = str + "opener.focus();";
            //str = str + "alert(opener.location+'?fl=1&sid=';";

            str = str + "opener.location.href = opener.location + '?fl=1&sid=" + Session.SessionID + "';";

            str = str + "self.close();";

            str = str + "</script>";


            Response.Write(str);
        }
        else
        {
            lblUser.Text = Session["user"].ToString();
            string source_Language;
            loginEmployeeId = Int32.Parse(Session["EmpAutoID"].ToString());
            source_Language = Session["Session_ActiveLanguage"].ToString();
            rm = new ResourceManager(source_Language, System.Reflection.Assembly.Load("App_GlobalResources"));
            ci = Thread.CurrentThread.CurrentCulture;
            LoadStrings(ci);

        }

        if (!IsPostBack)
        {
            strSetAlert = strSetAlert + "<script language='javascript'>";
            strSetAlert = strSetAlert + "MaxLengthh('" + rm.GetString("Alert_MaximumLengthis", ci) + "');";
            strSetAlert = strSetAlert + "</script>";
            Page.RegisterStartupScript("MaxLengthh", strSetAlert);
        }

    }

    #endregion

    #region UserDefinedFunctions    
    
    //Getting Information from resource file and display it in label

    private void LoadStrings(CultureInfo ci)
    {
        //btn_cancel.Text = rm.GetString("btn_Back", ci);
        //btn_cancel.Text = rm.GetString("btn_Back", ci);
        //lbl_Header.Text = rm.GetString("lbl_leavetype", ci);
        //lbl_LeaveType.Text = rm.GetString("lbl_leavetype", ci);
        //lbl_Des.Text = rm.GetString("LeaveType_LeaveDesc", ci);
        //lbl_Man.Text = rm.GetString("IndicatesMandatoryFields", ci);
        //Req_LeaveType.ErrorMessage = rm.GetString("Validator_LeaveType_LeaveType", ci);
        //RequiredFieldValidator1.ErrorMessage = rm.GetString("Validator_LeaveType_LeaveDescription", ci);
    }

    #endregion
}
