﻿// JScript File
var RelPath = document.location.pathname.substring("/",document.location.pathname.lastIndexOf("/"));

function ChangeStyle()
{
    // StyleManager for locale styles
    
    
    if (!document.styleSheets) return;

    if (document.styleSheets[0].rules) 
       {
            //Should be changed to relative path.
            
            if (document.URL.match("Admin.aspx"))
            {
                document.styleSheets[0].rules[24].style.backgroundImage = "url(" + RelPath + "/Images/wistmovert.gif)";
            }
            else
            {
                document.styleSheets[0].rules[24].style.backgroundImage = "url(" + RelPath + "/Images/wistmoverttexten.gif)";
            }    
       }
    else if (document.styleSheets[0].cssRules)
       {
            //Should be changed to relative path.
            if (document.URL.match("Admin.aspx"))
            {
                document.styleSheets[0].cssRules[24].style.backgroundImage = "url(" + RelPath + "/Images/wistmovert.gif)";
            }
            else
            {
                document.styleSheets[0].cssRules[24].style.backgroundImage = "url(" + RelPath + "/Images/wistmoverttexten.gif)";
            }                  
       }
                         
}

function ChangeFlags(x)
{
    if (document.getElementById("Localizations"))
    {   
        var CountrCode = x;
        var dkflag = document.images(0);
        var enflag = document.images(1);
        
        if (x == "dk")
        {
            document.images(0).src = RelPath + "/Images/dk.gif";
            document.images(1).src = RelPath + "/Images/enfade.gif";
        }
        else if (x == "en")
        {
            document.images(0).src = RelPath + "/Images/dkfade.gif";
            document.images(1).src = RelPath + "/Images/en.gif";    
        }    
    }
}

function PublishUsername(x)
{
    var User;
    var Logout;
    if (document.getElementById)
    {
        User = document.getElementById('user');
        User.innerHtml = "&nbsp;";
        User.innerText = x;
        //Logout = document.getElementById('login');
        //Logout.innerHTML = "<a href=\"" + RelPath + "/UsingMasterTemplate.aspx?id=9999\">Logout</a>";
        
    }

}

function UnPublishUsername()
{
    var User;
    var Login;
    if (document.getElementById)
    {
        User = document.getElementById('user');
        User.innerHtml = "&nbsp;";
        //Login = document.getElementById('login');
        //Login.innerHTML = "<a href=\"" + RelPath + "/Login.aspx\">Login</a>";
        
    }

}

function AdminHeight()
{
    if (document.URL.match("Admin.aspx"))
    {
       if (document.styleSheets[0].rules) 
       {
            //Should be changed to relative path.
            document.styleSheets[0].rules[23].style.height = "750px";
            document.styleSheets[0].rules[24].style.backgroundImage = "url(" + RelPath + "/Images/wistmovert.gif)";
       }
       else if (document.styleSheets[0].cssRules)
       {
            //Should be changed to relative path.
            document.styleSheets[0].cssRules[23].style.height = "750px";
            document.styleSheets[0].cssRules[24].style.backgroundImage = "url(" + RelPath + "/Images/wistmovert.gif)";                 
       }  
     }
     else
     {
        if (document.styleSheets[0].rules) 
       {
            //Should be changed to relative path.
            document.styleSheets[0].rules[24].style.height = "470px";
       }
       else if (document.styleSheets[0].cssRules)
       {
            //Should be changed to relative path.
            document.styleSheets[0].cssRules[24].style.height = "470px";                 
       }  
         
     }    
}         
         
         
         
         
         
         
         
         
         
         
