var sequence=1;
var bannerSequence=1;

startList = function() {
	
	var t;
	var t2;
	
	if( document.getElementById ) {

		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {

			node = navRoot.childNodes[i];

			if (node.nodeName=="LI") {

				node.onmouseover=function() {
					this.className+=" over";
				}

				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}

			}  			
		}	


		t=setTimeout("advertChange()",3000);  		
		
		t2=setTimeout("bannerChange()",7000); 

	}
}
window.onload=startList;

function advertChange() {

		thehead = document.getElementById("header");

		

		switch( sequence ) {
		
			case 0:
				thehead.className = "main_content_area_head1";
				break;
			case 1:
				thehead.className = "main_content_area_head2";
				break;
			case 2:
				thehead.className = "main_content_area_head3";
				break;
			case 3:
				thehead.className = "main_content_area_head4";
				break;
			case 4:
				thehead.className = "main_content_area_head5";			
				break;
			case 5:
				thehead.className = "main_content_area_head6"; 
				break;
		}
		
		sequence++;
		
		if( sequence > 5 )
			sequence = 0;
			
		t=setTimeout("advertChange()",4000);  

}

function bannerChange() {

		thebanner = document.getElementById("banner");
		thebannerlink = document.getElementById("bannerlink");

		
		switch( bannerSequence ) {
		
			case 0:

				thebanner.src = "QMA2Large.jpg";
				thebannerlink.href = 'http://www.webshop.ical.co.uk/shop/Software.html';
				break;			
			case 1:
				
				thebanner.src = "QMALarge.jpg";
				thebannerlink.href = 'http://www.webshop.ical.co.uk/shop/Software.html';
				break;				
			case 2:

				thebanner.src = "freenotes.jpg";
				thebannerlink.href = 'http://www.webshop.ical.co.uk/shop/Freebies.html';
				break;				
			case 3:

				thebanner.src = "QMSLarge.jpg";
				thebannerlink.href = 'http://www.webshop.ical.co.uk/shop/Standalone_Software.html';
				break;				
		}
		
		bannerSequence++;
		
		if( bannerSequence > 3 )
			bannerSequence = 0;
			
		t2=setTimeout("bannerChange()",7000);  

}