
/** Working variables **/
var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

g_a=parent.document.URL;
g_b=g_a.indexOf('/',7)
g_a=g_a.substring(g_b,g_a.length);
g_b=g_a.indexOf('/',1)

path=g_a.substring(0,g_b);

thistab=0;

whichpic=0;
speed=2500;
blendtime=1000;
adevery=5; // insert ad every number of pictures

pagetype="";

// create date for test change
var testchangedate=new Date();
testchangedate.setFullYear(2013,0,19);
// work out days from today
var todaydate=new Date(); 
daystotestchange=Math.ceil((testchangedate.getTime() - todaydate.getTime())/(1000*60*60*24)) -1 ;



pics = new Array("p1s.jpg", "p5s.jpg","orpic6.jpg","p9s.jpg", "p12s.jpg", "p6s.jpg", "orpic12.jpg", "p10s.jpg", "p13s.jpg", "p2s.jpg","p4s.jpg","p11s.jpg","p7s.jpg","orpic16.jpg","p3s.jpg","p14s.jpg","p8s.jpg","orpic8.jpg"); 

pictitle = new Array("Direct Access on the road from £ 130 per day", "CBT 125cc training from £ 105","Off-Road centre endurance course","CBT 50cc training from £ 105", "CAT-ONE Advanced road riding course","CBT classroom session","Off-road centre trials section","CBT Moped pre-road training","CAT-ONE Advanced road riding course", "Direct access road side briefing","125cc CBT road section","CAT-ONE Advanced road riding course","Module 1 test preparation","Off-road centre sleepers in the trials section ","DAS Test preparation practice", "CAT-ONE Advanced road riding course","Progressive Access 125cc Test preparation practice","Off-road center endurance hill climb");

pichref=new Array("das.html", "cbt.html","offroad.html","cbt.html","http://www.cat-one.co.uk/advanced.html","cbt.html","offroad.html","cbt.html", "http://www.cat-one.co.uk/advanced.html","das.html","cbt.html","http://www.cat-one.co.uk/advanced.html","pretest125.html","offroad.html","das.html","http://www.cat-one.co.uk/advanced.html","pretest125.html","offroad.html")
imagesCache = new Array ();
//piccount=random(3,pics.length);
piccount=4;

adpics = new Array("ad1mc.gif","ad2mc.gif", "ad3mc.gif", "ad1or.gif", "ad2or.gif",  "adcat1.gif", "ad4mc.gif"); 
adtitle = new Array("CBT from £ 105", "Direct Access @ £130 per day", "Progressive Access 125cc Test Prep starting from £105", "Off-Road School now open","Public Off-Road courses now booking","CAT-ONE motorcycle training","Changes to the motorcycle test and restriction change in January 2013" );
adhref = new Array("cbt.html", "das.html", "pretest125.html", "offroad.html","orpublic.html", "http://www.cat-one.co.uk/advanced","testchange.html");
adall = new Array(6,5,0,1,5,6,3,2,5,4);
adtc = new Array(5,0,1,5,3,2,4);
admc = new Array(6,5,0,6,1,5,2);
ador = new Array(3,4);
adCache = new Array ();
adcounter=5; // current count. 1=start from scratch upto "adevery" (immed ad on first change) -1=no adverts
adnbr=0; // Starting at ad
//adnbr=random(0,adpics.length); // moved to header

g_headline = new Array();
g_summary = new Array();
g_date = new Array();

/** Ticker for motorcycle training **/
tt = new Array("Test change","MOTOX, Trials and off-road beginners 1 day foundation courses now available. . . . click here for more information", "Advanced motorcycle training course. . . Click here to access our partners at the CAT-ONE training web site","From 1st July 2011 you must wear suitable motorcycle clothing for you DSA motorcycle practical tests. Click here to read more.");

tttitle = new Array("Motorcycle test changes on the 19th January 2013, CLICK for more details", "Off-Road beginners foundation course","CAT-ONE advanced training, Advanced course as a Christmas Gift ?","DSA clothing requirements for motorcycle tests");

tthref = new Array("testchange.html", "orpublic.html","http://www.cat-one.co.uk/advanced.html","motorcycle_test_clothing.html");

tt[0]="IMPORTANT:- From 19th January 2013 ("+daystotestchange+" days time) Motorcycle licence and test restrictions will be changing.......CLICK HERE for more details";

ttline=0;
ttpos=1;

/** End of ticker **/

/** Tracking processing **/
var unique=new Date().getTime();
trackingref = new Image();
trackingref.src = "http://www.trac2.co.uk/trac2.gif?p="+document.URL+"&r="+document.referrer+"&t="+unique;
/** End of tracking **/


/**	standard header	**/

