function displayDate() {
    var month = new Date().getMonth();
    var year = new Date().getFullYear();
    switch (month) {
        case 0:
            month = "January";
            break
        case 1:
            month = "February";
            break
        case 2:
            month = "March";
            break
        case 3:
            month = "April";
            break
        case 4:
            month = "May";
            break
        case 5:
            month = "June";
            break
        case 6:
            month = "July";
            break
        case 7:
            month = "August";
            break
        case 8:
            month = "September";
            break
        case 9:
            month = "October";
            break
        case 10:
            month = "November";
            break
        case 11:
            month = "December";
            break
    }
    document.write( "&copy " + month + " " + year +"<br><a href='http://studymaths.co.uk/index.html'>studymaths.co.uk</a><br><br>");
}

function displayLinkBar() {
    var link = new Array();
    link[0] = "<a href='http://studymaths.co.uk'>home</a> | ";
    link[1] = "<a href='http://studymaths.co.uk/worksheets.html'>maths workout</a> | ";
    link[2] = "<a href='http://studymaths.co.uk/coffeebreak.html'>coffee break</a> | ";
    link[3] = "<a href='http://studymaths.co.uk/gcsequestions.html'>question bank</a> | ";
    link[4] = "<a href='http://studymaths.co.uk/formulae.html'>formulae</a> | ";
    link[5] = "<a href='http://studymaths.co.uk/glossary.html'>glossary</a> | ";
    link[6] = "<a href='http://studymaths.co.uk/question.html'>contact</a> | ";
    document.write("<hr>");
    document.write("<form action='http://studymaths.co.uk/search.html' id='cse-search-box'>");
    for (var i = 0;i < link.length; i++) {
        document.write(link[i])
    }
    document.write("<input type='hidden' name='cx' value='006141269734310099477:idz9ibulqsc' />");
    document.write("<input type='hidden' name='cof' value='FORID:9' />");
    document.write("<input type='hidden' name='ie' value='UTF-8' />");
    document.write("<input type='text' name='q' size='11' />");
    document.write("<input type='submit' name='sa' value='Search' />");
    document.write("</form>");
    document.write("<script type='text/javascript' src='http://www.google.com/cse/brand?form=cse-search-box&lang=en'></script>");
    document.write("<hr>");
    shareThis();
}

function shareThis() {
document.write("<div style='width: 250px' class='addthis_toolbox addthis_default_style addthis_32x32_style'>");
document.write("<a class='addthis_button_preferred_1'></a>");
document.write("<a class='addthis_button_preferred_2'></a>");
document.write("<a class='addthis_button_preferred_3'></a>");
document.write("<a class='addthis_button_preferred_4'></a>");
document.write("<a class='addthis_button_compact'></a>");
document.write("<a class='addthis_counter addthis_bubble_style'></a>");
document.write("</div>");
document.write("<script type='text/javascript'>var addthis_config = {'data_track_clickback':true};</script>");
document.write("<script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4dd95f0b2b8b2032'></script><br>");
document.write("<script type='text/javascript'>var addthis_config = {ui_offset_top: -180, ui_offset_left: 40}</script>");
}

