
// This JavaScript file contains functions written by Peter Wright
// Version 1 [ 18 Jul 2003 - 23:42 ]

var imageDir="images/";			// path to background image'
var myName="online.js";			// name of this file for nesting purposes
var good;

var ePost="aut" + "hor@banu" + "s-lettings.net";

var mailList = new Array();
   mailList[0] = new Array("banus-lettings.net");
   mailList[1] = new Array("author");
   mailList[2] = new Array("postcard");
   mailList[3] = new Array("howard.taylor");
   mailList[4] = new Array("mark.williams");



// -------------------------------

// Remember to addd mouse click

var message="Web Site ©2007\nBanus Lettings           \n---------------------------------------------\n79 Victoria Road       \nFarnbrough       \nHampshire      \nGU14 7PL\n       \nTelephone: 01252 669936       ";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;


// -------------------------------

function documentwrite(dat) { document.write(dat); }	// embedded objects fix - 24 Apr 06

function emailPage(){
zxcv = document.title .substring (17 ,140)
document.location = 'mailto:?subject=[BL] ' + zxcv + '&bcc=david@cyberpictures.net&body=Hello, %0D%0DI found an interesting page on the Internet and thought it would be of interest to you: ' + document.title + '. %0D%0DGo here: ' + document.location + ' %0D%0DThe site contains details of two luxury Holiday apartments in Puerto Banus, Marbella, Spain. The home page can be found at http://www.banus-lettings.net %0D%0DBye for now.';
   }

function eFlash() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="113" height="217">';
    nn+='<param name="movie" value="navigation/navbar.swf">';
    nn+='<param NAME="wmode" VALUE="transparent">';
    nn+='<param name="quality" value="high">';
    nn+='<param name="menu" value="true">';
    nn+='<embed src="navigation/navbar.swf" WMODE="transparent" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="113" height="217"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function iFlash() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="789" height="22">';
    nn+='<param name="movie" value="navigation/local-info.swf">';
    nn+='<param name="quality" value="high">';
    nn+='<param name="menu" value="true">';
    nn+='<param NAME="wmode" VALUE="transparent">';
    nn+='<embed src="navigation/local-info.swf" WMODE="transparent" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="789" height="22">';
    nn+='<\/object>';
    return nn;
}

function pFlash() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="789" height="23">';
    nn+='<param name="movie" value="navigation/appt.swf">';
    nn+='<param name="quality" value="high">';
    nn+='<param name="menu" value="true">';
    nn+='<param NAME="wmode" VALUE="transparent">';
    nn+='<embed src="navigation/appt.swf" WMODE="transparent" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="789" height="23"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function lFlash() {
    var nn="";
    nn+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="789" height="22">';
    nn+='<param name="movie" value="navigation/lqappt.swf">';
    nn+='<param name="quality" value="high">';
    nn+='<param name="menu" value="true">';
    nn+='<param NAME="wmode" VALUE="transparent">';
    nn+='<embed src="navigation/lqappt.swf" WMODE="transparent" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="789" height="22"><\/embed>';
    nn+='<\/object>';
    return nn;
}

function links() {
    var nn="";
    nn+='<p style="margin: 10px 3px 5px"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="789" height="22">';
    nn+='<param name="movie" value="navigation/links.swf">';
    nn+='<param name="quality" value="high">';
    nn+='<param name="menu" value="true">';
    nn+='<param NAME="wmode" VALUE="transparent">';
    nn+='<embed src="navigation/links.swf" WMODE="transparent" quality="high" menu="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="789" height="22">';
    nn+='</embed>';
    nn+='</object></p>';
    return nn;
}

function recipientList() {
      var tempList = "";
      for (nn=1; nn<mailList.length; nn++) {
         if (tempList != "") { tempList += ", " };
         tempList += mailList[nn] + "@" + mailList[0];
      }
      return tempList;
   }

function meLink( text, subject) {
   nn="";
   nn+='<a href="mailto:' + ePost;
   if (subject!="" && subject!=null) { nn+='?Subject=' + subject }
   nn+='">' + text + '</a>';
   return nn;
}