function header(n)
{
document.write('<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>');
logo='./images/logo.gif';
title="90-ONE Education:- 0845 370 9191. Call 7 Days a week";
href="./";
if (n=="tc"){logo='./images/tclogo2.jpg';title="Take Control:- 0845 370 9191. Call 7 Days a week"; href="takecontrol.html";}
if (n=="r"){logo='./images/logorider.gif';title="90-One Rider Education:- 0845 370 9191. Call 7 Days a week"; href="mctrain.html";}
if (n=="y"){logo='./images/logoyouth.gif';title="90-One Youth Education:- 0845 370 9191. Call 7 Days a week"; href="youthclubs.html";}
if (n=="s"){logo='./images/logoschools.gif';title="90-One Schools Education:- 0845 370 9191. Call 7 Days a week"; href="schoolcourses.html";}
if (n=="o"){logo='./images/logooffroad.gif';title="90-One Off-Road Education:- 0845 370 9191. Call 7 Days a week"; href="offroad.html";}
//set up advert stuff
if ((n=='s') || (n=='y')) {adcounter=-1} else {acounter=adevery} //(every 5th picture change if not schools or youth
adnbr=random(0,adpics.length);
if (n=='tc') {adnbr=random(0,adtc.length);}
if (n=='r'){adnbr=random(0,admc.length);}
if (n=='o'){adnbr=0;}

var today = new Date();
replace='<table width=100%><tr>';  
replace=replace+"<td width=50px>&nbsp;</td>";
//replace=replace+'<td width=200px><div style="background-image: url('+logo+'); background-repeat: no-repeat; width: 200px; height: 100px;" id="blenddiv7"><img src='+logo+' style="width: 200px; height: 100px; border: none;  -moz-opacity: 0; opacity: 0;" id="logo" alt="'+title+'" title="'+title+'" width=150px height=100px></td>';

replace=replace+'<td width=200px><a href="'+href+'"><img src='+logo+' style="width: 200px; height: 100px; border: none;" alt="'+title+'" title="'+title+'" width=150px height=100px></a></td>';

replace=replace+"<td width=50px>&nbsp;</td>";

//replace=replace+'<td width=150px><div style="background-image: url(./images/adblank.gif); background-repeat: no-repeat; width: 150px; height: 100px;" id="adblenddiv"><a href="" id="adlinkdiv"><img src=./images/adblank.gif style="width: 150px; height: 100px; border: none;  -moz-opacity: 0; opacity: 0;" id="adhpic" alt="Pricing Advert" title="'+adtext[0]+'"Pricing advert" width=150px height=100px></a></div></td>';



replace=replace+'<td width=150px><div style="background-image: url(./images/'+pics[0]+'); background-repeat: no-repeat; width: 150px; height: 100px;" id="blenddiv0"><a href='+pichref[0]+' id=picref0><img src=./images/'+pics[0]+' style="width: 150px; height: 100px; border: none;  -moz-opacity: 0; opacity: 0;" id="hpic0" alt="'+pictitle[0]+'" title="'+pictitle[0]+'" width=150px height=100px></a></div></td>';

replace=replace+'<td width=150px><div style="background-image: url(./images/'+pics[1]+'); background-repeat: no-repeat; width: 150px; height: 100px;" id="blenddiv1"><a href='+pichref[1]+' id=picref1><img src=./images/'+pics[1]+' style="width: 150px; height: 100px; border: none; -moz-opacity: 0; opacity: 0;" id="hpic1" alt="'+pictitle[1]+'" title="'+pictitle[1]+'" height=100px width=150px></a></div></td>';

replace=replace+'<td width=150px><div style="background-image: url(./images/'+pics[2]+'); background-repeat: no-repeat; width: 150px; height: 100px;" id="blenddiv2"><a href='+pichref[2]+' id=picref2><img src=./images/'+pics[2]+' style="width: 150px; height: 100px; border: none; -moz-opacity: 0; opacity: 0;" id="hpic2" alt="'+pictitle[2]+'" title="'+pictitle[2]+'" height=100px width=150px></a></div></td>';

replace=replace+'<td width=150px><div style="background-image: url(./images/'+pics[3]+'); background-repeat: no-repeat; width: 150px; height: 100px;" id="blenddiv3"><a href='+pichref[3]+' id=picref3><img src=./images/'+pics[3]+' style="width: 150px; height: 100px; border: none; -moz-opacity: 0; opacity: 0;" id="hpic3" alt="'+pictitle[3]+'" title="'+pictitle[3]+'" height=100px width=150px></a></div></td>';
replace=replace+"<td width=100px>&nbsp;</td>";

replace=replace+'</tr></table>';
document.getElementById("header").innerHTML=replace;
//if (n!="tc"){document.getElementById("header").innerHTML=replace;}
//if (n=="tc"){document.getElementById("headertc").innerHTML=replace;}

//b=setTimeout("adanimatectrl()",adspeed);
picsloaded=loadpics();
pagetype=n;
a=setTimeout("animatectrl()",speed);

}

function headerd(n)
{
logo='./images/logo.gif';
title="90-ONE Education:- 0845 370 9191. Call 7 Days a week";
href="./";
logo='./images/logorider.gif';title="90-One Rider Education:- 0845 370 9191. Call 7 Days a week"; href="mctrain.html";

var today = new Date();
replace='<table width=100%><tr>';  
replace=replace+"<td width=50px>&nbsp;</td>";
//replace=replace+'<td width=200px><div style="background-image: url('+logo+'); background-repeat: no-repeat; width: 200px; height: 100px;" id="blenddiv7"><img src='+logo+' style="width: 200px; height: 100px; border: none;  -moz-opacity: 0; opacity: 0;" id="logo" alt="'+title+'" title="'+title+'" width=150px height=100px></td>';

replace=replace+'<td width=200px><a href="'+href+'"><img src='+logo+' style="width: 200px; height: 100px; border: none;" alt="'+title+'" title="'+title+'" width=150px height=100px></a></td>';

replace=replace+"<td width=50px>&nbsp;</td>";



replace=replace+'<td width=600px><h2>Working in partnership<br>with the motorcycle industry</h2></td>';

replace=replace+"<td width=100px>&nbsp;</td>";

replace=replace+'</tr></table>';
document.getElementById("header").innerHTML=replace;


}




