﻿///
function AboutPage() {
    var AboutObject = get('AboutLink');
    var HistoryObject = get('HistoryLink');
    if (GetQueryVariable('page') == 'About'){
        if ( HistoryObject != null) {
            AboutObject.className = 'navbarLinkSelected';
            HistoryObject.className = 'navbarLink';
        };
    }
    else if (GetQueryVariable('page') == 'History'){
        if ( AboutObject != null) {
            AboutObject.className = 'navbarLink';
            HistoryObject.className = 'navbarLinkSelected';
        };
    }
    else if (GetQueryVariable('page') == null){
        AboutObject.className = 'navbarLinkSelected';
        HistoryObject.className = 'navbarLink';
    }
};

//Show default PopUp
function ShowMainPopUp(height, width, url){
 
    mainpopup.SetSize(width,height);
    mainpopup.RefreshContentUrl();
    mainpopup.SetContentUrl(url);
    mainpopup.UpdatePosition();
    mainpopup.Show();
};

//Show Lightbox
function ShowLightBox(url){
    LightBox.RefreshContentUrl();
    LightBox.SetContentUrl('lightbox.aspx?emp=' + url);
    LightBox.UpdatePosition();
    LightBox.Show();
};

//Show Lightbox
function ShowLightBox2(url) {
    LightBox.RefreshContentUrl();
    LightBox.SetContentUrl('lightbox2.aspx?emp=' + url);
    LightBox.UpdatePosition();
    LightBox.Show();
};

//Show Lightbox
function ShowLightBox6(url) {
    LightBox.RefreshContentUrl();
    LightBox.SetContentUrl('lightbox3.aspx?emp=' + url);
    LightBox.UpdatePosition();
    LightBox.Show();
};

//Show Lightbox
function ShowSalesListLightBox(url){
    LightBox.RefreshContentUrl();
    LightBox.SetContentUrl('saleslistLightBox.aspx?id=' + url);
    LightBox.UpdatePosition();
    LightBox.Show();
};

//Show Lightbox
function ShowFooterTextLightBox(url){
    footerpopup.RefreshContentUrl();
    footerpopup.SetContentUrl('cms/footerEdit.aspx?Page=' + url);
    footerpopup.UpdatePosition();
    footerpopup.Show();
};

function GetQueryVariable( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function get(elmnt) {
    return document.getElementById(elmnt); 
}