<!--
//global variables in the sense which initialises variables and cross browser compatibilities
var mouseX;
var mouseY;
if (navigator.appName != "Microsoft Internet Explorer") 
{
  document.captureEvents(Event.ONMOUSEOVER);
}

//submit form for processing
function updateForm(formName)
{
	//check all information in form has been entered
	for (i=0;i<document.forms[formName].length;i++)
	{
		field=document.forms[formName][i].value;
		if ((field == " ") || (field == ""))
		{
			//set focus on field which is empty
			//document.forms[formName][i].focus();
			//exit function as form is not complete
			document.submitForm=false;
			return document.submitForm;
		}
	}
	//process form as information has been entered
	document.forms[formName].submit();
}

function swapImg(img,rollover)
{
  //document.images[img].src=rollover;
  img.style.background='url('+rollover+')';
  
}

//preloads the images parsed through function
function preloadIMG()
{
  //index which controls array of images to be preloaded
  j=0;
  //array containing images to be preloaded
  preload = new Array;
  //arguments passed from function call as number of images to be preloaded varies
  var img = preloadIMG.arguments;
  //for each image, add them to array which stores image info to be preloaded
  for (i=0;i<img.length;i++)
  {
      preload[j] = new Image;
      preload[j].src = img[i];
      j++;
  }
}

function popupLayer(vidName,vidW,vidH)
{
	//gets mouse coordinates
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		mouseX=event.clientX-(vidW*2.5);
		mouseY=event.clientY-(vidH*1.5);
	}
	else
	{
		document.onmouseover=getCoord;
		if (isNaN(mouseX)) {document.onmouseover=getCoord;}
		mouseX=mouseX-(vidW*2.5);
		mouseY=mouseY-(vidH*1.5);
	}
	
	//sets layer coordinates and visibility
	vidPopup=document.getElementById("videoPopup");
	vidPopup.style.left=mouseX +"px";
	vidPopup.style.top=mouseY +"px";
	vidPopup.style.position='absolute';
	vidPopup.style.visibility='visible';

	//sets image coordinates
	imgPopup=document.getElementById("popupVideo");
	//imgPopup.style.left=mouseX +"px";
	//imgPopup.style.top=mouseY +"px";
	imgPopup.src='videos/'+vidName;
	imgPopup.width=vidW;
	imgPopup.height=vidH;
	imgPopup.style.visibility='visible';

	return true;
}
function removeLayer(vidName,vidW,vidH)
{
	
	//sets layer coordinates and visibility
	vidPopup=document.getElementById("videoPopup");
	vidPopup.style.visibility='hidden';

	//sets image coordinates
	imgPopup=document.getElementById('popupVideo');
	imgPopup.style.visibility='hidden';

	return true;
}

//displays popup containing image of video clip
function previewVID(vidName,vidW,vidH)
{
	//gets mouse coordinates
	if (navigator.appName == "Microsoft Internet Explorer")
	{
		mouseX='left='+(event.clientX-vidH);
		mouseY='top='+(event.clientY-vidW);
	}
	else
	{
		document.onmouseover=getCoord;
		mouseX='screenX='+(mouseX-vidH);
		mouseY='screenY='+(mouseY-vidW);
	}
	
	thumbnail=window.open('videos/'+vidName,'PopUp','width='+vidW+',height='+vidH+','+mouseX+','+mouseY);
	thumbnail.document.bgColor="#000000";
	return true;
}

//retrieves mouse coordinates from the screen
function getCoord(evnt)
{
	mouseX=evnt.pageX;
	mouseY=evnt.pageY;
}

//makes text blink in any browser
function doBlink() 
{
  // Finds any blink tags in html file and stores it under var blink
  var blink = document.all.tags("blink")
  //loops through each blink tag, setting CSS visibility to either null OR hidden
  for (var i=0; i < blink.length; i++)
  {
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "";
  }
}

function startBlink()
{
  // Make sure it is IE4
  if (document.all)
  {
    //adds timer which runs doBlink function every 900ms
    setInterval("doBlink()",700)
  }
}
//-->