function at()
{
document.write("@");
}


function menu(tab)
{
q='"';
q2="'";
var today = new Date();
var year = today.getFullYear();
var month = today.getMonth();
month=month+1;
var day = today.getDate();
if (month<10){month="0"+month;}
if (day<10){day="0"+day;}
var isodate=year+""+month+""+day;

document.write('<div id=menu class=menu><center><table width=98%><tr>');

if (tab==1){document.write('<td class=menuonhome onclick="window.location.replace('+q2+'./'+q2+')" title="90-ONE Education: School courses, motorbike, moped & scooter lessons, CBT, DAS &amp; advanced. Youth clubs and Secondary schools. Teaching, training"></td>');}
if (tab!=1){document.write('<td class=menuoffhome onclick="window.location.replace('+q2+'./'+q2+')" title=" 90-ONE Education: School courses, motorbike, moped & scooter lessons, CBT, DAS &amp; advanced. Youth clubs and Secondary schools. Teaching, training."></td>');}

document.write('<td class=menusep> </td>');

if (tab==2){document.write('<td class=menuon id=menuriderid><center><a href=mctrain.html title="Motorbike, moped & scooter lessons. From CBT, DAS, Test Preparation to Advanced on 50cc 125cc or 500cc machines. Includes licence and motorcycle test information" onmouseover=mopen("menurider") onmouseout=mclosetime()>Motorcycle Training</center>');}

if (tab!=2){document.write('<td class=menuoff id=menuriderid><center><a href=mctrain.html title="Motorbike, moped & scooter lessons. From CBT, DAS, Test Preparation to Advanced on 50cc 125cc or 500cc machines. Includes licence and motorcycle test information" onmouseover=mopen("menurider");menuon("menuriderid") onmouseout=mclosetime();menuoff("menuriderid")>Motorcycle Training</center>');}

document.write('<div id="menurider" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="intro2bike.html" title="Thinking about riding a scooter or a motorbike? Never ridden a powered machine before? Then this is for you. Experience riding before you start your CBT, scooter or motorbike lessons.">Introduction to Biking</a><a href="cbt.html" title="CBT / Compulsory Basic Training. Get your DL196 CBT certificate to validate your provisional licence. Moped, scooter or Motorbike. Start biking here.">Compulsory Basic Training (CBT)</a><a href="pretest125.html" title="Motorbike test preparation, how to pass your motorbike test">Progressive Access (125cc Test)</a><a href="das.html" title="DAS / Direct Access Scheme, motorbike lessons. Prepare for your big bike motorcycle test.">Direct Access (DAS)</a><a href="accelerated.html" title="Over 21 and passed a full motorcycle test but are on a restricted motorbike licence. You can ride a bike of more than 33bhp, by using the Accelerated Access programme">Accelerated Access</a><a href="advanced.html"  title="Full motorbike licence holders with a good level of riding experience will benefit from 90-ONE Education advanced days. Gain the tips, tricks and techniques used by the professionals from the exemplary teaching skills of our advanced instructor team.">Advanced Days</a><a href="back2biking.html" title="Returning to biking ? If you have a full motorcycle licence but have not ridden for a number of years, then this course is for you. Improvements in motorcycle technology and clothing means motorcycling has changed.">Back to Biking</a><a href="gearbox.html" title="Learn to use a motorbike gearbox and clutch. Ideal for Moped riders moving onto bigger bikes">Gearbox Training</a><a href="hire.html" title="Motorbike, moped and scooter hire can be arranged for most of the 90-ONE education motorcycle training courses. independent hire of 125cc motorbikes and be arranged for your motorcycle test day">Motorbike Hire</a><a href="sites.html" title="Obelisk centre in Kingsthorpe, Northampton. Close to University of Northampton and Moulton College serves Northamptonshire, Daventry, Wellingborough, Rushden, Earls Barton, Irthlingborough, Brixworth, Kettering, Corby, Desborough, Rothwell and their surrounding villages. The Coventry site at Pinley Rugby Club serves Warwickshire including Rugby, Kenilworth, Bedworth, Nuneaton, Bulkington, Binley, Knowle, Leamington Spa, Tile Hill, Stoneleigh, Solihull and areas of Leicestershire.">Training Sites</a><a href=kit.html title="Motorcycle safety helmets, gloves and accessories can be purchased directly from 90-ONE Education when you attend your course">Helmets &amp; Accessories</a><a href=motorcycle_test_clothing.html title="Motorcycle test clothing guide">Motorcycle Test Clothing guide</a><a href=testchange.html title="January 2013 motorcycle licence changes">Licensing changes Jan. 2013</a><a href="faqmc.html" title="Motorbike test, lessons and training on scooter, moped or motorbike. Answers to your questions">Questions (FAQs)</a><a href="courseapp.html" title="Motorbike, scooter and moped training course On-Line enquiry. CBT, DAS and other lessons can be enquired about here">Enquire On-Line + Pricing</a><a href=gift.html title="Gift vouchers and certificates for Scooter, moped and motorcycles training and lessons. An ideal gift for birthday or Christmas present etc.">Gift Vouchers &amp; Certificates</a><a href="http://www.facebook.com/group.php?v=wall&ref=ts&gid=162778944906" target=_blank  title="Link to Facebook for 90-ONE Education"><img src="./images/facebook icon.jpg" height=14px width=14px border=0 valign=bottom>Facebook</a></div></td>');

document.write('</td><td class=menusep> </td>');

if (tab==3){document.write('<td class=menuon id=menutcid><center><a href=takecontrol.html title="Now replaced by CAT-ONE training" onmouseover=mopen("menutc") onmouseout=mclosetime()>Take Control</center>');}

if (tab!=3){document.write('<td class=menuoff id=menutcid><center><a href=takecontrol.html title="Now replaced by CAT-ONE training"onmouseover=mopen("menutc");menuon("menutcid") onmouseout=mclosetime();menuoff("menutcid")>Take Control</center>');}

document.write('<div id="menutc" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="http://www.cat-one.co.uk"  title="CAT-ONE training web site">Now CAT-ONE training</a></div></td>');

document.write('<td class=menusep> </td>');

if (tab==4){document.write('<td class=menuon id=menuyouthid><center><a href=youthclubs.html title="90-ONE Youth Education. Drive a car and ride a moped at your youth club even if you are under 16 years of age" onmouseover=mopen("menuyouth") onmouseout=mclosetime()>Youth Clubs</center>');}

if (tab!=4){document.write('<td class=menuoff id=menuyouthid><center><a href=youthclubs.html title="90-ONE Youth Education. Drive a car and ride a moped at your youth club even if you are under 16 years of age" onmouseover=mopen("menuyouth");menuon("menuyouthid") onmouseout=mclosetime();menuoff("menuyouthid")>Youth Clubs</center>');}

//document.write('<div id="menuyouth" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="youthclubs.html" title="90-ONE Youth Education. Drive a car and ride a moped at your youth club even if you are under 16 years of age">Youth Clubs</a><a href="youthcars.html">Cars</a><a href="youthbikes.html">Bikes</a><a href="faqyouth.html">Questions (FAQs)</a></div></td>');

document.write('<div id="menuyouth" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="youthclubs.html" title="90-ONE Youth Education. Drive a car and ride a moped at your youth club even if you are under 16 years of age">Youth Clubs</a><a href="faqyouth.html" title="Answer to your questions about 90-ONE Youth Education, and how 90-ONE Education works with teenagers">Questions (FAQs)</a></div></td>');
document.write('<td class=menusep> </td>');

if (tab==5){document.write('<td class=menuon id=menuschoolsid><center><a href=schoolcourses.html title="90-ONE Schools Education. The courses 90-ONE Education run in schools, GCSEs and qualifications" onmouseover=mopen("menuschools") onmouseout=mclosetime()>Schools</center>');}

if (tab!=5){document.write('<td class=menuoff id=menuschoolsid><center><a href=schoolcourses.html title="90-ONE Schools Education. The courses 90-ONE Education run in schools, GCSEs and qualifications" onmouseover=mopen("menuschools");menuon("menuschoolsid") onmouseout=mclosetime();menuoff("menuschoolsid")>Schools</center>');}

//document.write('<div id="menuschools" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="schoolcourses.html">Courses</a><a href="schoolsexpect.html">Expectations</a><a href="faqschools.html">Questions (FAQs)</a></div></td>');

document.write('<div id="menuschools" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="schoolcourses.html" title="90-ONE Schools Education. The courses 90-ONE Education run in schools, GCSEs and qualifications">Courses</a><a href="faqschools.html" title="School Courses, lessons, teachers, qualifications, insurance, safety, risk assessment etc. All you questions are answered here.">Questions (FAQs)</a></div></td>');


document.write('<td class=menusep> </td>');


if (tab==6){document.write('<td class=menuon id=menuorid><center><a href=offroad.html title="Off road rider training school." onmouseover=mopen("menuor") onmouseout=mclosetime()>Off-Road School</center>');}

if (tab!=6){document.write('<td class=menuoff id=menuorid><center><a href=offroad.html title="COMING SOON:- Off road rider training school in Wellingborough." onmouseover=mopen("menuor");menuon("menuorid") onmouseout=mclosetime();menuoff("menuorid")>Off-Road School</center>');}

document.write('<div id="menuor" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="orpublic.html" title="off-road, motox motorcycle off road course for beginners">Beginners day course</a><a href="orcourses.html" title="off-road motorcycle / motox Educational training courses">Educational Courses</a><a href="orfacility.html" title="The training site and facilities">The Facility</a><a href="orkit.html" title="The motorbike and equipment">Equipment</a><a href="orloc.html" title="Location and directions to the Off-Road training site">Getting there</a><a href="orhistory.html" title="The background behind the Off-Road rider training school">Background</a><a href="offroadpdf.html" title="Off road rider training leaflet in PDF format">Leaflet in PDF format</a><a href="faqor.html" title="Off road facility, courses, education, equipment, staff.  Answers to your questions">Questions (FAQs)</a></div></td>');


document.write('<td class=menusep> </td>');



if (tab==7){document.write('<td class=menuon id=menuabout><center><a href="history.html" title="The history of 90-ONE education. How did motorbike racing lead to the 90-ONE Education name ?">History</a></center></td>');}
if (tab!=7){document.write('<td class=menuoff id=menuabout><center><a onmouseover=menuon("menuabout") onmouseout=menuoff("menuabout") href="history.html" title="The history of 90-ONE education. How did motorbike racing lead to the 90-ONE Education name ?">History</a></center></td>');}

//if (tab==7){document.write('<td class=menuon id=menuaboutid><center><a href=# onmouseover=mopen("menuabout") onmouseout=mclosetime()>About</center>');}
//if (tab!=7){document.write('<td class=menuoff id=menuaboutid><center><a href=about.html  onmouseover=mopen("menuabout");menuon("menuaboutid") onmouseout=mclosetime();menuoff("menuaboutid")>About</center>');}

//document.write('<div id="menuabout" onmouseover="mcancelclosetime()" onmouseout=mclosetime()><a href="about.html">About 90-ONE</a><a href="history.html">History</a></div></td>');



document.write('<td class=menusep> </td>');

//if (tab==8){document.write('<td class=menuon id=menusites><center><a href="sites.html">sites</a></center></td>');}
//if (tab!=8){document.write('<td class=menuoff id=menusites><center><a onmouseover=menuon("menusites") onmouseout=menuoff("menusites") href="sites.html">Sites</a></center></td>');}
//document.write('<td class=menusep> </td>');

//if (tab==9){document.write('<td class=menuon id=menufaq><center><a href="faq.html">FAQs</a></center></td>');}
//if (tab!=9){document.write('<td class=menuoff id=menufaq><center><a onmouseover=menuon("menufaq") onmouseout=menuoff("menufaq") href="faq.html">FAQs</a></center></td>');}
//document.write('<td class=menusep> </td>');



if (tab==10){document.write('<td class=menuon id=menucontactsid><center><a href="contacts.html" title="Contact 90-ONE Education, phone no, email and contact form">Contacts</center>');}
if (tab!=10){document.write('<td class=menuoff id=menucontactsid><center><a onmouseover=menuon("menucontactsid") onmouseout=menuoff("menucontactsid") href="contacts.html" title="Contact 90-ONE Education, phone no, email and contact form">Contacts</a></center></td>');}


document.write('<td class=menusep> </td>');

if (tab==11){document.write('<td class=menuon id=menulinks><center><a href="links.html" title="Our useful web site and internet links to local companies">Links</a></center></td>');}
if (tab!=11){document.write('<td class=menuoff id=menulinks><center><a onmouseover=menuon("menulinks") onmouseout=menuoff("menulinks") href="links.html" title="Our useful web site and internet links to local companies">Links</a></center></td>');}

document.write('<td class=menusep> </td>');

if (tab==12){document.write('<td class=menuon id=menusitemap><center><a href="sitemap.html" title="A Site map, all the links, all the pages from 90-One Education. Everything you need to know about motorcycle training, schools and us. An easy to use navigation tool for this website.">Site map</a></center></td>');}
if (tab!=12){document.write('<td class=menuoff id=menusitemap><center><a onmouseover=menuon("menusitemap") onmouseout=menuoff("menusitemap") href="sitemap.html" title="A Site map, all the links, all the pages from 90-One Education. Everything you need to know about motorcycle training, schools and us. An easy to use navigation tool for this website.">Site map</a></center></td>');}



/*if (tab==9){document.write('<td class=menuon id=menucontacts><center><a href="contacts.html">Contacts</a></center></td>');}
if (tab!=9){document.write('<td class=menuoff id=menucontacts><center><a  onmouseover=menuon("menucontacts") onmouseout=menuoff("menucontacts") href="contacts.html">Contacts</a></center></td>');}
document.write('<td class=menusep> </td>'); */

if (tab==2){document.write("<td class=menusep> </td><td class=menuoff width=26px><a href='http://www.facebook.com/group.php?v=wall&ref=ts&gid=162778944906' target=_blank  title='Link to Facebook for 90-ONE Education'><img src='./images/facebook mid icon.jpg' height=26px width=26px border=0></a></td>");}



document.write('<td class=menusep> </td>');
document.write('<td class=menuoff id=googleplus1 width=40px valign=top><g:plusone count="false"></g:plusone></td>');



document.write('</tr></table></div>');
document.write('<div id=menuline></div>');

if (tab==2) {
  document.write('<div id=ticker onmouseover=tickerrun(1); onmouseout=tickerrun(2)><a href=# id=tickerhref></a></div>');
  thistab=tab;

  }

//document.write('<div style="clear:both"></div>');

}