function mwLink( text, subject) {
   nn="";
   nn+='<a href="mailto:' + mwPost;
   if (subject!="" && subject!=null) { nn+='?Subject=' + subject }
   nn+='">' + text + '</a>';
   return nn;
}

function mePic( subject) {
   nn="";
   nn+='<a href="mailto:' + ePost;
   if (subject!="" && subject!=null) { nn+='?Subject=' + subject }
   nn+='">' + '<img src="images/mailw.gif" width="89" height="26" alt="email" border="0">' + '</a>';
   return nn;
}

function mePic2( subject) {
   nn="";
   nn+='<a href="mailto:' + ePost;
   if (subject!="" && subject!=null) { nn+='?Subject=' + subject }
   nn+='">' + '<img src="images/uc.gif" width="46" height="39" alt="Cripes, I\'ve gone through some cable or other" border="0">' + '</a>';
   return nn;
}

function mePic3( subject) {
   nn="";
   nn+='<a href="mailto:' + ePost;
   if (subject!="" && subject!=null) { nn+='?Subject=' + subject }
   nn+='">' + '<img src="images/which-site.gif" width="49" height="81" vspace="8" alt="Hello" border="0">' + '</a><br><b>Your Webmaster</b>';
   return nn;
}

function nothing() {
msg=window.open("","msg","height=160,width=200,left=160,top=55,scrollbars=no");
msg.document.write("<html><head><title>Banus Lettings</title></head>");
msg.document.write("<body bgcolor='#FFF090'><center>");
msg.document.write("<img src='images/x.gif' width='32' height='32' alt=''>");
msg.document.write("<br><br><font face='Trebuchet MS' size='2' color='#000040'><b>Any button without a label is reserved for future use</b></font><br><br>");
msg.document.write("<form><input type='button' value=' Close ' onclick='window.close();'></form>");
msg.document.write("</body></html>");
}

function captionStyle(txt) {
   while (txt.indexOf("{#")>0) {		// replace custom format commands {#?} with <p class="CF?>
      txtP=txt.indexOf("{#");
      txtL=txt.substring(0, txtP);
      txtS=txt.charAt(txtP+2);
      txtR=txt.substring(txtP+4);
      txt=txtL + '<p class="CF' + txtS + '">' + txtR;
   }
   while (txt.indexOf("{/#}")>0) {		// replace custom format end commands {/#} with </p>
      txtP=txt.indexOf("{/#}");
      txtL=txt.substring(0, txtP);
      txtR=txt.substring(txtP+4);
      txt=txtL + '</p>' + txtR;
   }
   return txt;
}

