var step = 1;
var whichimage = 1;

var image1 = new Image()
image1.src = "/common/redsq.gif"
var image2 = new Image()
image2.src = "/common/redout.gif"
var image3 = new Image()
image3.src = "/common/blackout.gif"
var image4 = new Image()
image4.src = "/common/blacksq.gif"

function doTitle(){
	var headings = new Array();
	headings["/index.html"]="Welcome!";
	headings["/links.html"]="Links";
	headings["/contact.html"]="Contact Details";
	headings["/training.html"]="Training Times";
	headings["/faq.html"]="FAQ";

	var url = document.location.pathname;
	if(url=="/"){ url="/index.html"; }
	document.writeln("<TITLE>Glasgow Jitsu: "+headings[url]+"</TITLE>");
}

function doSquares(){
	var url = document.location.pathname;
	if(url=="/"){ url="/index.html"; }

	document.writeln("<DIV CLASS=blackborder>");
	document.writeln("<DIV CLASS=blackborderinner>");
	document.writeln("<SPAN CLASS=heading>are you starting?</SPAN><BR><BR><BR><BR>");
	document.writeln("<a href=faq.html class=link000000>FAQs</A>,"); 
	document.writeln("</DIV></DIV>");
	if(url=="/index.html"){
		document.writeln("<DIV CLASS=blacksquare>");
		document.writeln("<DIV CLASS=blacksquareinner>");
	}
	else{
		document.writeln("<DIV CLASS=blacksquareshifted>");
		document.writeln("<DIV CLASS=blacksquareshiftedinner>");
	}
	document.writeln("<SPAN CLASS=heading><FONT");
	document.writeln("COLOR=white>contact</FONT></SPAN>");
	document.writeln("<BR><BR><BR><BR><BR><BR>");
	document.writeln("<a href=contact.html class=linkffffff>Contact details</A>");
	document.writeln("</DIV></DIV>");
	if(url=="/index.html"){
		document.writeln("<DIV CLASS=redborder>");
		document.writeln("<DIV CLASS=redborderinner>");
	}
	else{
		document.writeln("<DIV CLASS=redbordershifted>");
		document.writeln("<DIV CLASS=redbordershiftedinner>");
	}
	document.writeln("<SPAN CLASS=heading><FONT COLOR=#cc3333>on the mat</FONT>");
	document.writeln("</SPAN><BR><BR><BR><BR><BR><BR>");
	document.writeln("<A HREF=training.html CLASS=linkcc3333>Training times</A>");
	document.writeln("</DIV></DIV>	");	
	document.writeln("<DIV CLASS=redsquare>	");
	document.writeln("<DIV CLASS=redsquareinner>");
	document.writeln("<SPAN CLASS=heading><FONT COLOR=white>downloads</FONT>");
	document.writeln("</SPAN><BR><BR><BR><BR><BR><BR>");
	document.writeln("<a href=moviesm.mpg class=linkffffff>training demonstration");
	document.writeln("(7MB)</a>");
	document.writeln("</DIV></DIV>");
	
}

function doHeader(){
	 var pages = new Array("index.php", "60", "home",
			       "faq.php", "25", "faq",
			       "training.php", "85", "training&nbsp;times",
			       "contact.php", "65", "contact&nbsp;us",
			       "links.php", "30", "links");
	var i=0;
	var url = document.location.pathname;
	if(url=="/"){ url="/index.php"; }
	while(i<15){
		if(url!="/"+pages[i]){
			document.writeln("<td width="+pages[i+1]+" align=right valign=bottom><a href="+pages[i++]+" class=topnav>"+pages[++i]+"</a></td>");
		i++;
		}
		else{
			i++;
			document.writeln("<td width="+pages[i++]+" align=right valign=bottom><a class=currentpage>"+pages[i++]+"</a></TD>");
		}
	}
}

function slideit(){

	blendimage("blenddiv","blendimg", eval("image"+step+".src"), 2000);
		
	whichimage = step;

	if (step < 4)
		step++;
	else
		step = 1;

	setTimeout("slideit()",5000);
}