function menuon(tab)
{
document.getElementById(tab).setAttribute("className", "menuhover");
document.getElementById(tab).setAttribute("class", "menuhover");
}

function menuoff(tab)
{
document.getElementById(tab).setAttribute("class", "menuoff")
document.getElementById(tab).setAttribute("className", "menuoff")
}

function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();
	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
function mclose2()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose2, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 
/**	Generate Standard footer	**/

function footer(adtype)
{
var today = new Date();
var year = today.getFullYear();
replace="";
replace=replace+'<center><table width=100%><tr>';
replace=replace+'<td width=300px>&copy; '+year+' 90-ONE Education</td>';
replace=replace+'<td class=footerm><a href="./" title="School courses, motorbike, moped & scooter lessons, CBT, DAS &amp; advanced. Youth clubs and Secondary schools. Teaching, training. . . This is 90-ONE Education">Home</td>';
replace=replace+'<td class=footerm><a href="mctrain.html" title="Motorbike, moped & scooter lessons. From CBT, DAS, Test Preparation to Advanced on 50cc 125cc or 500cc machines. Includes licence and motorcycle test information">Motorcycle Training</td>';
replace=replace+'<td class=footerm><a href="http://www.cat-one.co.uk" title="CAT-ONE motorcycle training">CAT-ONE</td>';
replace=replace+'<td class=footerm><a href="youthclubs.html" title="90-ONE Youth Education. Drive a car and ride a moped at your youth club even if you are under 16 years of age">Youth</td>';
replace=replace+'<td class=footerm><a href="schoolcourses.html" title="90-ONE Schools Education. The courses 90-ONE Education run in schools, GCSEs and qualifications">Schools</td>';
replace=replace+'<td class=footerm><a href="offroad.html" title="Off-road rider training school in Wellingborough">Off-Road School</td>';
replace=replace+'<td class=footerm><a href="history.html" title="The history of 90-ONE education. How did motorbike racing lead to the 90-ONE Education name ?">History</td>';
//replace=replace+'<td class=footerm><a href="sites.html" title="Obelisk centre in Kingsthorpe, Northampton. Close to University of Northampton and Moulton College serves Northamptonshire, Daventry, Wellingborough, Rushden, Earls Barton, Irthlingborough, Brixworth, Kettering, Corby, Desborough, Rothwell and their surrounding villages. The Coventry site at Pinley Rugby Club serves Warwickshire including Rugby, Kenilworth, Bedworth, Nuneaton, Bulkington, Binley, Knowle, Leamington Spa, Tile Hill, Stoneleigh, Solihull and areas of Leicestershire.">Sites</td>';
//replace=replace+"<td class=footerm><a href="faq.html">FAQ's</td>";
replace=replace+'<td class=footerm><a href="contacts.html" title="Contact 90-ONE Education, phone no, email and contact form">Contacts</td>';
replace=replace+'<td class=footerm><a href="links.html" title="Our useful web site and internet links to local companies">Links</td>';
replace=replace+'<td class=footerm><a href="sitemap.html" title="A Site map, all the links, all the pages from 90-One Education. Everything you need to know about motorcycle training, schools and us. An easy to use navigation tool for this website.">Site Map</td>';
replace=replace+'</tr></table>';




//------------ adverts section --------------//

if (adtype=="MC")
{
  replace=replace+'<div id=footerads>';
  replace=replace+'<table><tr>';
//  replace=replace+'<td><a href="http://www.mceinsurance.com/bike-insurance/?referrer=0000" target=_blank><img src="http://www.mceinsurance.com/images/mce-bike-insurance-468-60.gif" width="400" height="60" title="QUOTE REF 0000 when talking to MCE. Bike (Motorbike and Motorcycle) Insurance - Scooter, Moped, Quad Bike and Trike Insurance Quotes from MCE Insurance."></a></td>';

replace=replace+'<td><a href="http://www.motorcycleworld.uk.com" target="_blank"><img src="./images/ad motorcycle world.gif" width="200" height="60" title="Motorcycle world northampton." onclick=log_link_out("www.motorcycleworld.uk.com")></a></td>';


replace=replace+'<td><a href="http://coventrymotorcycles.co.uk/bikes/index.php" target="_blank"><img src="./images/ad cms.jpg" width="200" height="60" title="Coventry Motorcycles and Scooters." onclick=log_link_out("coventrymotorcycles.co.uk")></a></td>';

replace=replace+'<td><a href="http://www.mickberrillmc.co.uk" target="_blank"><img src="./images/ad mick berrill.gif" width="200" height="60" title="Mick Berrill motorcycles Northampton" onclick=log_link_out("www.mickberrillmc.co.uk")></a></td>';

replace=replace+'<td><a href="http://bikersworldshops.co.uk" target="_blank"><img src="./images/ad bikers world.gif" width="200" height="60" title="Bikers World Daventry." onclick=log_link_out("bikersworldshops.co.uk")></a></td>';

replace=replace+'<td><a href="http://www.motorbike-warehouse.co.uk/index.php" target="_blank"><img src="./images/ad motorbike warehouse.jpg" width="200" height="60" title="Motorbike Warehouse Northampton." onclick=log_link_out("www.motorbike-warehouse.co.uk")></a></td>';

replace=replace+'</tr><tr>';

replace=replace+'<td colspan=5 align=center><a href="link2us.html"><img src="./images/link2us.gif" width="200" height="60" title="Get you link put here, promote your business by linking up with 90-ONE education."></a></td>';




  replace=replace+'</tr></table>';
  replace=replace+'</div>';
}


document.getElementById("footerd").innerHTML=replace;
if (thistab==2){  onload=tickerrun(0);}
}

