// JavaScript Document
	function generateImage(){
		//create array to hold paths
		var images=new Array();
		//populate array
		images[0]="header1.jpg";
		images[1]="header2.jpg";
		images[2]="header3.jpg";
		images[3]="header4.jpg";
		images[4]="header5.jpg";
		images[5]="header6.jpg";
		//generate a random number
		var imageNum=Math.floor(Math.random()*images.length);
		//write out the path to the image
		return('<img src="images/'+images[imageNum]+'" alt="choreography and cognition" width="606" height="145" border="0" />');
	}
	
	var textSizes = new Array('xx-small','x-small','small','medium','large','x-large','xx-large' );
	var initialSize = 1;
	function resizeText(target, difference) {
		var newSize = initialSize, tags = null;
		
		newSize += difference;
		(newSize<0)?newSize=0:"";
		(newSize>6)?newSize=6:"";
		initialSize = newSize;
		if (!(tags = document.getElementById( target ))) tags = document.getElementsByTagName( target )[ 0 ];
		
		tags.style.fontSize = textSizes[newSize];
		
		divs = tags.getElementsByTagName('div');
		for (i=0; i<divs.length; i++) {
			divs[i].style.fontSize = textSizes[newSize];
		}
	}
	
	// this function opens an image in a sized and positioned popup
	function popUpImage(imageURL) {
		imagePopUp = window.open( "popUpImage.html?"+imageURL,"","resizable=1,titlebar=0,hotkeys=0,scrollbars=0,HEIGHT=400,WIDTH=500");
	}
 
 	// this function opens a customisable popup
	function openPopUp(pageURL, pageName, bitsAndBobs) {
		newWindow = window.open(pageURL, pageName, bitsAndBobs);
	}
	
	// this function is used to customise a window
	function resizeMe(resizeWidth, resizeHeight) {
		// set required size
		var width = resizeWidth; 	// width
		var height = resizeHeight;	// height
		
		// get the screen size
		var screenWidth = screen.width;
		var screenHeight = screen.height;
		
		// work out the co-ordinates of where to put the window
		sx = ((screenWidth/2) - (width/2));
		sy = ((screenHeight/2) - (height/1.5));
		
		// set size and position
		if(top == self) {
			window.resizeTo(width,height);
			window.moveTo(sx,sy);
		}
		
	}