var W3CDOM = (document.createElement && document.getElementsByTagName);



var mouseOvers = new Array();
var mouseOuts = new Array();

window.onload = init;

function init()
{
	if (!W3CDOM) return;
	if (!document.getElementById('mouseovers')) return;
	var nav = document.getElementById('mouseovers');
	var imgs = nav.getElementsByTagName('img');
	for (var i=0;i<imgs.length;i++)
	{
		imgs[i].onmouseover = mouseGoesOver;
		imgs[i].onmouseout = mouseGoesOut;
		var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
		mouseOuts[i] = new Image();
		mouseOuts[i].src = imgs[i].src;
		mouseOvers[i] = new Image();
		mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "-R" + suffix;
		imgs[i].number = i;
	}
}

function mouseGoesOver()
{
	this.src = mouseOvers[this.number].src;
}

function mouseGoesOut()
{
	this.src = mouseOuts[this.number].src;
} 

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function selgo() {
if (document.forms[0].down.selectedIndex != "0") {
    self.location.href=document.forms[0].down.options[document.forms[0].down.selectedIndex].value;}
}

function selgo1() {
if (document.forms[1].down.selectedIndex != "0") {
    self.location.href=document.forms[1].down.options[document.forms[1].down.selectedIndex].value;}
}

function selgo2() {
if (document.forms[2].down2.selectedIndex != "0") {
    self.location.href=document.forms[2].down2.options[document.forms[2].down2.selectedIndex].value;}
}

function selgo3() {
if (document.forms[3].down3.selectedIndex != "0") {
    self.location.href=document.forms[3].down3.options[document.forms[3].down3.selectedIndex].value;}
}

// page last updated

function updated() {
var days = new Array(8);
days[1] = "Sunday";
days[2] = "Monday";
days[3] = "Tuesday";
days[4] = "Wednesday";
days[5] = "Thursday";
days[6] = "Friday";
days[7] = "Saturday";
var months = new Array(13);
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
var dateObj = new Date(document.lastModified)
var wday = days[dateObj.getDay() + 1]
var lmonth = months[dateObj.getMonth() + 1]
var date = dateObj.getDate()
var fyear = dateObj.getYear()
var minutes = dateObj.getUTCMinutes()
if (minutes < 10) minutes = "0"+minutes
var time = (dateObj.getUTCHours()+":"+minutes+" UTC/GMT")
if (fyear < 2000) 
fyear = fyear + 1900
document.write(" This page was last updated on " + wday + ", " + date + " " + lmonth + " " + fyear + " at " + time)
}

// get copyright string
function copyright() {
	var output = "<a href=\"\/copyright.html\"><span class=\"copy\"> &copy; AQA </span></a>"
	document.write(output);
}

// open movie window - will need to fix this later
function moviewin(fname, winname) {
window.open(fname, winname, config='height=280,width=320,toolbar=no,menubar=no,status=no');
  }
  
  
  // open pop-up address window
  	function addwin(name) {
  	window.open(name+'.shtm', 'addresswin', config='height=620,width=600,toolbar=no,menubar=no,status=no');
  	}
  	function show_link ()
  		{
  		document.getElementById('proposed_part_2').style.display='';
  		}
  		// centre popup window
  
  	function centrewin(url,width,height) {
  	x = (640 - width)/2, y = (480 - height)/2;
  	if (screen) {
  	y = (screen.availHeight - height)/2;
  	x = (screen.availWidth - width)/2;
  	}
  	window.open(url,'Centre', config='width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+', toolbar=no, scrollbars=no, menubar=no,status=no');
	} 