function log_link_out(site)
{

var unique=new Date().getTime();
adtrackref = new Image();
adtrackref.src = "http://www.trac2.co.uk/trac2.gif?p="+document.URL+"&ad="+site+"&t="+unique;

}


/*----------------------------------------------------------------------------------------------------------------*/
function mailto(who,domain)
{
mail=who+'@'+domain
document.write('<a href=mailto:'+mail+'>'+mail+'</a>');
}
/******** Main animation *******/

function animatectrl()
{

  a=setTimeout("animatectrl()",speed);
  if (whichpic>3){whichpic=0;}
  blenddiv="blenddiv"+whichpic;
  bimage="hpic"+whichpic;
  pref="picref"+whichpic;
  htitle="hpic"+whichpic;
  if (adcounter!=-1){  adcounter++}
  if ((adcounter>adevery) && (adcounter!=-1))
    {
    adcounter=1;
    if (pagetype=='r'){x=admc[adnbr]}
    if (pagetype=='tc'){x=adtc[adnbr]}
    if (pagetype=='o'){x=ador[adnbr]}
    
    if ((pagetype!='r') && (pagetype!='tc') && (pagetype!='o')){x=adall[adnbr]}

    blendimage(blenddiv,bimage, adCache[x].src,blendtime);
      // change the title and alternate text and link
    document.getElementById(htitle).title = adtitle[x];
    document.getElementById(htitle).alt = adtitle[x];
    document.getElementById(pref).href=adhref[x];
    if (pagetype=='r') 
    {
      if (adnbr == admc.length-1) { adnbr = 0} else {adnbr++ }
    }
    if (pagetype=='tc') 
    {
      if (adnbr == adtc.length-1) { adnbr = 0} else {adnbr++ }
    }
    if (pagetype=='o') 
    {
      if (adnbr == ador.length-1) { adnbr = 0} else {adnbr++ }
    }



    if((pagetype!='tc') && (pagetype!='r') && (pagetype!='o'))
    {
      if (adnbr == adall.length-1) { adnbr = 0} else {adnbr++ }
    }
    
    }    
      
  else
  {
  blendimage(blenddiv,bimage, imagesCache[piccount].src,blendtime);
  // change the title and alternate text and link
  document.getElementById(htitle).title = pictitle[piccount];
  document.getElementById(htitle).alt = pictitle[piccount];
  document.getElementById(pref).href=pichref[piccount];
  if(piccount == imagesCache.length-1) 
    { 
    piccount = 0
    } else { 
    piccount++ 
    }    
  }
  whichpic++ ;
}



