// EXTRA
var months = new Array()
months[1] = "Janurary"
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 today = new Date()
var month = today.getMonth()+1
var date = today.getDate()


function correctDate(form,menu1){

	for(i=0; i<form.elements.length; i++){
		if(form.elements[i]==menu1){
		var nextmenu=form.elements[i+1]
		break
		}
	}
var formerlength=nextmenu.options.length

	if(menu1.options[1].selected){
	thelength=28
	}
	else if(menu1.options[3].selected || menu1.options[5].selected || menu1.options[8].selected || menu1.options[10].selected){
	thelength=30
	}
	else{
	thelength=31
	}
	nextmenu.options.length=thelength
	for(i=formerlength; i<thelength; i++){
	nextmenu.options[i].value=i+1
	nextmenu.options[i].text=i+1
	}
	nextmenu.selectedIndex=thelength-1
	
}


function previewSubject() {
	var d = document;
	d.getElementById('Preview').innerHTML = '<b>'+d.getElementById('name').value+'</b>';
}
function previewEntry(src,pve) {
	var d = document;
                       
	d.getElementById(pve).innerHTML = '<br>'+d.getElementById(src).
	value.replace(/(\n)/g,'<br>');
}

function placeFocus() {
if (document.forms.length > 0) {
var field = document.forms[0];
for (i = 0; i < field.length; i++) {
if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
document.forms[0].elements[i].focus();
break;
}}}}


// canManipulateImages - check if the browser we're using can do
// clever stuff with document images.
function canManipulateImages() {
	if (document.images)
		return true;
	else
		return false;
}

// loadPosterImage
function loadPosterImage(imageURL, imageURL2, imgtext, bigw, bigh) {
	if (gImageCapableBrowser) {
		document.imagePoster.src = imageURL;
		//document.imagePoster.txt = imgtxt;
		imagename = imageURL2;
		desctext = imgtext;
		bigwidth = bigw;
		bigheight = bigh;
		return false;
	}
	else {
		return true;
	}
}

// gImageCapableBrowser - is this browser hip to images? Set up
// a global variable so that we don't have to keep calling a function
// (useful if the function becomes costly to compute).
gImageCapableBrowser = canManipulateImages();

// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at http://www.crays.com/jsc

var pic = null
var popImg = null  // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"

function openPopImg(picName, windowTitle, bigwidth, bigheight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=no,resizable=no,status=no,width=765"
           + (parseInt(bigwidth)+20)  + ",height=515"
           + (parseInt(bigheight)+15))
  }
function closePopImg(){    // close pop-up window if it is open
  if (navigator.appName != "Microsoft Internet Explorer"
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close()
  }
function setStatus(msg){
  status = msg
  return true
  }


// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false

function openPopImg(picName, windowTitle, bigwidth, bigheight){
  var i = 0
  if(pic == picName && winOpen()){
    popImg.focus()
    }
  else{
    foundit = false
    for(i=0; i<=noPic; i++){
      if (priorPic[i] == picName)
        foundit = true
      }
    pic = imagename
    closePopImg()
    picTitle = windowTitle
    imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
    if(!foundit){
      priorPic[noPic++] = pic
      }
    popImg = openPopImgWin(imgWinName, bigwidth, bigheight)
    }
  }
function openPopImgWin(imgWinName, bigwidth, bigheight){
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,status=no,width="
    + bigwidth + ",height=" + bigheight
  return window.open("pimg.php?imgtxt=" + desctext, imgWinName, winFeatures)
  }
function winOpen(){
  if(popImg != null){
   if(popImg.closed != true) return true; else return false
   }
  else
    return false
  }

// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var leftX = 20  // distance of window's left side from left of screen
  var topY = 20   // distance of window's top side from top of screen
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,status=no,width="
    + bigwidth + ",height=" + bigheight
  if (leftX>0){
    winFeatures += ",screenX=" + leftX + ",left=" + leftX
                + ",screenY=" + topY + ",top=" + topY
    }
  return window.open("pimg.php?imgtxt=" + desctext, imgWinName, winFeatures)
  }


function openPopImg2(picName, windowTitle, windowWidth, windowHeight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=no,resizable=no,status=no,width=765"
           + (parseInt(windowWidth)+20)  + ",height=515"
           + (parseInt(windowHeight)+15))
  }