function getJoke() {
    var joke = new Array();
    var punch = new Array();
    joke[0]="Why was 6 afraid of 7?";
    joke[1]="What do you call a boiling kettle on top of a mountain?";
    joke[2]="There a 10 types of people.";
    joke[3]="BREAKING NEWS!";
    joke[4]="Have you heard the joke about the statistician?";
    joke[5]="What happens when you take the circumference of your Halloween lantern and divide it by its diameter?";
    joke[6]="What do mermaid mathematicians wear?";
    joke[7]="Why did the chicken cross the Mobius strip?";
    joke[8]="There were 99 people on a boat when it capsized. How many were left on the boat?";
    joke[9]="What does a constipated mathematician do?";
    joke[10]="What did the zero say to the eight?";
    joke[11]="Pi says: 'Get real.'";
    joke[12]="Why was the maths book sad?";
    joke[13]="An infinite crowd of mathematicians enter a pub. The first one orders a pint, the second one a half pint, the third one a quarter pint and so on.";
    joke[14]="Why don't you find many mathematicians on the beach?";
    joke[15]="Why did the pupil eat her homework?";
    joke[16]="What does a clock do when it's hungry?";
    joke[17]="Why is two the oddest prime?";
    joke[18]="Teacher: 'Along the corridor up the stairs'";
    joke[19]="A statistician had his head in an oven and his feet in the freezer.";
    joke[20]="What's the king of the pencil case?";
    joke[21]="What's a sheeps favourite graph?";
    joke[22]="What did the obtuse angle say to the smaller angle?";
    joke[23]="What T.V. programme do statisticians watch?"
    joke[24]="Why was the prism angry?";
    joke[25]="How much is the cheapest carpet at the metric store?";
    joke[26]="How do geometry teachers travel?";
    joke[27]="What is a mathematians favourite food?";
    joke[28]="What do you call a leg that is perpendicular to a foot?";
    joke[29]="What did one maths book say to the other?";
    joke[30]="What state has the most maths teachers?";
    joke[31]="Did you hear the joke about the infinite line?";
    joke[32]="Having problems with your maths?";
    joke[33]="Why did the two vectors start an internet-based company?";
    joke[34]="Why did the integer get mad at his wife?";
    joke[35]="Shocking statistic...";
    joke[36]="Heard about the mathematical plant?";
    joke[37]="F(x)= 2X+3 walks into a bar and orders a round of drinks and asks for some sanwiches.";
    joke[38]="Who invented King Arthur's round table?";
    joke[39]="How do you tell that you are in the hands of the Mathematical Mafia?";
    joke[40]="How many numerical analysts does it take to change a lightbulb?";
    joke[41]="What's the difference between Robbie Williams and a maths teacher?";
    joke[42]="Where are mathematicians buried?";
    joke[43]="Decimals have a point.";
    joke[44]="Why don't they serve beer at mathematicians' parties?";
    joke[45]="I hate puns about maths."
    punch[0]="Because 7, 8, 9!";
    punch[1]="A high-pot-in-use!";
    punch[2]="Those that understand binary and those that don't.";
    punch[3]="A new prime number has been discovered three times larger than the previous record.";
    punch[4]="Answer, 'Probably.'"
    punch[5]="You get Pumpkin Pie.";
    punch[6]="Algebras.";
    punch[7]="To get to the same side.";
    punch[8]="66.";
    punch[9]="Work it out with a pencil.";
    punch[10]="Nice belt.";
    punch[11]="i replies: 'Lets be rational about this.'";
    punch[12]="Because it had too many problems.";
    punch[13]="The bar man says 'I get ya' and pours two pints.";
    punch[14]="Because they can get a tan with just a sine and cosine.";
    punch[15]="Because the teacher said it was a piece of cake.";
    punch[16]="It goes back four seconds.";
    punch[17]="It's the only one that's even!";
    punch[18]="Pupil: 'Sir, I live in a bungalow'";
    punch[19]="On average he felt fine.";
    punch[20]="The ruler.";
    punch[21]="A baaaa chart.";
    punch[22]="Your a cute angle.";
    punch[23]="Correlation street.";
    punch[24]="It had a cross-section.";
    punch[25]="One cent a metre.";
    punch[26]="In a plane.";
    punch[27]="Pi."
    punch[28]="A right ankle.";
    punch[29]="Man I have a lot of problems.";
    punch[30]="Mathachussets.";
    punch[31]="It doesn't have a point.";
    punch[32]="Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].";
    punch[33]="They thought they had a good dot product.";
    punch[34]="Because she was being irrational.";
    punch[35]="50% of schools are below average.";
    punch[36]="It's got square roots.";
    punch[37]="The barman replies sorry we don't cater for functions.";
    punch[38]="Sir Cumference.";
    punch[39]="They make you an offer that you can't understand.";
    punch[40]="0.99987 after four iterations.";
    punch[41]="Your maths teacher is loving Angles instead.";
    punch[42]="The Symmetry.";
    punch[43]="Calculus has it's limits.";
    punch[44]="Because it's not safe to drink and derive.";
    punch[45]="They're the first sine of madness."
    var i = Math.floor(Math.random() * joke.length);
    document.write("#" + (i + 1) + " " + joke[i] + " " + punch[i]);
}

function loadCalc() {
    window.open('http://studymaths.co.uk/calc.html','jav','width=350,height=500,resizable=no')
}
