﻿// JScript File
	
	var sponsorImage = new Array();
	sponsorImage[0] = '../images/MasterFrames_180x50.jpg';
	sponsorImage[1] = '../images/Coles_180x50.jpg';
	sponsorImage[2] = '../images/Betfair_180x50.jpg'; 
	sponsorImage[3] = '../images/NanaJudy_180x50.jpg';
	sponsorImage[4] = '../images/RoyalWolf_180x50.jpg';
	sponsorImage[5] = '../images/WorkersClub_180x50.jpg';
	sponsorImage[6] = '../images/Kennedy_180x50.jpg';
	sponsorImage[7] = '../images/PlasterLinings_180x50.jpg';
	
	var imagesPreloaded = new Array(7);
	for (var i=0; i < sponsorImage.length; i++)
	{
	    imagesPreloaded[i] = new Image(180,50); 
	    imagesPreloaded[i].src = sponsorImage[i];
	}

	
	var currentIndex = 0;
	
	function sponsorTime()
	{
	    if (currentIndex < imagesPreloaded.length - 1)
	        currentIndex = currentIndex + 1;
	    else
	        currentIndex = 0;
	        
	    document.images["imgSponsor"].src = imagesPreloaded[currentIndex].src;
	    
	    var delay = setTimeout("sponsorTime()",3000);
	        
	}
	
	
	
	
	var photographNumber = 81;	
	
	var photosPreloaded = new Array(88);
	for (var i=1; i <= 88; i++)
	{
	    photosPreloaded[i] = new String();
	    photosPreloaded[i] = "../pictures/photo" + i.toString() + ".jpg";;
	}
	
	function movePhotographs(increment)
	{
	    if ((photographNumber >= 85) && (increment > 0))
	        photographNumber = -3;
	    
	    if ((photographNumber <= 1) && (increment < 0)) 
	        photographNumber = 89;    
	    
	    photographNumber = photographNumber + increment;
	     
	    document.images["Photograph1"].src = photosPreloaded[photographNumber];
	    document.images["Photograph2"].src = photosPreloaded[photographNumber + 1];
	    document.images["Photograph3"].src = photosPreloaded[photographNumber + 2];
	    document.images["Photograph4"].src = photosPreloaded[photographNumber + 3];
	}
	
	function movePhotographs_Old(increment)
	{
	    if ((photographNumber >= 69) && (increment > 0))
	        photographNumber = -3;
	    
	    if ((photographNumber <= 5) && (increment < 0)) 
	        photographNumber = 65;    
	    
	    photographNumber = photographNumber + increment;
	    var imageTwo = photographNumber + 1;
	    var imageThree = photographNumber + 2;
	    var imageFour = photographNumber + 3;
	     
	    document.images["Photograph1"].src = "../pictures/photo" + photographNumber.toString() + ".jpg";
	    document.images["Photograph2"].src = "../pictures/photo" + imageTwo.toString() + ".jpg";
	    document.images["Photograph3"].src = "../pictures/photo" + imageThree.toString() + ".jpg";
	    document.images["Photograph4"].src = "../pictures/photo" + imageFour.toString() + ".jpg";
	}

	
	
	
	
	function toggleVisibility(source)
	{
	    switch(source)
	    {       
	        case "welcome2":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "welcome3":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "latestNews1":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "latestNews2":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "latestNews3":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "fixture1":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "fixture2":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;    
	            
	        case "archive2009":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "history":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "merchandise":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "social":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "committee":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "sponsors1":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	       
	        case "sponsors2":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	             
	        case "interclub":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	            
	        case "national":
	            eval("welcome1Table.style.display = \"none\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"\"");  
	            break;
	            
	        default:
	            eval("welcome1Table.style.display = \"\"");
	            eval("welcome2Table.style.display = \"none\"");
	            eval("welcome3Table.style.display = \"none\"");
	            eval("latestNews1Table.style.display = \"none\"");
	            eval("latestNews2Table.style.display = \"none\"");
	            eval("latestNews3Table.style.display = \"none\"");
	            eval("fixture1Table.style.display = \"none\"");
	            eval("fixture2Table.style.display = \"none\"");
	            eval("historyTable.style.display = \"none\"");
	            eval("merchandiseTable.style.display = \"none\"");
	            eval("socialTable.style.display = \"none\"");
	            eval("committeeTable.style.display = \"none\"");
	            eval("sponsors1Table.style.display = \"none\"");
	            eval("sponsors2Table.style.display = \"none\"");
	            eval("interclubTable.style.display = \"none\"");
	            eval("nationalTable.style.display = \"none\"");  
	            break;
	    }	
	}
	
	
	
	
	function toggleVisibility2(source)
	{			
		//depending from where this method was called the value of imageState can refer to any
	    //of the above instance vars.
	    var imageState = eval(source + "Collapsed");
	    
	    //If menu is not collapsed, change icon to collapse icon and reveal sub list.
		if (imageState)
		{
			//document.images[source].src = "../UCS/../images/minus.gif";
			eval(source + "Table.style.display = \"\"");
		}
		
		 //If menu is collapsed, change icon to expand icon and hide sub list.
		else
		{
			//document.images[source].src = "../UCS/../images/add.gif";
			eval(source + "Table.style.display = \"none\"");
		}
		
		//Negate state of either employeeCollapsed, projectCollapsed or managementCollapsed.
		eval(source + "Collapsed = !(" + source + "Collapsed)");	
	}
	
	
	
	function newWindow(strURL, strTitle)
	{
		switch (strTitle)
		{		
			case "Photograph":
			    newWin = window.open(strURL,"","toolbar=0,location=0,directories=0,status=no,menubar=no,scrollbars=no,resizable=yes,screenX=200,screenY=10,left=200,top=10,width=715,height=800");
				newWin.focus();
				break;
			
			case "Guernsey":
			    newWin = window.open(strURL,"","toolbar=0,location=0,directories=0,status=no,menubar=no,scrollbars=no,resizable=yes,screenX=125,screenY=10,left=125,top=10,width=842,height=595");
				newWin.focus();
				break;
				
			case "Report":
				newWin = window.open(strURL,"","toolbar=0,location=0,directories=0,status=no,menubar=no,scrollbars=yes,resizable=yes,screenX=200,screenY=10,left=200,top=10,width=715,height=790");
				newWin.focus();
				break;
			
			case "Map":
				newWin = window.open(strURL,"","toolbar=0,location=0,directories=0,status=no,menubar=no,scrollbars=no,resizable=yes,screenX=200,screenY=10,left=200,top=10,width=715,height=800");
				newWin.focus();
				break;
	    }   
	}
