	
	var selectedbutton = '';
	

	function menuOver(ID, direction)
		{

			if(direction == 'in')
				{
					document.getElementById(ID).style.color = '#6699FF';
					document.getElementById(ID).style.cursor = 'pointer';
					document.getElementById(ID).style.fontWeight = 'bold';					
				}
			else
				{
					if(selectedbutton != ID)
						{
							document.getElementById(ID).style.color = '#ffffff';
							document.getElementById(ID).style.fontSize = 11;
							document.getElementById(ID).style.fontWeight = 'bold';
						}
				}
	
		}
		
	function navigate(ID)
		{

			switch(ID)
				{
					case 'TD1':
						window.location.href='index.asp?spg=1';
						break;
					case 'TD2':
						window.location.href='cobra.asp?spg=2';
						break;
					case 'TD3':
						window.location.href='ribeye.asp?spg=3';
						break;
					case 'TD4':
						window.location.href='olympic.asp?spg=4';
						break;
					case 'TD5':
						window.location.href='virtual.asp?spg=5';
						break;
					case 'TD6':
						window.location.href='contact.asp?spg=6';
						break;
					case 'TD7':
						window.location.href='Links.asp?spg=7';
						break;
				}
		}

	function setSelection(ID)
		{
			if(ID == 'TD')
				ID = 'TD1';

			selectedbutton = ID;
			document.getElementById(ID).style.color = '#6699FF';
		}
		
	var newWindow
	
	function openWindow(URL)
		{

			if(newWindow == null)
				{
					newWindow = window.open(URL,null,'width=800,height=500,scrollbars=yes,resizable=yes, status=yes,toolbar=yes,menubar=yes,location=yes');
				}
			else
				{
					newWindow.close();
					newWindow = window.open(URL,null,'width=800,height=500,scrollbars=yes,resizable=yes, status=yes,toolbar=yes,menubar=yes,location=yes');
				}
		}
		

	var scrollCounter = 0;
	var scrollText    = "Gliddon Marine - Quality new and used boat sales";
	var scrollDelay   = 20;
	var i = 0;

	while (i ++ < 140)
	scrollText = " " + scrollText;

	function Scroller()
	{
			window.status = scrollText.substring(scrollCounter++,scrollText.length);

			if (scrollCounter == scrollText.length)
			 scrollCounter = 0;

			setTimeout("Scroller()", scrollDelay);
	}


	function validate()
			{

				var valid
				valid = 1

				if(document.getElementById('NAME').value == '')
					{
						alert('Please enter your name');
						document.getElementById('NAME').focus();
						valid = 0
					}

				if(valid == 1)
					{
						if((document.getElementById('EMAIL').value == '') && (document.getElementById('TELNO').value == ''))
							{
								alert('Please enter an email address or telephone number');
								document.getElementById('EMAIL').focus();
								valid = 0
							}

					}


				if(valid == 1)
					{
						if(document.getElementById('QUERY').value == '')
							{
								alert('Please enter your query');
								document.getElementById('QUERY').focus();
								valid = 0
							}

					}

				if(valid == 1)
					window.location.href = 'Contact.asp?SendMail=1&Name=' + escape(document.getElementById('NAME').value) + '&TelNo=' + escape(document.getElementById('TELNO').value) + '&Email=' + escape(document.getElementById('EMAIL').value) + '&Query=' + escape(document.getElementById('QUERY').value) + '&spg=6';
		}


	function menuItem(ID)
		{
			document.getElementById('IFRAME').src = 'Items.asp?mi=' + ID
		}
		

	var newItem
	
	function openItem(ItemID)
		{

			if(newWindow == null)
				{
					newItem = window.open('PrintOut.asp?SelectedItemID=' + ItemID ,null,'width=690,height=700,scrollbars=yes,resizable=no, status=no,toolbar=no,menubar=yes,location=no');
				}
			else
				{
					newItem.close();
					newItem = window.open('PrintOut.asp?SelectedItemID=' + ItemID ,null,'width=690,height=700,scrollbars=yes,resizable=no, status=no,toolbar=no,menubar=yes,location=no');
				}
		}
		
	var pictures = new Array(9);
	var loadedimages = new Array(3);

	function randomImages()
		{
			var pic = 0
			var location = 0

			do
				{
					pic = Rnd(9)
					alreadyloaded = 0;

					for (n=0; n<=2; n++)
						{
							if(loadedimages[n] == pic)
								alreadyloaded = 1;
						}
				}
			while (alreadyloaded == 1);

			location = Rnd(3)
			document.getElementById('IMG' + location).src = pictures[pic].src;
			loadedimages[location] = pic;

			setTimeout('randomImages()', 2000);

		}

	function Rnd(maxnum)
		{
			n = Math.random();
			x = n * maxnum

			return parseInt(x);
		}

	function setup()
		{
			
			for (n=0; n<=8; n++)
				{
					pictures[n] = new Image();
				}

			pictures[0].src='graphics/boat1.jpg';
			pictures[1].src='graphics/boat2.jpg';
			pictures[2].src='graphics/boat3.jpg';
			pictures[3].src='graphics/boat4.jpg';
			pictures[4].src='graphics/boat5.jpg';
			pictures[5].src='graphics/boat6.jpg';
			pictures[6].src='graphics/boat7.jpg';
			pictures[7].src='graphics/boat8.jpg';
			pictures[8].src='graphics/boat9.jpg';

			loadedimages[0] = 0;
			loadedimages[1] = 4;
			loadedimages[2] = 8;

			randomImages();				
		}