function blendimage(divid, imageid, imagefile, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
    //set the current image as background 
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 

    //make image transparent 
    changeOpac(0, imageid); 
     
    //make new image 
    document.getElementById(imageid).src = imagefile; 

    //fade in image 
    for(i = 0; i <= 100; i++) { 
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++; 
    } 
} 

function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}


function loadpics()
{
for (i=0;i<pics.length;i++) 
  { 
  imagesCache[i] = new Image();
  imagesCache[i].src = "./images/"+pics[i];
  }
for (i=0;i<adpics.length;i++) 
  {
  adCache[i] = new Image();
  adCache[i].src = "./images/"+adpics[i];
  }
  return true;
}


/**  Calc remaining characters for text areas(TEMP) **/

function textCounter(field, countfield, maxlimit) {

if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else 
countfield.value = maxlimit - field.value.length;
}

/*****************************************************/
/**                                                 **/
/**         Check email address is sort of valid    **/
/**                                                 **/
/*****************************************************/
function IsEmail(str) {
 
  var at="@"
  var dot="."
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)

  if (str.indexOf(at)==-1){
     return false
  }
  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
     return false
  }
  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
      return false
  }
   if (str.indexOf(at,(lat+1))!=-1){
      return false
   }
   if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
      return false
   }
   if (str.indexOf(dot,(lat+2))==-1){
      return false
   }
   if (str.indexOf(" ")!=-1){
      return false
   }
    return true     
 }
 
