// Footer and other general page functions


function footer(CopyrightYear,PublicationDate)
{
// ¦:-)
if ( CopyrightYear.length>4 )
	{CopyrightYear = CopyrightYear.substring(CopyrightYear.length-4)}


// this section strips the protocol and host off the url
// you may need to add an if statement for your local configuration

DLH = document.location.href;
UrlPrefix='';

// main site
if(DLH.substring(0,22)=='http://www.abd.org.uk/')
	{SitePath=DLH.substring(22)}

// remote sites
if(DLH.substring(0,35)=='http://www.rivals.talktalk.net/abd/' || DLH.substring(0,34)=='http://www.rx7-uk.co.uk/~abdcambs/' || DLH.substring(0,40)=='http://homepage.virgin.net/stockton.abd/' || DLH.substring(0,34)=='http://www.rx7-uk.co.uk/~abdherts/' || DLH.substring(0,25)=='http://www.gal54.com/abd/')
	{UrlPrefix="http://www.abd.org.uk/"}


// local Virtual Host
IsLocal=DLH.search('.local/')
if(IsLocal)
	{
	SitePath=DLH.substring(IsLocal+7);
	}

// this will eventually obliviate all this code anyway :-)

// cmw local pc
if(DLH.substring(0,32).toLowerCase()=='file://localhost/d:/abd/nildram/')
	{
	SitePath=DLH.substring(32);
	IsLocal==true;
	}

// cmw local mac
if(DLH.substring(0,43).toLowerCase()=='file://localhost/users/chrisward/sites/abd/')
	{
	SitePath=DLH.substring(43);
	IsLocal==true;
	}

// set site UrlPrefix if not already done
if(UrlPrefix== '')
	{
   while(SitePath.indexOf('/')!=-1)
   	{
   	SitePath = SitePath.substring(SitePath.indexOf('/')+1)
   	UrlPrefix = UrlPrefix + '../'
   	}
	}


if (PageWidth()>840)
	{
	// show left side banner
	document.writeln('<TABLE CLASS=FOOTER BORDER=0 CELLSPACING=0 CELLPADDING=0><TBODY><TR><TD ID="FooterLeft" CLASS="DoNotPrint" WIDTH=144><DIV ID="google_translate_element"></DIV></TD><TD STYLE="text-align:center;">');
	}

lmtime=new Date(document.lastModified);
lmyear=lmtime.getYear();

if (lmyear<10) {lmyear="200" + lmyear}
if (lmyear<100) {lmyear="20" + lmyear}
if (lmyear>=100 && lmyear<=999) {lmyear=1900+lmyear}

lmmonth=lmtime.getMonth()+1;
if (lmmonth<10) {lmmonth="0"+lmmonth}

lmdate=lmtime.getDate();
if (lmdate<10) {lmdate="0" + lmdate}

document.writeln('<SMALL CLASS=FOOTER>');

document.writeln('Copyright &copy; Pro-Motor Ltd ' + CopyrightYear);

if (PublicationDate!=null)
	{document.writeln(' &bull; First published ' + PublicationDate);}

// trap remote servers that don't return a mod date
if(lmyear!=2070)
	{document.writeln(' &bull; Last updated ' + lmyear + "-" + lmmonth + "-" + lmdate);}

document.writeln('<BR>');

// Only display URL if on main site, or local drive (i.e. not on a remote local site)
if (location.href.substring(0,21)=="http://www.abd.org.uk" || IsLocal || location.href.substring(0,7)=="file://")
   {
   document.writeln('URL:&mdash; ');
	//document.writeln('<BR>');
   document.writeln('<A HREF="' + location.href + '" CLASS=FOOTER>');
   document.writeln(location.href);
   document.writeln('</A><BR>');
   }

Moment = new Date()
document.writeln('<SPAN CLASS=PrintOnly>Printed ' + Moment.toLocaleString() + ' UTC<BR></SPAN>');

// share buttons

document.writeln('<SPAN CLASS=DoNotPrint>&nbsp;<BR>Share:&mdash; &nbsp;');

document.writeln('<A HREF="http://www.facebook.com/sharer.php?u=' + location.href + '" TITLE="Share on Facebook" TARGET="_blank"><IMG SRC="' + UrlPrefix + '../images/icons/facebook_16x16.gif" WIDTH=16 HEIGHT=16 BORDER=0 ALIGN=MIDDLE></A> &nbsp;');

document.writeln('<A HREF="http://twitter.com/home?status=' + escape(location.href) + '" TITLE="Tweet" TARGET="_blank"><IMG SRC="' + UrlPrefix + '../images/icons/twitter_16x16.png" WIDTH=16 HEIGHT=16 BORDER=0 ALIGN=MIDDLE></A>');

document.writeln('</SPAN>');

if (PageWidth()>840)
	{
	// show right side banner
	BannerPoint=new Date()
	DeciSeconds=BannerPoint/100
	choices=2
	BannerNumber=Math.floor(choices*(DeciSeconds/choices-Math.floor(DeciSeconds/choices)));
   // enable to test latest
   //BannerNumber=choices-1
   switch(BannerNumber)
      {
      case 0:
   		// Facebook
   		document.writeln('</TD><TD ID="FooterRight" CLASS=DoNotPrint WIDTH=144><A HREF="http://www.facebook.com/associationofbritishdrivers" TARGET="_blank" TITLE="Support the ABD on Facebook" STYLE="float:right;z-index:-1;"><IMG SRC="' + UrlPrefix + '../images/find_us_on_facebook_badge.gif" WIDTH=144 HEIGHT=44 BORDER=0></A></TD></TR></TBODY></TABLE>');
   		break;
      case 1:
   		// Twitter
   		document.writeln('</TD><TD ID="FooterRight" CLASS=DoNotPrint WIDTH=144><A HREF="http://twitter.com/TheABD" TARGET="_blank" TITLE="Follow the ABD on Twitter" STYLE="float:right;z-index:-1;"><IMG SRC="' + UrlPrefix + '../graphics/logos/twitter.png" WIDTH=144 HEIGHT=44 BORDER=0></A></TD></TR></TBODY></TABLE>');
   		break;
   		}
	}

}





/*
function googleTranslateElementInit()
	{
	new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
	}

document.write('<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>')
*/


