ie5  = (document.all && document.getElementById);
ns6 = (!document.all && document.getElementById);

//change the fading text here
var blankText = '';
var filmText ='CHECK OUT ALL<BR><BR>THE LATEST CINEMA RELEASES';
var dvdText = 'ALL THE NEW  <br><br>DVD RELEASES';
var interactText = 'HAVE YOUR SAY ON OUR FORUM';
var newsText = 'NEWS, VIEWS, AND MUCH MUCH MORE!';
var contactText = 'FIND OUT MORE ABOUT US <BR><BR> AND ALL THE SERVICES <BR><BR> WE HAVE TO OFFER YOU';

var filmoutnow = '/out_now.php';
var filmcoming = '/coming_soon.php';
var filmfestivals = '/festivals/';
var filmarchive = '/reviewlistings.php';

var dvdoutnow = '/latest_dvd.php';
var dvdcoming = '/under_construction.shtml';
var dvdarchive = '/dvdlistings.php';

var intercomp = '/comps/';
var interforum = '/forums/';
var internewsletter = '/registration/';

var newsnews = '/newspage.php';
var newsfeatures = '/newspage.php';

var contactabout = '/contact.php';
var contacteditorial = '/editorial.php';
var contactadvertise = '/advertise.php';

var inittable = '<table id="subTable" cellpadding="0" cellspacing="0" border=1 bordercolor="#CC328E"><td>';

//change sub menu items here but be careful when adding or deleting
var filmInner = inittable+'<td><div id="film1" class="menuitem"><a href=' + filmoutnow + ' onmouseover="changeCol(\'film1\');" onmouseout="revertCol(\'film1\');">&nbsp;OUT NOW &nbsp;</a></div></td><td><div id="film2" class="menuitem"><a href=' + filmcoming + ' onmouseover="changeCol(\'film2\');" onmouseout="revertCol(\'film2\');">&nbsp;COMING SOON &nbsp;</a></div></td><td><div id="film4" class="menuitem"><a href=' + filmfestivals + ' onmouseover="changeCol(\'film4\');" onmouseout="revertCol(\'film4\');">&nbsp;FESTIVALS &nbsp;</a></div></td><td><div id="film5" class="menuitem"><a href= ' + filmarchive + ' onmouseover="changeCol(\'film5\');" onmouseout="revertCol(\'film5\');">&nbsp;ARCHIVE &nbsp;</a></div></td>';

var dvdInner = inittable+'<td><div id="dvd1" class="menuitem"><a href= ' + dvdoutnow + ' onmouseover="changeCol(\'dvd1\');" onmouseout="revertCol(\'dvd1\');">&nbsp;OUT NOW &nbsp;</a></div></td><!-- <td><div id="dvd2" class="menuitem"><a href= ' + dvdcoming + ' onmouseover="changeCol(\'dvd2\');" onmouseout="revertCol(\'dvd2\');">&nbsp;COMING SOON &nbsp;</a></div></td> --><td><div id="dvd3" class="menuitem"><a href= ' + dvdarchive + ' onmouseover="changeCol(\'dvd3\');" onmouseout="revertCol(\'dvd3\');">&nbsp;ARCHIVE &nbsp;</a></div></td>';

var interactInner = inittable+'<td><div id="inter1" class="menuitem"><a href= ' + intercomp + ' onmouseover="changeCol(\'inter1\');" onmouseout="revertCol(\'inter1\');">&nbsp;COMPETITIONS &nbsp;</a><td><div id="inter2" class="menuitem"><a href= ' + interforum + ' onmouseover="changeCol(\'inter2\');" onmouseout="revertCol(\'inter2\');">&nbsp;FORUM &nbsp;</a></div></td><td><div id="inter3" class="menuitem"><a href= ' + internewsletter + ' onmouseover="changeCol(\'inter3\');" onmouseout="revertCol(\'inter3\');">&nbsp;NEWSLETTER &nbsp;</a></div></td>';

var newsInner = inittable+'<td><div id="news1" class="menuitem"><a href= ' + newsnews + ' onmouseover="changeCol(\'news1\');" onmouseout="revertCol(\'news1\');">&nbsp;NEWS &nbsp;</a></div></td><td><div id="news2" class="menuitem"><a href= ' + newsfeatures + ' onmouseover="changeCol(\'news2\');" onmouseout="revertCol(\'news2\');">&nbsp;FEATURES &nbsp;</a></div></td>';

var contactInner = inittable+'<div id="contact1" class="menuitem"><a href= ' + contactabout + ' onmouseover="changeCol(\'contact1\');" onmouseout="revertCol(\'contact1\');">&nbsp;ABOUT US &nbsp;</a></div></td><td><div id="contact2" class="menuitem"><a href= ' + contacteditorial + ' onmouseover="changeCol(\'contact2\');" onmouseout="revertCol(\'contact2\');">&nbsp;EDITORIAL&nbsp;</a></div></td><td><div id="contact3" class="menuitem"><a href= ' + contactadvertise + ' onmouseover="changeCol(\'contact3\');" onmouseout="revertCol(\'contact3\');">&nbsp;ADVERTISE&nbsp;</a></div></td>';

//not much need to change anything below here
var layerCheck = 0;
var whichLayer = 'topLayer';
var whichLayer2 = 'bottomLayer';
var layerOpacity = 0;
var layerOpacity2 = 100;
var a = null;

function fillInner(which){
	document.getElementById('subNotSoMain').innerHTML = which;
}

function changeCol(which){
	document.getElementById(which).style.backgroundColor = '#EA83C1';
}

function revertCol(which){
	document.getElementById(which).style.backgroundColor = '#e1e1e1';
}

function setSub(colDist){
	document.getElementById('subSpans').colSpan= colDist;
	document.getElementById('subMain').style.visibility='visible';
}

function hideSub(which){
	document.getElementById('subMain').style.visibility = 'hidden';
}

function goBack() {
	a = setTimeout('sendIt()', 3000);
}

function sendIt(){
	checkIt(blankText);
	hideSub(0);
}

function stopTimer(){
	if (a) {
		clearTimeout(a);
		a = null;
	}
}

function checkIt(which){
	layerOpacity = 0;
	layerOpacity2 = 100;
	if (layerCheck == 0) {
		fadeOut();
		layerCheck = 1;
		document.getElementById("botText").innerHTML = which;
		whichLayer = 'bottomLayer';
		whichLayer2 = 'topLayer';
		fadeIn();
	} else {
		fadeOut();
		layerCheck = 0;
		document.getElementById("topText").innerHTML = which;
		whichLayer = 'topLayer';
		whichLayer2 = 'bottomLayer';
		fadeIn();
	}
}

function fadeIn() {
	if(layerOpacity != 100){
		layerOpacity+=10;
		if(ie5) document.getElementById(whichLayer).filters.alpha.opacity = layerOpacity;
		if(ns6) document.getElementById(whichLayer).style.MozOpacity = layerOpacity/100;
		setTimeout('fadeIn()', 5);
	}
}

function fadeOut() {
	if(layerOpacity2 > 0){
		layerOpacity2-=5;
		if(ie5) document.getElementById(whichLayer2).filters.alpha.opacity = layerOpacity2;
		if(ns6) document.getElementById(whichLayer2).style.MozOpacity = layerOpacity2/100;
		setTimeout('fadeOut()', 5);
	}
}