function closePopImg(){    // close pop-up window if it is open
  if (navigator.appName != "Microsoft Internet Explorer"
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close()
  }
function setStatus(msg){
  status = msg
  return true
  }

// for Netscape 3+ and IE 4+
// var priorPic = new Array()
// var noPic = 0
// var foundit = false

function openPopImg2(picName,  windowTitle, windowWidth, windowHeight){
  var i = 0
  if(pic == picName && winOpen()){
    popImg.focus()
    }
  else{
    foundit = false
    for(i=0; i<=noPic; i++){
      if (priorPic[i] == picName)
        foundit = true
      }
    pic = picName
    closePopImg()
    picTitle = windowTitle
    imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
    if(!foundit){
      priorPic[noPic++] = pic
      }
    popImg = openPopImgWin2(picName, windowWidth, windowHeight)
    }
  }
function openPopImgWin2(imgWinName, windowWidth, windowHeight){
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,status=no,width="
    + windowWidth + ",height=" + windowHeight
  return window.open("pimg2.php?vidname=" + imgWinName, imgWinName, winFeatures)
  }
function winOpen2(){
  if(popImg != null){
   if(popImg.closed != true) return true; else return false
   }
  else
    return false
  }

// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin2(imgWinName, windowWidth, windowHeight){
  var leftX = 20  // distance of window's left side from left of screen
  var topY = 20   // distance of window's top side from top of screen
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,status=no,width="
    + windowWidth + ",height=" + windowHeight
  if (leftX>0){
    winFeatures += ",screenX=" + leftX + ",left=" + leftX
                + ",screenY=" + topY + ",top=" + topY
    }
  return window.open("pimg2.php?vidname=" + imgWinName, imgWinName, winFeatures)
  }
  
/**********************************************************************************   
ChangeText 
*   Copyright (C) 2001 Thomas Brattli
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by Thomas Brattli
*
*   Script date: 08/02/2001 (keep this date to check versions) 
*********************************************************************************/
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=lib_bwcheck()
if(document.layers){ //NS4 resize fix...
	scrX= innerWidth; scrY= innerHeight;
	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }
}

/****
Variables to set 
****/
msgFont= "arial,helvetiva"	// The font for the message
msgFontSize= 10				// Set the fontSize in px
msgFontColor="#336699"		// Set the fontColor
msgWidth= "180"				// Set the width of the messageblock here for netscape 4

//Set the text you want to display on mouseover here.
messages=new Array()
messages[0] = 	"" //This is the default text that appears when you mouse out
messages[1] = 	"Photo by Barry Griffin" //This is the default text that appears when you mouse out.
messages[2] = 	"Photo by John Varah"
messages[3] = 	"Photo by Micheal Venning"      
messages[4] = 	"Photo by Steve Thornton - Breeze Photographic"
messages[5] = 	"Photo by Melvyn"
messages[6] = 	"Photo by Jo Coles"
messages[7] = 	"Photo by Imageus.co.uk"
messages[8] = 	"Photo by mykabaum.co.uk"
messages[9] = 	"Photo by Bec Britain"
messages[10] = 	"Photo by Sara and Danny"
messages[11] = 	"Photo by Laura Crow"
messages[12] = 	"Photo by Laura Crow<br><span class=blacktext>Decade sponsors University of Brighton staff creating two large lanterns in the form of a candle and a clock at Same Sky&rsquo;s workshop.</span>"
messages[13] = 	"Photo by Laura Crow<br><span class=blacktext>Decade sponsors University of Brighton staff carry their lanterns in the parade.</span>"
messages[14] = 	"Photo by Laura Crow<br><span class=blacktext>Media sponsor Juice 107.2FM represented by the energetic Juicy Dancers.</span>"
messages[15] = 	"Photo by Laura Crow<br><span class=blacktext>Decade sponsors the Care Home Insurance Service carry their lantern in the parade.</span>"
messages[16] = 	"Pulse Photography"
messages[17] = 	"" //This is the default text that appears when you mouse out

/********************************************************************************
You don't have to change anything below this
********************************************************************************/

//ChangeText object constructor.
function makeChangeTextObj(obj){
   	this.css = bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;	
   	this.writeref = bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0;	
	this.writeIt = b_writeIt;					
}
function b_writeIt(text,num){
	if (bw.ns4){
		this.writeref.write(text)
		this.writeref.close()
	}
    else this.writeref.innerHTML = messages[num]
}

//The mouoseover function. Calls the writeIt method to write the text to the div.
function changeTextOther(num){
 	if(bw.bw) document.getElementById("div1message").innerHTML = messages[num];
	// if(bw.bw) oMessage.writeIt(messages[num], num)
}

//The mouoseover function. Calls the writeIt method to write the text to the div.
function changeText(num){
	// if(bw.bw) document.getElementById("div1message").innerHTML = messages[num];
	if(bw.bw) oMessage.writeIt(messages[num], num)
}

//The init function. Calls the object constructor and initiates some properties.
function changeTextInit(){
	//Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
	bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false
	if (bw.opera5) bw.ns6 = 0
	
	oMessage = new makeChangeTextObj("divMessage")
	oLinks = new makeChangeTextObj('divLinks')
	//Setting the style properties of the text layer.
	if(bw.dom || bw.ie4){
		with(oMessage.writeref.style){fontFamily=msgFont; fontSize=msgFontSize+"px"; color=msgFontColor}
	}
	//Both layers are hidden by default to prevent users from mousing over them and creating errors while the page loads.
	oMessage.css.visibility= "visible"
	oLinks.css.visibility= "visible"
}

//If the browser is ok, the init function is called on pageload. 
if (bw.bw) onload = changeTextInit


// ROLLOVERS
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_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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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];}
}