
FL_URL_MAASWEB='http://www.maas360.com/';
FL_URL_PLATFORM='https://portal.fiberlink.com/';
FL_URL_TRIALS='http://forms.maas360.com/go/fiberlink/30DayTrial-V_Form_WS?userId=guest';
FL_URL_BLOG='http://blog.maas360.com/';
FL_URL_MAGAZINE='http://blooming-mist-21.heroku.com/';
FL_URL_DEMO='http://forms.fiberlink.com/go/fiberlink/demoRequest';
function FL_GlobalHeaderManager()
{
this.Preload=FL_GlobalHeaderManager_Preload;
this.Init=FL_GlobalHeaderManager_Init;
this.AdjustLayout=FL_GlobalHeaderManager_AdjustLayout;
this.siteId=null;
this.campaignId=null;
this.bIsSSL=('https:'==window.location.href.substr(0,6));
this.currentProtocol=(this.bIsSSL)?'https:':'http:';
}
function FL_GlobalHeaderManager_Preload()
{
if(typeof(window.FL_SITE_ID)!='undefined')
{
this.siteId=window.FL_SITE_ID;
}
if(null!==this.siteId)
{
if('MAASWEB'==this.siteId)
{
fl_addStyleSheet(this.currentProtocol+'//content.fiberlink.com/www/globalHeader/FL_GlobalHeader_OpenCms_prepend.css');
}
else if('MAASBLOG'==this.siteId)
{
fl_addStyleSheet(this.currentProtocol+'//content.fiberlink.com/www/globalHeader/FL_GlobalHeader_WordPress_prepend.css');
}
else if('TRIALS'==this.siteId)
{
fl_addStyleSheet(this.currentProtocol+'//content.fiberlink.com/www/globalHeader/FL_GlobalHeader_Trials_prepend.css');
}
fl_addClassToElement(document.body,this.siteId);
}
else
{
document.writeln('<!-- Unable to determine site ID.  No site-specific CSS was loaded. -->');
}
}
function FL_GlobalHeaderManager_Init()
{
var tmpThis=this;
var link=null;
fl_addClassToElement(document.documentElement,'WithGlobalHeader');
fl_addClassToElement(document.body,'WithGlobalHeader');
var tryElem=document.getElementById('GlobalHeader_Link_Try');
var demoElem=document.getElementById('GlobalHeader_Link_Demo');
if('MAASWEB'==this.siteId)
{
if(-1==tryElem.href.indexOf('maassource='))
tryElem.href=fl_addUrlParam(tryElem.href,'maassource','WS');
if(-1==demoElem.href.indexOf('maassource='))
demoElem.href=fl_addUrlParam(demoElem.href,'maassource','WS');
}
else if('MAASBLOG'==this.siteId)
{
if(-1==tryElem.href.indexOf('maassource='))
tryElem.href=fl_addUrlParam(tryElem.href,'maassource','BLOG');
if(-1==demoElem.href.indexOf('maassource='))
demoElem.href=fl_addUrlParam(demoElem.href,'maassource','BLOG');
}
var selectedTabElem=null;
if('MAASBLOG'==this.siteId)
var tabElem=document.getElementById('GlobalHeader_Tab_Blog');
else
var tabElem=document.getElementById('GlobalHeader_Tab_MaasWebsite');
fl_addClassToElement(tabElem,'GlobalHeader_TabWrapper_On');
}
function FL_GlobalHeaderManager_AdjustLayout()
{
if(typeof(fl_isIE)!='undefined'&&fl_isIE())
{
var ghElem=document.getElementById('FL_GlobalHeader');
if(ghElem)
{
if(document.body&&document.body.clientWidth)
ghElem.style.width=document.body.clientWidth+'px';
else if(document.documentElement&&document.documentElement.offsetWidth)
ghElem.style.width=document.documentElement.offsetWidth+'px';
}
}
}
function fl_compareHostname(urlA,urlB)
{
var strHostA;
var strHostB;
if(typeof(urlA)=='object'&&typeof(urlA.href)!='undefined'&&typeof(urlA.hostname)!='undefined')
strHostA=urlA.hostname;
else
strHostA=fl_findHostname(urlA);
if(typeof(urlB)=='object'&&typeof(urlB.href)!='undefined'&&typeof(urlB.hostname)!='undefined')
strHostB=urlB.hostname;
else
strHostB=fl_findHostname(urlB);
if(typeof(strHostA)=='string'&&typeof(strHostB)=='string')
{
strHostA=strHostA.toLowerCase();
strHostB=strHostB.toLowerCase();
}
return(strHostA==strHostB);
}
function fl_findHostname(url)
{
var i;
if((i=url.indexOf('://'))>=0)
{
url=url.substr(i+3);
while('/'==url.charAt(0))
url=url.substr(1);
}
if((i=url.indexOf('/'))>=0)
{
url=url.substr(0,i);
}
return url;
}
function fl_addUrlParam(existingUrl,key,value)
{
var q=(-1==existingUrl.indexOf('?'))?'?':'&';
return existingUrl+q+encodeURIComponent(key)+'='+encodeURIComponent(value);
}
function fl_addStyleSheet(url)
{
document.writeln('<link rel="stylesheet" type="text/css" href="'+url+'" />');
}