function popBig(filename, winname, description, imageW, imageH, closeParent) {
   if (description.indexOf("|")>0) { var describe = description.split("|"); description=describe[1] }
   description=captionStyle(description);
   nn="";
   nn+='<html><head><title>Banus Lettings Image Library - Picture ' + winname + '</title>';
   nn+='<meta http-equiv="imagetoolbar" content="no">';
   nn+='<meta name="MSSmartTagsPreventParsing" content="TRUE">';
   nn+='<style type="text/css">';
   nn+='BODY { background-image: url(' + imageDir + 'enbg2.gif); margin: 5px; }';
   nn+='.descriptive { font-family: "Trebuchet MS", sans-serif; font-size: 24px; font-weight: bold; text-align: center; color: #804000; }';
   if (description.indexOf('<h6>')>0) { nn+=' h6 { font-family: Verdana, Arial, sans-serif; font-size: 12pt; font-weight: bold; text-align: justify; color: #804000; margin: 4px 30px 0; }'; }
   if (description.indexOf('class="CFj"')>0) { nn+=' .CFj { font-family: Verdana, Arial, sans-serif; font-size: 12pt; font-weight: bold; text-align: justify; color: #804000; margin: 4px 30px 0; }'; }
   if (description.indexOf('class="CFc"')>0) { nn+=' .CFc { font-family: Verdana, Arial, sans-serif; font-size: 12pt; font-weight: bold; text-align: center; color: #804000; margin: 0 0 0; }'; }
   nn+='</style></head><body><center>';
   nn+='<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">';
   nn+='<tr>';
   nn+='<td align="center"><a href="javascript:window.close()"><img src="' + filename + '" width=' + imageW + ' height=' + imageH + ' border=0 alt=" Click to close window "></a></td>';
   nn+='</tr>';
   nn+='<tr valign="middle">';
   nn+='<td height="50" class="descriptive">' + description + '</td>';
   nn+='</tr>';
   nn+='</table></center></body></html>';
   window2=window.open("", "", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=0,top=0,width=" + (screen.availWidth-10) + ",height=" + (screen.availHeight-30));
   window2.document.open();
   window2.document.write(nn);
   window2.document.close();
   if (closeParent) { parent.window.close() };
   window2.focus()
}

function popUp(filename, winname, description, imageW, imageH) {
   bigURL="popBig('" + filename + "', '" + winname + "', '" + description + "', " + imageW + ", " + imageH + ", ";
   if (description.indexOf("|")>0) { var describe = description.split("|"); description=describe[0] }
   if (navigator.appName=="Opera" || document.layers || (screen.availWidth>=imageW && screen.availHeight>=imageH)) { eval(bigURL+"false)"); return } else { bigURL+= "true)" }
   winH=screen.availHeight-28;			// set popup window height to max available
   winW=screen.availWidth-9;			// set popup window width to max available
   imgH=winH-52;					// calculate maximum image height
   imgW=parseInt(imageW*(imgH/imageH));		// calculate proportional image width
   if (imgW>(winW-8)) {				// if resulting image is too wide
      imgW=winW-8;				// reduce image width
      imgH=parseInt(imageH*(imgW/imageW));		// calculate proportional image height
   }
   nn="";
   nn+='<html><head><title>Banus Lettings Image Library - Picture ' + winname + '</title>';
   nn+='<meta http-equiv="imagetoolbar" content="no">';
   nn+='<meta name="MSSmartTagsPreventParsing" content="TRUE">';
   nn+='<style type="text/css">';
   nn+='BODY { background-image: url(' + imageDir + 'enbg2.gif); margin: 5px; }';
   nn+='.descriptive { font-family: "Trebuchet MS", sans-serif; font-size: 24px; font-weight: bold; text-align: center; color: #804000; }';
   nn+='.click { font-family: Arial, sans-serif; font-size: 11px; font-weight: normal; text-align: left; color: #000000; }';
   nn+='</style></head><body><center>';
   nn+='<script language="JavaScript" type="text/javascript" src="' + myName + '"></script>';
   nn+='<table border=0 cellpadding=0 cellspacing=0 align="center" width=' + (winW-14) + '>';
   nn+='<tr>';
   nn+='<td height=' + imgH + ' colspan=2 align="center"><a href="javascript:window.close()"><img src="' + filename + '" width=' + imgW + ' height=' + imgH + ' border=0 alt=" Picture ' + winname + ' "></a></td>';
   nn+='</tr>';
   nn+='<tr valign="bottom">';
   nn+='<td width=' + (winW-214) + ' height=40 class="descriptive">' + description + '</td>';
   nn+='<td width=200 class="click">Click on the image to close this window<br><a href="javascript:' + bigURL + '"><img src="' + imageDir + 'redsq.gif" width=9 height=9 border=0 alt=""></a> &nbsp; See image at maximum resolution</td>';
   nn+='</tr>';
   nn+='</table></center></body></html>';
   window1=window.open('', '', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=0,top=0,width=" + winW + ",height=" + winH);
   window1.document.open();
   window1.document.write(nn);
   window1.document.close();
   window1.focus()
}

function lastMod() {
  var x = new Date (document.lastModified);
  Modif = new Date(x.toGMTString());
  Year = takeYear(Modif);
  Month = Modif.getMonth();
  Day = Modif.getDate();
  Mod = (Date.UTC(Year,Month,Day,0,0,0))/86400000;
  x = new Date();
  today = new Date(x.toGMTString());
  Year2 = takeYear(today);
  Month2 = today.getMonth();
  Day2 = today.getDate();
  now = (Date.UTC(Year2,Month2,Day2,0,0,0))/86400000;
  daysago = now - Mod;
  if (daysago < 0) return '';
  unit = 'days';
  if (daysago > 730)
  {
  daysago = Math.round(daysago/365);
  unit = 'years';
  }
  else if (daysago > 60)
  {
  daysago = Math.round(daysago/30);
  unit = 'months';
  }
  else if (daysago > 14)
  {
  daysago = Math.round(daysago/7);
  unit = 'weeks'
  }
  towrite = '<br>Last updated ';
  if (daysago == 0) towrite += 'today';
  else if (daysago == 1) towrite += 'yesterday';
  else towrite += daysago + ' ' + unit + ' ago';
  towrite += '. &copy; ' + Year2 + ' Banus Lettings';
  return towrite;
}

function takeYear(theDate) {
  x = theDate.getYear();
  var y = x % 100;
  y += (y < 38) ? 2000 : 1900;
  return y;
}

function popUpold(filename, winname, description, width) {
   nn="";
   nn+='<html><head><title>Banus Lettings Image Library - Picture '+ winname + '</title>';
   nn+='<meta http-equiv="imagetoolbar" content="no">';
   nn+='<meta name="MSSmartTagsPreventParsing" content="TRUE">';
   nn+='</head>';
   nn+='<body background="' + imageDir + 'enbg2.gif" topmargin="5" leftmargin="2" rightmargin="2" marginheight="5" marginwidth="2">';
   nn+='<a href="javascript:window.close()"><img src="' + filename + '" border="0" alt="Click to close window"></a>';
   nn+='<center><font color="#804000" size="5" face="Trebuchet MS">';
   nn+='<p><b>' + description + '</b></p><p>&nbsp;</p></font></center>';
   nn+='</body></html>';
   window2 = window.open("", "", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=0,top=0,width="+ width);
   window2.document.open();
   window2.document.write(nn);
   window2.document.close();
   window2.focus()
}

function neww3c() {
   nn="";
   nn+='<br><p align="center">';
   nn+='<a href="http://validator.w3.org/check?uri=' + location.toString() + '" target="_w3c" onmouseover="self.status=\'This web page has been designed to work under all operating sytems and with all WEB Browsers\'; return true" onmouseout="self.status=\'\'; return true"><img src="' + imageDir + 'w3c-401.gif" alt="Web page with valid HTML 4.01 markup" border="0" height="31" width="93" hspace="0"></a>';
   nn+='<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_w3c" onmouseover="self.status=\'This site uses Cascading Style Sheets [CSS] which is a mechanism for adding style [e.g. fonts, colors, spacing] to our pages\'; return true" onmouseout="self.status=\'\'; return true"><img src="' + imageDir + 'w3c-css.gif" alt="This site uses Cascading Style Sheets [CSS] which is a simple mechanism for adding style [e.g. fonts, colors, spacing] to our pages. Hyperlink checks for design errors." border="0" height="31" width="93" hspace="8"></a>';
   nn+='<a href="http://www.anybrowser.org/campaign/index.html" target="_new" onmouseover="self.status=\'With minor differences this site should be viewable with any graphical browser that supports Java\'; return true" onmouseout="self.status=\'\'; return true"><img src="images/anybrowser.jpg" alt="With minor differences this site should be viewable with any graphical browser that supports Java. Some features will be lost when using a Java incapable browser." border="0" height="32" width="96" hspace="10"></a>';
   nn+='<a href="javascript:emailPage()" onmouseover="self.status=\'Have a nice day\'; return true" onmouseout="self.status=\'\'; return true"><img src="images/tell-a-friend.gif" alt="Sends the URL of this page via email to your friend" border="0" height="32" width="130" vspace="0" hspace="8"></a>';
   nn+='</p><p>&nbsp;</p>';
   return nn;
}

function pagebase() {
   nn=""
   nn+='<p class="logo">';
   nn+='<a href="http://www.banus-lettings.net" target="_parent">';
   nn+='<img src="logos/pobl.jpg" align="left" border="0" height="32" width="26" vspace="5" style="margin: 0 10px 0 0"'; 
   nn+='alt="Banus Lettings - Site Logo           http://www.banus-lettings.net"></a>';
   nn+='Click on the adjacent logo to display the Home Page<br>';
   nn+='Page URL: ' + location.toString();
   nn+=lastMod();
   nn+='</p>';
   nn+='<p>&nbsp;</p>';
   return nn;
}

function pagebase8() {
   nn=""
   nn+='<p class="logo">';
   nn+='<a href="http://www.banus-lettings.net" target="_parent">';
   nn+='<img src="logos/pobl.jpg" align="left" border="0" height="32" width="26" vspace="5" style="margin: 0 10px 0 0"';
   nn+='alt="Banus Lettings - Site Logo           http://www.banus-lettings.net"></a>';
   nn+='Click on the adjacent logo to display the Home Page<br>';
   nn+='Page URL: ' + location.toString();
   nn+=lastMod();
   nn+='<br>Visitor No.: <img src="http://www.banus-lettings.net/cgi-sys/Count.cgi?df=banuslet.dat|display=Counter|ft=0|md=5|frgb=100;139;216|dd=E">';
   nn+='</p>';
   return nn;
}

function display_time_in_status_line(  )
{
 var d = new Date(  );
   // Get the current time
 var h = d.getHours(  );
   // Extract hours: 0 to 23
 var m = d.getMinutes(  );
   // Extract minutes: 0 to 59
 var ampm = (h >= 12)?"pm":"am";
   // Is it a.m. or p.m.?
 if (h > 12) h -= 12;
   // Convert 24-hour format to 12-hour
 if (h == 0) h = 12;
   // Convert 0 o'clock to midnight
 if (m < 10) m = "0" + m;
   // Convert 0 minutes to 00 minutes, etc.
 var t = 'Luxury Holiday Apartments in Puerto Banus, Marbella.  Now is the time to book at  ' + h + ':' + m + ' ' + ampm + ' - just call +44 7703 326672';
   // Put it all together

    defaultStatus = t;
      // Display it in the status line

    // Arrange to do it all again in one minute
    setTimeout("display_time_in_status_line(  )", 60000);
      // 60000 ms is one minute
}

function dateNarrative() {
   var xx="th"
   mydate = new Date();
   myday = mydate.getDay();
   myweekday= mydate.getDate();
   mymonth = mydate.getMonth();
   year = mydate.getYear();
   year+=(year<1900) ? 1900 : 0;
   if (myweekday==1 || myweekday==21 || myweekday==31) { xx="st" }
   if (myweekday==2 || myweekday==22) { xx="nd" }
   if (myweekday==3 || myweekday==23) { xx="rd" }
   arday = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
   armonth = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
   return arday[myday] + ", " + myweekday + xx + " " + armonth[mymonth] + " " + year;
}

function weather() {
		var day="";
		var month="";
		var myweekday="";
		var year="";

		newdate = new Date();
		timevalue = newdate.getTime()
		days_since_jan_1_1970 = Math.floor(timevalue / (1000 * 60 * 60 * 24));

		mydate = new Date();
		myhours = mydate.getHours();
		

		if (myhours >= 12) {
			if (myhours >= 17) {
			myhours = (myhours == 17) ? 0 : myhours; msg0 = "This evening's";
			}
			else {
			myhours = (myhours == 12) ? 12 : myhours; msg0 = "This afternoon's";
			}}
			else {
			myhours = (myhours == 0) ? 12 : myhours; msg0 = "This morning's";
			}
		
		return (msg0 + ' <font color="#804000"><b>weather</b></font> on');
}


