File: /home/mycamden.co.uk/public_html/scripts/resource.js
function popMeUp() {
URL = "http://www.myvillage.com/music/";
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=300');");
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
today = new Date();
day = today.getDay();
date = today.getDate();
month = today.getMonth();
year = today.getFullYear();
if (day == 0) dayName = "Sunday"
else if (day == 1) dayName = "Monday"
else if (day == 2) dayName = "Tuesday"
else if (day == 3) dayName = "Wednesday"
else if (day == 4) dayName = "Thursday"
else if (day == 5) dayName = "Friday"
else dayName = "Saturday"
if (month == 0) monthName = "Jan"
else if (month == 1) monthName = "Feb"
else if (month == 2) monthName = "Mar"
else if (month == 3) monthName = "Apr"
else if (month == 4) monthName = "May"
else if (month == 5) monthName = "June"
else if (month == 6) monthName = "July"
else if (month == 7) monthName = "Aug"
else if (month == 8) monthName = "Sept"
else if (month == 9) monthName = "Oct"
else if (month == 10) monthName = "Nov"
else monthName = "Dec"
var pCid="uk_myvillage_0";
var w0=1;
var refR=escape(document.referrer);
if (refR.length>=252) refR=refR.substring(0,252)+"...";
function change()
{
with (window.document.ERmpartnersfrm)
{
if(metroSelect.options[metroSelect.selectedIndex].value == "-")
{
metroSelect.selectedIndex = metroSelect.selectedIndex + 1;
}
if (metroSelect.options[metroSelect.selectedIndex].value == "")
{
metroSelect.selectedIndex = metroSelect.selectedIndex + 2;
}
}
}
function Doredirect(t)
{
with (window.document.ERmpartnersfrm)
{
var errString = "";
if (metroSelect.options[metroSelect.selectedIndex].value == '' || metroSelect.options[metroSelect.selectedIndex].value == '-')
{errString = errString + "\nPlease choose a town!";}
if (errString.length > 0)
{alert(errString); }
else
{
if (t=='L')
window.location.href = "http://uk.easyroommate.com/setSession.cfm?u=content/havesample.cfm&m="+metroSelect.options[metroSelect.selectedIndex].value+'&t='+t+'&ac=myvillagelondon';
else
window.location.href = "http://uk.easyroommate.com/setSession.cfm?u=content/looksample.cfm&m="+metroSelect.options[metroSelect.selectedIndex].value+'&t='+t+'&ac=myvillagelondon';
}
}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
// CLUBS & GIGS
/* Define the number of images */
var imageno_clubs = 6;
/* The name of the image */
var imagename_clubs = 'rotabars';
/* The type of image */
var imagetype_clubs = '.jpg';
/* The root url of the image */
var rooturl_clubs = 'http://www.myvillage.com/images/bars&music/';
/* Calculate the image url to use */
var rannum_clubs = Math.round((Math.random() * 10) % imageno_clubs) + 1;
/* Write out the image url */
var imageurl_clubs = rooturl_clubs + imagename_clubs + rannum_clubs + imagetype_clubs;
// ARTS
/* Define the number of images */
var imageno_arts = 4;
/* The name of the image */
var imagename_arts = 'rotaarts';
/* The type of image */
var imagetype_arts = '.jpg';
/* The root url of the image */
var rooturl_arts = 'http://www.myvillage.com/images/arts&entertainment/';
/* Calculate the image url to use */
var rannum_arts = Math.round((Math.random() * 10) % imageno_arts) + 1;
/* Write out the image url */
var imageurl_arts = rooturl_arts + imagename_arts + rannum_arts + imagetype_arts;
//CELEBS
/* Define the number of images */
var imageno_celebs = 6;
/* The name of the image */
var imagename_celebs = 'rotacelebs';
/* The type of image */
var imagetype_celebs = '.jpg';
/* The root url of the image */
var rooturl_celebs = 'http://www.myvillage.com/images/celebs/';
/* Calculate the image url to use */
var rannum_celebs = Math.round((Math.random() * 10) % imageno_celebs) + 1;
/* Write out the image url */
var imageurl_celebs = rooturl_celebs + imagename_celebs + rannum_celebs + imagetype_celebs;
//RESTAURANTS
/* Define the number of images */
var imageno_rest = 5;
/* The name of the image */
var imagename_rest = 'rotarest';
/* The type of image */
var imagetype_rest = '.jpg';
/* The root url of the image */
var rooturl_rest = 'http://www.myvillage.com/images/restaurants/';
/* Calculate the image url to use */
var rannum_rest = Math.round((Math.random() * 10) % imageno_rest) + 1;
/* Write out the image url */
var imageurl_rest = rooturl_rest + imagename_rest + rannum_rest + imagetype_rest;
//FOOTBALL - ARSENAL
/* Define the number of images */
var imageno_arsenal = 4;
/* The name of the image */
var imagename_arsenal = 'arsenal-';
/* The type of image */
var imagetype_arsenal = '.jpg';
/* The root url of the image */
var rooturl_arsenal = 'images/sport/';
/* Calculate the image url to use */
var rannum_arsenal = Math.round((Math.random() * 10) % imageno_arsenal) + 1;
/* Write out the image url */
var imageurl_arsenal = rooturl_arsenal + imagename_arsenal + rannum_arsenal + imagetype_arsenal;
var regionIDArr = new Array();
var regionNMArr = new Array();
var regionAreaArr = new Array();
var regionAreaIdArr = new Array();
regionIDArr[0]=new Array("6","4","7","8","9","1","5","3","2");
regionNMArr[0]=new Array("East","London","Midlands","North","Northern Ireland","Scotland","South-East","South-West","Wales");
regionAreaArr[0]=new Array();
regionAreaIdArr[0]=new Array();
regionAreaArr[0][0]=new Array("Bedfordshire","Cambridgeshire","Essex","Hertfordshire","Norfolk","Suffolk");
regionAreaArr[0][1]=new Array("London - City & West End","London - North","London - North-East","London - North-West","London - South-East","London - South-West","London - West");
regionAreaArr[0][2]=new Array("Derbyshire","Gloucestershire","Hereford & Worcester","Leicestershire","Lincolnshire","Northamptonshire","Nottinghamshire","Shropshire","Staffordshire","Warwickshire","West Midlands");
regionAreaArr[0][3]=new Array("Cheshire","Cleveland","Cumbria","Durham","East Yorkshire","Lancashire","Manchester","Merseyside","Northumberland","North Yorkshire","South Yorkshire","Tyne & Wear","West Yorkshire");
regionAreaArr[0][4]=new Array("Antrim","Armagh","Down","Fermanagh","Londonderry","Tyrone");
regionAreaArr[0][5]=new Array("Borders","Central","Dumfries & Galloway","Fife","Grampian","Highlands","Isle of Man","Lothian","Orkney Islands","Shetland Islands","Strathclyde","Tayside","Western Isles");
regionAreaArr[0][6]=new Array("Berkshire","Buckinghamshire","East Sussex","Hampshire","Isle of Wight","Kent","Oxfordshire","Surrey","West Sussex");
regionAreaArr[0][7]=new Array("Avon","Channel Islands","Cornwall","Devon","Dorset","Somerset","Wiltshire");
regionAreaArr[0][8]=new Array("Clywd","Dyfed","Glamorgan","Gwent","Gwynedd","Powys","West Glamorgan");
regionAreaIdArr[0][0]=new Array("48","47","46","49","44","45");
regionAreaIdArr[0][1]=new Array("33","32","27","31","28","29","30");
regionAreaIdArr[0][2]=new Array("56","52","51","57","60","58","59","50","53","55","54");
regionAreaIdArr[0][3]=new Array("73","65","62","64","67","70","71","72","61","66","68","63","69");
regionAreaIdArr[0][4]=new Array("74","77","76","79","75","78");
regionAreaIdArr[0][5]=new Array("10","6","11","8","4","3","12","9","2","1","7","5","13");
regionAreaIdArr[0][6]=new Array("36","35","41","37","38","42","34","39","40");
regionAreaIdArr[0][7]=new Array("25","43","21","22","24","23","26");
regionAreaIdArr[0][8]=new Array("18","15","17","20","14","19","16");
function showAreas(sel){
var cntrId = 1;
var regId = sel.options[sel.selectedIndex].value;
var county_default = 'All Counties';
if (regId!=-1){
for (var i=0; i<(regionIDArr[cntrId-1]).length;i++){
if (regionIDArr[cntrId-1][i]==regId){
if (regId == 4){
county_default = 'All Areas';
}
var obj = document.caj_search.area;
obj.length=1;
obj.options[0]=new Option(county_default, -1);
for (var j=0; j<regionAreaArr[cntrId-1][i].length; j++){
obj.options[j+1] = new Option(regionAreaArr[cntrId-1][i][j], regionAreaIdArr[cntrId-1][i][j]);
}
break;
}
}
} else {
document.caj_search.area.length=1;
document.caj_search.area.options[0]=new Option("All Counties", -1);
}
}
function trim(str)
{
str = this != window? this : str;
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
function check_form(f)
{
if( trim(f.keywords.value) == '' ){
alert('Please, enter the keywords.');
return false;
}
if( f.region.options[f.region.selectedIndex].value == -1 ){
alert('Please, select the region.');
return false;
}
return true;
}
callingURL= new String(document.URL);
{mydomain=callingURL.substring(callingURL.indexOf('http://www.')+11,callingURL.indexOf('/',7));}
//alert(mydomain);
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;
//alert(password);
//alert(myemaildomain);
//alert(realusername);
location.href='http://xeres.gointernet.co.uk/cgi/webumake/umm.cgi?action=login&mailuser='+realusername+'&mailgroup='+myemaildomain+'&password='+password+'&domain=myvillage';
}
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://www.myvillage.com/cgi-bin/search.pl";
document.tripleform.method="GET";
document.tripleform.submit()}
}
function bookMark(){
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
//alert(document.URL);
//alert(document.title);
window.external.AddFavorite(document.URL, document.title);
}
else {
if(navigator.appName == "Netscape") {
alert('Netscape users hit (CTRL+D) now!\nto book mark this page');
}
}
}
function showDate() {
document.write(date + ' ' + monthName + ' ' + year);
}