function getArgs() {
var args = new Object();
// Get Query String
var query = location.search.substring(1);
// Split query at the comma
var pairs = query.split("&");
// Begin loop through the querystring
for(var i = 0; i < pairs.length; i++) {
// Look for "name=value"
var pos = pairs[i].indexOf('=');
// if not found, skip to next
if (pos == -1) continue;
// Extract the name
var argname = pairs[i].substring(0,pos);
// Extract the value
var value = pairs[i].substring(pos+1);
// Store as a property
args[argname] = unescape(value);
}
return args; // Return the Object
}
function translate() {
var args = getArgs();
if (args.page) wl_ourl = (args.page);
top.location.href = wl_url + '=' + wl_ourl;
}
var totalPPL = 8;
var menuTimeout = 100;
function rndImg(img, path) {
if (path == null) {path = ""};
if (goCookies) {
var x = myCookie.counter;
} else {
var x = parseInt(1 + (Math.random() % 10) * totalPPL);
}
var imgString = "" + path + img + x + ".jpg";
return imgString;
};
function fosRnd(fos) {
x = document.getElementById(fos).style;
x.backgroundImage = 'url("' + rndImg('fos_bg_','/images/') + '")';
x.backgroundRepeat = 'no-repeat';
x.backgroundPosition = 'bottom right';
};
function posElementX(element, reference) {
document.getElementById(element).style.left = getAnchorX(reference) - 110;
};
function move_in(img_name,img_src) {
document[img_name].src="" + img_src;
};
function move_out(img_name,img_src) {
document[img_name].src="" + img_src;
};
drop1 = [
[],
[110, 0, "#000000", 1, "#FFFFFF", "drop1", "left"],
["Main", "http://www.hargeisacitygov.org/service.html"],
["Current Project", "http://www.hargeisacitygov.org/newproject"],
["Implemented Project", "http://www.hargeisacitygov.org/imp_project"],
["City Progress", "http://www.hargeisacitygov.org/progress"]
];
drop2 = [
[],
[118, 0, "#000000", 1, "#FFFFFF", "drop1", "left"],
["Main", "http://www.hargeisacitygov.org/contact.html"],
["The Mayor", "mailto:mayor@hargeisacitygov.org"],
["The City", "mailto:city@hargeisacitygov.org"],
["The Counsil", "mailto:counsil@hargeisacitygov.org"],
["About The Site", "mailto:webmaster@hargeisacitygov.org"]
];
drop3 = [
[],
[170, 0, "#000000", 1, "#FFFFFF", "drop1", "left"],
["Main", "http://www.hargeisacitygov.org/hargeisa.html"],
["Hotels", "http://www.hargeisacitygov.org/hotels"],
["Airport Service", "http://www.hargeisacitygov.org/airport"],
["Transportations", "http://www.hargeisacitygov.org/transport"],
["Tourist Attractions", "http://www.hargeisacitygov.org/tourist"],
["Resturants", "http://www.hargeisacitygov.org/rest"]
];
drop4 = [
[],
[120, 0, "#000000", 1, "#FFFFFF", "drop1", "left"],
["Main", "http://www.hargeisacitygov.org/"],
["Search the Site", "http://www.hargeisacitygov.org/search.html"],
["Search the News", "http://www.hargeisacitygov.org/search.html"],
["Search the Internet", "http://www.hargeisacitygov.org/search.html"]
];
drop5 = [
[],
[119, 0, "#000000", 1, "#FFFFFF", "drop1", "left"],
["Main", "http://www.hargeisacitygov.org/news.html"],
["City News", "http://www.hargeisacitygov.org/citynews.html"],
["Press Release", "http://www.hargeisacitygov.org/preleases.html"]
];
var tempTable = new Object();
var TimerID = 100;
function constructTable(arrayName) {
var startPos = 0;
var tableProperties = startPos + 1;
var tableElements = tableProperties + 1;
var tableCode = tableCodeFront = tableCodeMiddle = tableCodeBack = tempText = tempURL = '';
tempTable = {
tableWidth: eval(arrayName)[tableProperties][0],
tablePadding: eval(arrayName)[tableProperties][1],
tableBorderColor: eval(arrayName)[tableProperties][2],
tableBorderSize: eval(arrayName)[tableProperties][3],
tableBGColor: eval(arrayName)[tableProperties][4],
textClass: eval(arrayName)[tableProperties][5]
};
var tableCodeFront = '
';
for (i = tableElements; i < eval(arrayName).length; i++) {
tempText = eval(arrayName)[i][0];
tempURL = eval(arrayName)[i][1];
if (eval(arrayName)[i][2] == '>') {
tableCodeMiddle += ' |
';
} else {
tableCodeMiddle += ' |
';
};
};
tableCode = tableCodeFront + tableCodeMiddle + tableCodeBack;
return tableCode;
};
function showtip(state, name, offsetx, offsety) {
if (TimerID) clearTimeout(TimerID);
if (state) {
if (document.layers) {
theString = "" + constructTable(name) + "";
document.tooltip.document.write(theString);
document.tooltip.document.close();
document.tooltip.left = offsetx;
document.tooltip.top = offsety;
document.tooltip.visibility = "show";
} else {
if (document.getElementById) {
elm = document.getElementById("tooltip");
elm.innerHTML = constructTable(name);
elm.style.left = offsetx;
elm.style.top = offsety;
elm.style.visibility = "visible";
}
}
} else {
if (document.layers) {
document.tooltip.visibility = "hidden";
} else if (document.getElementById) {
elm.style.visibility = "hidden";
};
};
};
function showMenu() {
var totalArguments = arguments.length;
var onOff = arguments[0];
var arg1 = arguments[1];
var arg2 = arguments[2];
var arg3 = arguments[3];
if (onOff) {
clearTimeout(TimerID);
showtip(1, arg1, arg2, arg3);
} else {
clearTimeout(TimerID);
TimerID = setTimeout('showtip(0)', menuTimeout);
};
};
function getAnchorPosition(anchorname) {
var useWindow=false;
var coordinates=new Object();
var x=0,y=0;
var use_gebi=false, use_css=false, use_layers=false;
if (document.getElementById) { use_gebi=true; }
else if (document.all) { use_css=true; }
else if (document.layers) { use_layers=true; };
if (use_gebi && document.all) {
x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
} else if (use_gebi) {
var o=document.getElementById(anchorname);
x=AnchorPosition_getPageOffsetLeft(o);
y=AnchorPosition_getPageOffsetTop(o);
} else if (use_css) {
x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
} else if (use_layers) {
var found=0;
for (var i=0; i totalPPL) {myCookie.counter = 1};
myCookie.write();
if (!myCookie.read() || !myCookie.counter) {
goCookies = 0;
} else {
goCookies = 1;
};
function clearCookie() {myCookie.del()};
function showTooltip() {
var totalArguments = arguments.length;
var onOff = arguments[0];
var arg1 = arguments[1];
var arg2 = arguments[2];
var arg3 = arguments[3];
var arg4 = arguments[4];
if (onOff) {
clearTimeout(TimerID);
tooltipShowHide(1, arg1, arg2, arg3, arg4);
} else {
clearTimeout(TimerID);
TimerID = setTimeout('tooltipShowHide(0)', menuTimeout);
};
};
function tooltipShowHide(state, title, code, offsetx, offsety) {
if (TimerID) clearTimeout(TimerID);
if (state) {
if (document.layers) {
theString = "" + constructTip(title, code) + "";
document.tooltip.document.write(theString);
document.tooltip.document.close();
document.tooltip.left = offsetx;
document.tooltip.top = offsety;
document.tooltip.visibility = "show";
} else {
if (document.getElementById) {
elm = document.getElementById("smallTooltip");
elm.innerHTML = constructTip(title, code);
elm.style.left = offsetx;
elm.style.top = offsety;
elm.style.visibility = "visible";
}
}
} else {
if (document.layers) {
document.tooltip.visibility = "hidden";
} else if (document.getElementById) {
elm.style.visibility = "hidden";
};
};
};
function constructTip(title, code) {
var tipFront = '| ' + title + ' | | ';
var tipBack = ' |
|
';
return tipFront + code + tipBack;
}