/*****************************************************/
/**                                                 **/
/**         Check numeric field                     **/
/**                                                 **/
/*****************************************************/
function IsNumber(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;


   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }

  return IsNumber;

  }


/*****************************************************/
/**                                                 **/
/**         Check date is valid, supply dd, mm, YYYY**/
/**                                                 **/
/*****************************************************/
function IsDate (dd,mm,yyyy)
{
   var ValidChars = "0123456789";
   var Char;
   var febdays=0;


/** Check day is a number
   for (i = 0; i < dd.length; i++) 
      { 
      Char = dd.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         return false;
         }
      }


/** Check Month is a number
   for (i = 0; i < mm.length; i++) 
      { 
      Char = mm.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         return false;
         }
      }

/** Check Month is a number
   for (i = 0; i < mm.length; i++) 
      { 
      Char = mm.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         return false;
         }
      }

/** Check year is a number
   for (i = 0; i < yyyy.length; i++) 
      { 
      Char = yyyy.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         return false;
         }
      }

/** months is 1 to 12 **/
if ((mm<1) || (mm>12)){return false;}
/** Check days in range 1 to 31 **/
if ((dd<1) || (dd>31)){return false;}
/** Check days in month **/
if ((mm==4 ||mm==6 || mm==9 || mm==11) && (dd>30)){return false;}
/** Feb is the odd one **/
if ((mm==2) && (dd>daysinfeb(yyyy))){return false;}
return true;

}





/*****************************************************/
/**                                                 **/
/**         work out days in feb                **/
/**                                                 **/
/*****************************************************/
function daysinfeb (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}


/*****************************************************/
/**                                                 **/
/**         Check Phone Number field                **/
/**                                                 **/
/*****************************************************/
function IsPhone(sText)
{
   var ValidChars = "0123456789()+- ";
   var IsNumber=true;
   var Char;

 
/** if not long enough, it must be false **/
if (sText.length<11)
	{
	return false;
	}
 
   for (p = 0; p < sText.length && IsNumber == true; p++) 
      { 
      Char = sText.charAt(p); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


function trim(stringToTrim) 
{
  if (stringToTrim!=null && stringToTrim.length!=0)
  {
    return stringToTrim.replace(/^\s+|\s+$/g,"");
  }
  else
  {
    stringToTrim="";
    return stringToTrim;
  }
}

/*************** Forum scripts *****************************/

function busy(event, textbusy)
{
  cursor=getcursorposition(event);
// move the summary box to left of cursor and align with top of cursor 
  boxtop=cursor.y-20;
  boxleft=cursor.x-120;
  document.getElementById("busy").style.display="block";
  document.getElementById("busy").style.left=boxleft+"px";
  document.getElementById("busy").style.top=boxtop+"px"; 
  text="<center><img src=./images/ajax-loader width=24px height=24px><br>"+textbusy+"</center>";
  document.getElementById("busy").innerHTML=text;

}
function unbusy()
{
  document.getElementById("busy").style.display="none";
}



function getwindowsize()
{
  var windowsize={x:0,y:0};
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    windowsize.x = window.innerWidth-16;
    windowsize.y = window.innerHeight-16;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    windowsize.x = document.documentElement.clientWidth;
    windowsize.y = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    windowsize.x = document.body.clientWidth-20;
    windowsize.y = document.body.clientHeight-20;
  }
  return windowsize;
}


function getScrollXY() {
  var scroll={x:0,y:0};
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scroll.y = window.pageYOffset;
    scroll.x = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scroll.y = document.body.scrollTop;
    scroll.x = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scroll.y = document.documentElement.scrollTop;
    scroll.x = document.documentElement.scrollLeft;
  }
  return scroll;
}

