community_links.sort (function () {return 0.5 - Math.random ();});
servermod_links.sort (function () {return 0.5 - Math.random ();});
clan_links.sort (function () {return 0.5 - Math.random ();});
var bMayClose = true;
var bMayOpen = true;
function Show_fl_community_HeadbarLinks (bUseDynBar)
{
if (bUseDynBar)
{
var curr_domain = document.domain, banned = false, ban_id = -1;
if (curr_domain.indexOf ("www.") === 0)
{
curr_domain = curr_domain.substring (4);
}
for (var i = 0; i < banned_domains.length; i++)
{
if (banned_domains[i] === curr_domain)
{
ban_id = i;
banned = true;
break;
}
}
if (!banned)
{
var index_before, index_before2;
// 2 community links
var index = Math.floor (Math.random () * community_links.length);
document.write ("" + community_links[index].name + "   ");
index_before = index;
while (index == index_before)
{
index = Math.floor (Math.random () * community_links.length);
}
document.write ("" + community_links[index].name + " ");
document.write (" || ");
// 3 servermod links
index = Math.floor (Math.random () * servermod_links.length);
document.write ("" + servermod_links[index].name + "   ");
index_before = index;
while (index == index_before)
{
index = Math.floor (Math.random () * servermod_links.length);
}
document.write ("" + servermod_links[index].name + "   ");
index_before2 = index;
while (index == index_before || index == index_before2)
{
index = Math.floor (Math.random () * servermod_links.length);
}
document.write ("" + servermod_links[index].name + "");
}
else
{
if (temp_banned_domains[ban_id])
{
document.write ("THIS WEBSITE/SERVER/CLAN HAS BEEN TEMPORARILY BANNED FROM THE COMMUNITY NETWORK");
}
else
{
document.write ("THIS WEBSITE/SERVER/CLAN HAS BEEN BANNED FROM THE COMMUNITY NETWORK");
}
if (ban_reasons[ban_id] != "")
{
document.write (" " + ban_reasons[ban_id] + "");
}
}
}
else
{
document.write ("
");
}
}
function Show_fl_community_PopupLinks (color)
{
document.write ("");
if (color === "brightblue")
{
document.write ("");
}
else if (color === "darkblue")
{
document.write ("");
}
else if (color === "yellow")
{
document.write ("");
}
document.write ("| General/Fansite Links | Server/Mod Links | Clan Links |
");
var index = 0;
var max_servermod = 12;
var max_clan = 3;
var max_community = 6;
while ((index < servermod_links.length && index < max_servermod + 1) || (index < clan_links.length && index < max_clan + 1) || (index < community_links.length && index < max_community + 1))
{
document.write ("| ");
if (index < community_links.length && index < max_community)
{
document.write ("" + community_links[index].name + "");
}
else if (index < community_links.length && index < max_community + 1)
{
document.write ("See more...");
}
document.write (" | ");
if (index < servermod_links.length && index < max_servermod)
{
document.write ("" + servermod_links[index].name + "");
}
else if (index < servermod_links.length && index < max_servermod + 1)
{
document.write ("See more...");
}
document.write (" | ");
if (index < clan_links.length && index < max_clan)
{
document.write ("" + clan_links[index].name + "");
}
else if (index < clan_links.length && index < max_clan + 1)
{
document.write ("See more...");
}
document.write (" |
");
index++;
}
document.write ("| Add your Freelancer site to the Community Network! |
");
document.write ("
");
}
function Show_fl_community_Popup (element)
{
bMayClose = false;
bMayOpen = true;
var curr_domain = document.domain;
if (curr_domain.indexOf ("www.") === 0)
{
curr_domain = curr_domain.substring (4);
}
for (var i = 0; i < banned_domains.length; i++)
{
if (banned_domains[i] == curr_domain)
{
return;
}
}
hp = document.getElementById ("fl_community_hoverpopup");
// Set position of hover-over popup
hp.style.top = findPosY (element) + 20 + "px";
hp.style.left = findPosX (element) + 0 + "px";
setTimeout ("_Show_fl_community_Popup()", 200);
}
function _Show_fl_community_Popup ()
{
if (bMayOpen)
{
// Set popup to visible
hp.style.visibility="Visible";
}
}
function Enter_fl_community_Menu ()
{
bMayClose = false;
}
function Hide_fl_community_Popup ()
{
bMayClose = true;
bMayOpen = false;
setTimeout ("_Hide_fl_community_Popup()", 200);
}
function _Hide_fl_community_Popup ()
{
if (bMayClose)
{
hp = document.getElementById ("fl_community_hoverpopup");
hp.style.visibility = "Hidden";
}
}
function findPosX (obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (1)
{
curleft += obj.offsetLeft;
if (!obj.offsetParent)
{
break;
}
obj = obj.offsetParent;
}
}
else if (obj.x)
{
curleft +=obj.x;
}
return curleft;
}
function findPosY (obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (1)
{
curtop +=obj.offsetTop;
if (!obj.offsetParent)
{
break;
}
obj = obj.offsetParent;
}
}
else if (obj.y)
{
curtop +=obj.y;
}
return curtop;
}