otherstats.aspxReturn to the Documentation page
  

<%@ Page Language="vb" %>

<script runat="server">

‘There’s only one piece of code in this file – the usual script to redirect the user back to the main menu using an ASP linkbutton control.’

Response.Redirect("mainmenu.aspx")

</script>

<html>

<head>

<title>Other stats from the Election 2001 database</title>

<link href=".\otherfiles\election2001.css" type="text/css" rel="stylesheet" />

‘The init function runs when the page first loads onto the client computer and, if the screen resolution width is higher than 1250 pixels as it will be for many of the newer LCD monitors, then the font-size of the text within 'tablemenu' will be increased to medium.

However, if the browser recognises the syntax 'self.innerHeight...', the first stylesheet will have the td font-size set to 'large' - the insertRule method is only recognized by Firefox, Mozilla, Opera version 9.0 etc and not by IE or earlier versions of Opera.’

<script>

function init() {

if (window.screen.width > 1250 ) {

document.getElementById("tablemenu").style.fontSize = "medium";

if (self.innerHeight && !window.opera) {document.styleSheets[0].insertRule(".tdmenu {font-size: large}",0);}

}

}

</script>

</head>

‘The first table displays a ballot box [ballotbox.jpg] in the top left-hand corner together with a label [Other stats] and the ASP linkbutton control mentioned above displays in the top right-hand corner of the page. This runs the linkToMainMenu function when clicked.’

<body bgcolor="white" onload="init()">

<form id="form1" method="post" runat="server">

<table width="100%">

<tr>

<td rowspan="2" width="85px"><img src="./images/ballotbox.jpg" title="Cast your vote wisely!"></td>

<td><asp:Label id="Label1" runat="server"><u>Other stats</u></asp:Label></td>

<td align="right"><asp:LinkButton id="LinkToEdit" onclick="linkToMainMenu" runat="server" Text="Return to the Main menu"></asp:LinkButton></td>

</tr>

<tr><td colspan="2">&nbsp;</td></tr>

</table>

<P align="center">Please select a menu option<p>

<center>

‘A second table displays the options available under Other stats together with a random election result from the past. A javascript file is responsible for generating a random result and these go back to 1832 – check out the coding in the results.js file. Some of the stats available from this table include displaying the results for each country and displaying the total number of votes cast in the election.’

<table cellspacing="0" style="border: double 4px blue;background: white" id="tablemenu">

<tr><td align="center" bgcolor="#FFFFCD" style="padding:20"><script src='./otherfiles/results.js' type='text/javascript'></script></td><td class="tdmenu" style="padding: 20"><a href="partymps.aspx">View a party's MPs</a><p><a href="countrymps.aspx">View a country's MPs</a> <p><a href="regionalmps.aspx">View a region's MPs</a><td><p><a href="votingstats.aspx">Votes cast overall</a><p><a href="votingstatsbycountry.aspx">Votes cast by country</a><p><a href="votingstatsbyregion.aspx">Votes cast by region</a></td><td class="tdmenu" style="padding: 20"><a href="nationalstats.aspx">The result at a glance</a>...<p><a href="countrystats.aspx">The results for each country</a><p><a href="regionalstats.aspx">The results from each region</a><p><a href="mostvulnerable.aspx">The most vulnerable seats</a><p><a href="swingstats.aspx">Highest swings</a><p><a href="partygains.aspx">Gains by each party</a></td></tr>

</table>

</center>

</form>

</body>

</html>

***********************************************