File: /home/mycamden.co.uk/public_html/nav/camden.js
<!--
// MyVillage Header navigation script
// bazza - 14/7/2001
// Redesign: dario@livra.com - 11/02/2003
//NOTE: this array MUST BE ALPHABETICALLY ORDERED BY THE FIRST COLUMN (name of the location)
all_domains = new Array (4);
all_domains[0] = new Array("", new Array())
all_domains[1] = new Array( "mycamden" ,new Array ("www.mycamden.co.uk" ,"camden" ,"http://www.mycamden.co.uk/images/camdenNN.gif" ,"MyVillage Camden" ,"camden" ,"http://www.myvillage.com/top_tables/images/" ,"http://www.blackevents.co.uk/cgi-bin/ubbcgi/forumdisplay.cgi?action=topics&forum=My+Camden&number=11") )
all_domains[2] = new Array( "mykentishtown" ,new Array ("www.mykentishtown.co.uk" ,"camden" ,"http://www.mykentishtown.co.uk/images/kentishtownNN.gif" ,"MyVillage Kentish Town" ,"camden" ,"http://www.myvillage.com/top_tables/images/" ,"http://www.blackevents.co.uk/cgi-bin/ubbcgi/forumdisplay.cgi?action=topics&forum=My+Camden&number=11") )
all_domains[3] = new Array( "mykingscross" ,new Array ("www.mykingscross.co.uk" ,"camden" ,"http://www.mykingscross.co.uk/images/kingscrossNN.gif" ,"MyVillage Kingscross" ,"camden" ,"http://www.myvillage.com/top_tables/images/" ,"http://www.blackevents.co.uk/cgi-bin/ubbcgi/forumdisplay.cgi?action=topics&forum=My+Camden&number=11") )
all_domains[4] = new Array( "myprimrosehill" ,new Array ("www.myprimrosehill.co.uk" ,"camden" ,"http://www.myprimrosehill.co.uk/images/primrosehillNN.gif" ,"MyVillage Primrose Hill" ,"camden" ,"http://www.myvillage.com/top_tables/images/" ,"http://www.blackevents.co.uk/cgi-bin/ubbcgi/forumdisplay.cgi?action=topics&forum=My+Camden&number=11") )
// setup a new string which has all the domains in
//var tempstr = new String (all_domains);
var loc = document.location.search;
var subloc = document.location.hostname;
var domainID = "";
// for testing set these as constants
var personal = 'pages/personal.htm'; // default
// pick out the actual domain ie "myvillage" or whatever
test = subloc.substring(subloc.indexOf(".")+1, subloc.length);
testx = test.substring(test.index, test.indexOf("."));
// Look up the domain and see if it's in the list.
iPos = busbinStr(all_domains, testx, 0);
if (iPos != -1 && testx != "myvillage") {
// if it is set the domainID to it
domainID = testx;
eval("set_cookie('"+domainID+"');");
} else {
// if it don't exist
check_the_URL();
}
function check_the_URL() {
// look at the end of the URL to see if it has been passed on
if (loc.indexOf("domain=") != -1) {
// Coconut complications!!
if (loc.indexOf("_domain") != -1) {
var chop = loc.substring(loc.indexOf("_domain=")+8, loc.length);
if (chop.indexOf("&") != -1) {
chopx = chop.substring(chop.index, chop.indexOf("&"));
domainID = chopx.substring(chopx.index, chopx.indexOf("."));
if (domainID.length == 0) {
domainID = chopx;
eval("set_cookie('"+domainID+"');");
}
if (domainID.length == 0) {
check_the_cookie();
}
} else if (chop.indexOf(".") != -1) {
domainID = chop.substring(chop.index, chop.indexOf("."));
if (domainID.length == 0) {
check_the_cookie();
}
eval("set_cookie('"+domainID+"');");
} else {
domainID = chop;
if (domainID.length == 0) {
check_the_cookie();
}
eval("set_cookie('"+domainID+"');");
}
} else {
// if it is there
// then set domainID to it
var chop = loc.substring(loc.indexOf("domain=")+7, loc.length);
if (chop.indexOf("&") != -1) {
domainID = chop.substring(chop.index, chop.indexOf("&"));
if (domainID.length == 0) {
check_the_cookie();
}
eval("set_cookie('"+domainID+"');");
} else {
domainID = chop;
if (domainID.length == 0) {
check_the_cookie();
}
eval("set_cookie('"+domainID+"');");
}
}
} else {
// if it's not on the end of the URL
check_the_cookie();
}
}
function check_the_cookie() {
if (!document.cookie){
// if there is not cookies set
// no choice but to set it to noID
domainID = "noID";
eval("set_cookie('"+domainID+"');");
} else {
if (document.cookie.indexOf("domainID=") != -1) {
// if a cookie is there and it includes a domainID
// use it
var current_cookie = document.cookie.substring(document.cookie.indexOf('domainID=')+9, document.cookie.indexOf('$$$$$$'));
domainID = current_cookie;
eval("set_cookie('"+domainID+"');");
} else if(document.referrer) {
var str = document.referrer;
var t = str.substring(str.indexOf('.')+1,str.length);
var tt = t.substring(0,t.indexOf('.'));
domainID = tt;
eval("set_cookie('"+domainID+"');");
} else {
// if theres a cookie but it doesn't have a domainID
// no choice but to use noID
domainID = "noID";
eval("set_cookie('"+domainID+"');");
}
}
}
// after all this attempt to set a cookie on that server
function set_cookie(domainx) {
var nextyear = new Date();
nextyear.setFullYear(nextyear.getFullYear() + 1);
if (domainx.length !== 0) {
document.cookie = "domainID="+ domainx +"$$$$$$;";
eval("draw_table('"+domainx+"');");
} else {
}
}
function draw_table(domainx) {
domainID = domainx
iPos = busbinStr(all_domains, domainID, 0);
eval("var " + domainID + "= all_domains[" + iPos + "][1];");
// setup the rest of the variables using the acquired domainID
// the full domain of the current page as specified in the array
domain = eval(domainID+'[0]');
// the name of the folder where all category pages should point for this domain
cat_folder = eval(domainID+'[1]');
// the file name of the header image and caption
header_image = eval(domainID+'[2]');
header_image_caption = eval(domainID+'[3]');
// special link folder - for local sport info etc.
special_links_folder = eval(domainID+'[4]');
// image library directory
image_library = eval(domainID+'[5]');
// message board link
message_board_link = eval(domainID+'[6]');
// from the terraces link
if (! eval(domainID+'[7]')) {
var ftt_link = "http://www.fansfc.com/myvillage/london.asp?domain="+domainID;
} else {
var tempFTT = eval(domainID+'[7]')
var ftt_link = "http://www.fansfc.com/myvillage/"+tempFTT;
}
// Personals link
var personals_link = 'http://personals.myvillage.com';
// start writing the top navi bar.
document.write('<!-- Dynamic table present -->');
document.write("<STYLE>.HeaderLink:link {COLOR: #FFFFFF; TEXT-DECORATION:none} .HeaderLink:visited {COLOR: #FFFFFF; TEXT-DECORATION:none} .HeaderLink:hover {COLOR: #FF0000; TEXT-DECORATION:none}</STYLE>");
document.write("<table align=\"center\" width=\"777\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.write(" <tr bgcolor=\"#000000\">");
document.write(" <td colspan=\"3\" align==\"center\">");
document.write(" <div align=\"center\"><b><font size=\"1\">");
document.write(" <a target=\"_top\" class=\"HeaderLink\" href=\"http://www.myvillage.com/adrates.htm\" style=\"text-decoration: none\">Promote Your Business</a> ");
document.write(" <font color=\"#FFFFFF\"> Your local website updated daily! </font> ");
document.write(" <a target=\"_top\" class=\"HeaderLink\" href=\"http://www.myvillage.com\" style=\"text-decoration: none\"> Cities in the UK</a> ");
document.write(" <a target=\"_top\" class=\"HeaderLink\" href=\"http://www.myvillagelondon.co.uk\" style=\"text-decoration: none\">Communities in London</a> ");
document.write(" <a target=\"_top\" class=\"HeaderLink\" href=\"#\" onclick=\"javascript: window.open(\'http://www.myvillage.com/mailamate/mailapage.htm?page=\'+top.location,\'\',\'width=400,height=400,scrollbars=no\')\">E-mail this page to a friend <img src=\"http://www.myvillage.co.uk/images/email-icon.gif\" border=\"0\"></a>");
document.write(" </div></font></b>");
document.write(" </td>");
document.write(" </tr>");
document.write(" <tr> ");
document.write(" <td bgcolor=\"#FFCF00\"> <a href=\"http://" + domain + "\"><IMG SRC=\"" + header_image + "\" alt=\"" + header_image_caption + "\"BORDER=\"0\"></a></td>");
document.write(" <td bgcolor=\"#FFCF00\" align=\"right\">");
document.write(" <IFRAME src=\"http://www.myvillage.co.uk/banners/mini.txt?domain=" + domainID + "\" width=468 height=60 scrolling=no allowtransparency=true frameborder=0 marginheight=0 marginwidth=0></IFRAME> ");
document.write(" </td>");
document.write(" <td bgcolor=\"#FFCF00\" width=\"5\"> </td>");
document.write(" </tr>");
document.write(" <tr bgcolor=\"#000000\"> ");
document.write(" <td colspan=\"3\"> ");
document.write(" <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">");
document.write(" <tr valign=\"bottom\"> ");
document.write(" <td height=\"20\" align=\"center\"> ");
document.write(" <p><font size=\"1\" color=\"#FFFFFF\"><b>");
document.write(" <img src=\"images/pix.gif\" width=\"1\" height=\"10\"><A class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/arts.htm\">Arts & Entertainment</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/bars&Music.htm\">Bars & Music</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/restaurants.htm\">Restaurants</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/fashion.htm\">Fashion & Lifestyle</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/health.htm\">Health & Beauty</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/celebs&gossip.htm\">Celebs & Gossip</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/shops.htm\">Shopping</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://www.peoplebank.com/pbank/owa/myvillage.main\">Jobs & Careers</a>");
document.write(" </b></font></p>");
document.write(" </td>");
document.write(" </tr>");
document.write(" <tr valign=\"top\"> ");
document.write(" <td align=\"center\" height=\"20\">");
document.write(" <font size=\"1\" color=\"#FFFFFF\"><b>");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/property.html\">Homes & Property</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/community.htm\">News & Community</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/businesszone.htm\">Business & Services</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"" + ftt_link + "\">Football & Sport</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/kids.htm\">Kids & Youth</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"" + personals_link + "\">Personals</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"http://" + domain + "/" + cat_folder + "/services.htm\">Classifieds</a> | ");
document.write(" <A target=\"_top\" class=\"HeaderLink\" HREF=\"" + message_board_link + "\">Message board</a>");
document.write(" <img src=\"images/pix.gif\" width=\"1\" height=\"10\"></b></font></td>");
document.write(" </tr>");
document.write(" </table>");
document.write(" </td>");
document.write(" </tr>");
document.write(" </table>");
}
// Other functions
// add local sports links to FTT pages
function show_sports_links() {
document.writeln('<FONT COLOR="ffcc00" SIZE="1"><B>');
document.writeln('<A HREF="http://'+domain+'/'+cat_folder+'/sport-club.htm">Local club listings</A><BR>');
document.writeln('<A HREF="http://'+domain+'/'+cat_folder+'/sport-activity.htm">Local sports activities</A><BR>');
document.writeln('<A HREF="http://'+domain+'/'+cat_folder+'/sport-features.htm">Local sport features</A><BR>');
document.writeln('</B></FONT>');
}
function make_home() {
document.writeln('<a href="#" onClick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://'+domain+'\');"> ');
document.writeln('<img src="http://www.mybrixton.com/images/make_this_home.gif" alt="Make this your homepage" border="0"');
document.writeln(' width="93" height="40"></a>');
}
// Find a Property additions
function finda(form_name) {
if (!form_name) {
formx = "findit";
} else {
formx = form_name;
}
eval("document."+formx+".domain.value = domainID;");
}
function formdestination(mode) {
if (mode=="mail_coconut") {
username = new String(document.tripleform.loginname.value);
{
myemaildomain=username.substring(username.indexOf('@')+1,username.length);
realusername=username.substring(username[0],username.indexOf('@'));
}
var password=document.tripleform.loginpassword.value;
if (callingURL.indexOf("/pages/personal") != -1) {
location.href='http://mail.myvillage.com/cgi/cwpro/login?fm_submit=yes&fm_referer=index&fm_templates=personals&fm_user_profile=yes&fm_username='+realusername+'&fm_password='+password+'&fm_email_domain='+myemaildomain;
} else {
location.href='http://mail.myvillage.com/cgi/cwpro/login?fm_submit=yes&fm_referer=index&fm_templates=&fm_user_profile=yes&fm_username='+realusername+'&fm_password='+password+'&fm_email_domain='+myemaildomain;
}
}
if (mode=="mail_zzn") {
document.tripleform.action="http://portowebbo.zzn.com/email/english/login/loginaction.asp";
document.tripleform.method="POST";
document.tripleform.submit()
}
if (mode=="poll") {
document.tripleform.action="http://test.myvillage.com/testmyvillage/GC/Global/MVViewPollResults.ghtml";
document.tripleform.method="POST";
document.tripleform.submit()
}
if (mode=="search") {
document.tripleform.action="http://search.atomz.com/search/";
document.tripleform.method="GET";
document.tripleform.submit()
}
}
function right_link() {
document.writeln("<b><a href='http://mail.myvillage.com/cgi/cwpro/register?fm_templates=personals&fm_email_domain="+domainID+"'>your free Myvillage account here.</a></b>");
}
function network_link(linkx) {
if (linkx.indexOf("?") != -1) {
temp = linkx+"&domain="+domainID;
document.location.href = temp;
} else {
temp = linkx+"?domain="+domainID;
document.location.href = temp;
}
}
function busbinStr(aArray, lSearch, lCol) {
lFirst = 0
lLast = aArray.length - 1;
bFound = false;
while (lFirst <= lLast && !bFound) {
lMid = parseInt((lFirst + lLast) / 2);
if (lCol > - 1) {
lCurValue = aArray[lMid][lCol];
} else {
lCurValue = aArray[lMid];
}
if (lCurValue == lSearch) {
bFound = true;
} else if (aArray[lMid] < lSearch) {
lFirst = lMid + 1;
} else {
lLast = lMid - 1;
}
}
if (bFound) {
return lMid;
}
return -1;
}
//-->