function slowscroll(n)
{

if (n>0){for (i=0;i<n;i++)  {  window.scrollBy(0,1);    } }
if (n<0){for (i=0;i>n;i--)  {  window.scrollBy(0,-1);    } }
}

/********************/

function courseapp()
{
if (g_a.indexOf('/demo/',0)==-1)
  { 

  document.write('<iframe width="750" height="580" frameborder="1" scrolling="no" marginheight="0" marginwidth="0" src="http://www.90-one.co.uk/api/courseform.html');
  x=g_a.indexOf('?course=',0);
  if (x!=-1){document.write(g_a.substring(x,g_a.length));}
  document.write('"></iframe>');
  }
else
    {
    document.write('<iframe width="750" height="580" frameborder="1" scrolling="no" marginheight="0" marginwidth="0" src="courseappload.html');
    x=g_a.indexOf('?course=',0);
    if (x!=-1){document.write(g_a.substring(x,g_a.length));}
    document.write('"></iframe>');
    }
}

function contact()
{
document.write('<iframe width="750" height="340" frameborder="1" scrolling="no" marginheight="0" marginwidth="0" src="http://www.90-one.co.uk/api/contact.html');

x=g_a.indexOf('?subject=',0);
if (x!=-1){document.write(g_a.substring(x,g_a.length));}
document.write('"></iframe>');
}


function tcapp()
{
document.write('<iframe width="750" height="400" frameborder="1" scrolling="no" marginheight="0" marginwidth="0" src="http://www.90-one.co.uk/api/tcform.html');
x=g_a.indexOf('?course=',0);
if (x!=-1){document.write(g_a.substring(x,g_a.length));}
document.write('"></iframe>');
}

function random(from, to)
{
return Math.round(Math.random()*to);

}

function teamover(event,teamtext)
{

// find cursor
  var cursor = {x:0, y:0};
  cursor=getcursorposition(event);
windowname="teambubble";
// move the summary box to left of cursor and align with top of cursor 
  boxtop=cursor.y+10;
  boxleft=cursor.x-150;
  document.getElementById(windowname).style.display="block";
  document.getElementById(windowname).style.width='300px';
  document.getElementById(windowname).style.height='auto';
  document.getElementById(windowname).style.left=boxleft+"px";
  document.getElementById(windowname).style.top=boxtop+"px"; 
  document.getElementById(windowname).innerHTML=teamtext;
}

function teamout()
{
document.getElementById("teambubble").style.display="none";
}

/************ Get cursor position *************************/
/* Explanation to use get position                        */
/* In your function declare "var cursor = {x:0, y:0};"    */
/* Then "cursor=getcursorposition(event);"                */
/* then cursor.x=value and cursor.y=value                 */
/* Note event MUST be passed in                           */
/* i.e. in the html                                       */
/*   onmouseover="myfunction(event);"                     */
/*   in "myfunction" receive the event, and use that to pass */
/*   into getposition()                                   */ 
/**********************************************************/
function getcursorposition(e) 
{
  e = e || window.event;
  var cursor = {x:0, y:0};
  if (e.pageX || e.pageY) 
  {
    cursor.x = e.pageX;
    cursor.y = e.pageY;
  } 
  else 
  {
    var de = document.documentElement;
    var b = document.body;
    cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
    cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
  }
  return cursor;
}


/** Start of ticker run **/
function tickerrun(n)
{

replace='';

if(n==1)
  {
  document.getElementById("tickerhref").title=tttitle[ttline];
  document.getElementById("tickerhref").href=tthref[ttline];
  document.getElementById("tickerhref").innerHTML=tt[ttline]; 
  clearTimeout(timeoutid);return;
  }

if((n==2) && (ttpos==-1))
  {
  ttpos=tt[ttline].length;
  timeoutid=setTimeout("tickerrun(0)",100);
  return
  }


if(ttpos==-1)
  {
  ttpos=1;
  ttline++;
  if(ttline==tt.length){ttline=0;}
  }


if(ttpos==tt[ttline].length){replace=tt[ttline];}
else
{replace=tt[ttline].substring(0,ttpos)+'_';}
document.getElementById("tickerhref").innerHTML=replace; 


if (ttpos==tt[ttline].length)
  {
  ttpos=-1;
  timeoutid=setTimeout("tickerrun(0)",4000);
  return;
  }
  else
  ttpos++;
  timeoutid=setTimeout("tickerrun(0)",50);
}
/** End of ticker run **/

