// rotate images
	swap=1
	hillCt = 54
	opinanCt = 157
	headCt=28
	auroraCt =16
	tourCt = 98
	mountCt = 165
	weatherCt = 24
	houseCt = 11
	inhouseCt = 4
	xanCt = 16
	locCt =174
	walksCt = 241
	gardenCt = 59


	var birdtype = new Array();

	birdtype[1] = "image/birds/cuckoo1.jpg";
	birdtype[2] = "image/birds/eider1.jpg";
	birdtype[3] = "image/birds/gnd1.jpg";
	birdtype[4] = "image/birds/lapwing1.jpg";	
	birdtype[5] = "image/birds/ptarmigan4.jpg";
	birdtype[6] = "image/birds/redthroat1.jpg";
	birdtype[7] = "image/birds/ringedplover4.jpg";
	birdtype[8] = "image/birds/sandpiper2.jpg";
	birdtype[9] = "image/birds/shelduck5.jpg";
	birdtype[10] = "image/birds/skua3.jpg";
	birdtype[11]= "image/birds/stonechat4.jpg";
	birdtype[12] = "image/birds/tern8.jpg";
	birdtype[13] = "image/birds/wagtail1.jpg";
	birdtype[14] = "image/birds/wheatear12.jpg";
	birdtype[15] = "image/birds/btd1.jpg";
	birdtype[16] = "image/birds/wren1.jpg";
	birdtype[17] = "image/birds/snowbunting1.jpg";
	birdtype[18] = "image/birds/herring7.jpg";
	birdtype[19] = "image/birds/ringedplover6.jpg";
	birdtype[20] = "image/birds/barnacle2.jpg";
	birdtype[21] = "image/birds/dipper1.jpg";
	birdtype[22] = "image/birds/heron1.jpg";
	birdtype[23] = "image/birds/skylark1.jpg";
	birdtype[24] = "image/birds/meadow2.jpg";
	birdtype[25] = "image/birds/twite2.jpg";
	birdtype[26] = "image/birds/wren5.jpg";
	birdtype[27] = "image/birds/whimbrel2.jpg";
	birdtype[28] = "image/birds/wheatear7.jpg";
	birdtype[29] = "image/birds/snipe2.jpg";
	birdtype[30] = "image/birds/linnet2.jpg";
	birdtype[31] = "image/birds/blackbird1.jpg";
	birdtype[32] = "image/birds/gannet1.jpg";
	birdtype[33] = "image/birds/dunlin2.jpg";


	var birdCt = 1;
	var birdPass = birdtype.length-1;
	var birdLoad = new Array();

var faunatype = new Array();

	faunatype[1] = "image/fauna/otter1.jpg";
	faunatype[2] = "image/fauna/reddeer1.jpg";
	faunatype[3] = "image/fauna/seal1.jpg";
	faunatype[4] = "image/fauna/hare1.jpg";	
	faunatype[5] = "image/fauna/otter3.jpg";
	faunatype[6] = "image/fauna/goat1.jpg";
	faunatype[7] = "image/fauna/otter4.jpg";
	faunatype[8] = "image/fauna/pinemarten2.jpg";
	faunatype[9] = "image/fauna/otter5.jpg";
	faunatype[10] = "image/fauna/reddeer2.jpg";
	faunatype[11]= "image/fauna/seal2.jpg";
	faunatype[12] = "image/fauna/otter2.jpg";
	faunatype[13] = "image/fauna/seal3.jpg";
	faunatype[14] = "image/fauna/cows1.jpg";
	faunatype[15] = "image/fauna/reddeer3.jpg";
	faunatype[16] = "image/fauna/otter7.jpg";
	faunatype[17] = "image/fauna/pinemarten1.jpg";
	faunatype[18] = "image/fauna/seal4.jpg";
	faunatype[19] = "image/fauna/otter6.jpg";
	faunatype[20] = "image/fauna/seal7.jpg";
 	faunatype[21] = "image/fauna/otter9.jpg";

	var faunaCt = 1;
	var faunaPass = faunatype.length-1;
	var faunaLoad = new Array();


	var weatherdata = new Array(); 

	weatherdata[1] = 'graphics/wd/WindDirectionHistory.gif';
	weatherdata[2] = 'graphics/wd/RainHistory.gif';
	weatherdata[3] = 'graphics/wd/BarometerHistory.gif';
	weatherdata[4] = 'graphics/wd/WindSpeedHistory.gif';
	weatherdata[5] = 'graphics/wd/OutsideHumidityHistory.gif';
	weatherdata[6] = 'graphics/wd/OutsideTempHistory.gif';

	var wdct = 1;
	var wdpass = weatherdata.length-1;
	var wdLoad = new Array();

	function rotate() {

		if (document.images) {

			if (swap==1){	
				if (document.all){
				document.images.headerPic.style.filter="blendTrans(duration=.5)";
				document.images.headerPic.filters.blendTrans.Apply();}
				if (document.headerPic.complete) {
					randomNum1 = 1 + Math.floor(Math.random() * headCt);
					document.headerPic.src="image/pan/pan" + randomNum1 + ".jpg";
					if (document.all)document.images.headerPic.filters.blendTrans.Play();
					}
				}

			if (swap==2){	
				if (document.headerPic.complete) {
				if (document.all){
				document.images.nfcPic.style.filter="blendTrans(duration=.5)";
				document.images.nfcPic.filters.blendTrans.Apply();}
					randomNum1 = 1 + Math.floor(Math.random() * houseCt);
					document.nfcPic.src="image/house/h" + randomNum1 + ".jpg";
					if (document.all)document.images.nfcPic.filters.blendTrans.Play();
					}
				}

			if (swap==3){	
				if (document.nfcPic.complete) {
				if (document.all){
				document.images.opinanPic.style.filter="blendTrans(duration=.5)";
				document.images.opinanPic.filters.blendTrans.Apply();}
					randomNum1 = 1 + Math.floor(Math.random() * opinanCt);
					document.opinanPic.src="image/loc/loc" + randomNum1 + ".jpg"}
			if (document.all) document.images.opinanPic.filters.blendTrans.Play();
				}

			if (swap == 4){
				if (document.opinanPic.complete) {
				if (document.all){
				document.images.hillsPic.style.filter="blendTrans(duration=.5)";
				document.images.hillsPic.filters.blendTrans.Apply();}
					randomNum1 = 1 + Math.floor(Math.random() * hillCt);
					document.hillsPic.src="image/hills/ph" + randomNum1 + ".jpg"}
				if (document.all) document.images.hillsPic.filters.blendTrans.Play();
				}

			if (swap == 5){
				if (document.hillsPic.complete) {
				if (document.all){
				document.images.tourPic.style.filter="blendTrans(duration=.5)";
				document.images.tourPic.filters.blendTrans.Apply();}
					randomNum1 = 1 + Math.floor(Math.random() * tourCt);
					document.tourPic.src="image/tour/tour" + randomNum1 + ".jpg"}
				if (document.all) document.images.tourPic.filters.blendTrans.Play();
				}

			if (swap==6){	
				if (document.tourPic.complete) {
				if (document.all){
				document.images.walksPic.style.filter="blendTrans(duration=.5)";
				document.images.walksPic.filters.blendTrans.Apply();}
					randomNum1 = 1 + Math.floor(Math.random() * walksCt);
					document.walksPic.src="image/walks/walk" + randomNum1 + ".jpg"}
				if (document.all) document.images.walksPic.filters.blendTrans.Play();
					}



			if (swap==7){	
				if (document.walksPic.complete) {
				if (document.all){
				document.images.birdPic.style.filter="blendTrans(duration=.5)";
				document.images.birdPic.filters.blendTrans.Apply();}
				randomNum1 = 1 + Math.floor(Math.random() * birdPass);
				birdLoad[randomNum1] = new Image();
				birdLoad[randomNum1].src = birdtype[randomNum1];
				document.images.birdPic.src = birdLoad[randomNum1].src;
				}
				if (document.all) document.images.birdPic.filters.blendTrans.Play();
					}

			if (swap==8){	
				if (document.birdPic.complete) {
				if (document.all){
				document.images.faunaPic.style.filter="blendTrans(duration=.5)";
				document.images.faunaPic.filters.blendTrans.Apply();}
				randomNum1 = 1 + Math.floor(Math.random() * faunaPass);
				faunaLoad[randomNum1] = new Image();
				faunaLoad[randomNum1].src = faunatype[randomNum1];
				document.images.faunaPic.src = faunaLoad[randomNum1].src;
				}
				if (document.all) document.images.faunaPic.filters.blendTrans.Play();
				}

			if (swap==9){	
				if (document.faunaPic.complete) {
				if (document.all){
				document.images.auroraPic.style.filter="blendTrans(duration=.5)";
				document.images.auroraPic.filters.blendTrans.Apply();}
					randomNum1 = 1 + Math.floor(Math.random() * auroraCt);
					document.auroraPic.src="image/astronomy/aurora" + randomNum1 + ".jpg"}
				if (document.all) document.images.auroraPic.filters.blendTrans.Play();
					}

			if (swap==10){	
				if (document.auroraPic.complete) {
				if (document.all){
				document.images.gardenPic.style.filter="blendTrans(duration=.5)";
				document.images.gardenPic.filters.blendTrans.Apply();}
					randomNum1 = 1 + Math.floor(Math.random() * gardenCt);
					document.gardenPic.src="image/garden/g" + randomNum1 + ".jpg"}
				if (document.all) document.images.gardenPic.filters.blendTrans.Play();
					}


			if (swap==11){	
				if (document.gardenPic.complete) {
					randomNum1 = 1 + Math.floor(Math.random() * mountCt)
					document.mountPic.src="image/hills/hills" + randomNum1 + ".jpg"
					}
				}

			if (swap==12){	
				if (document.mountPic.complete) {
					randomNum1 = 1 + Math.floor(Math.random() * weatherCt)
					document.weatherPic.src="image/weather/w" + randomNum1 + ".jpg"
					}
				}


			if (swap==13){	
				if (document.weatherPic.complete) {
					randomNum1 = 1 + Math.floor(Math.random() * xanCt)
					document.xanPic.src="image/xan/xan" + randomNum1 + ".jpg"
					}
				}

			if (swap==14){	
				if (document.xanPic.complete) {
					randomNum1 = 1 + Math.floor(Math.random() * locCt)
					document.locPic.src="image/loc/loc" + randomNum1 + ".jpg"
					}
				}

			if (swap==15){	
				if (document.locPic.complete) {
					randomNum1 = 1 + Math.floor(Math.random() * tourCt)
					document.ttourPic.src="image/tour/tour" + randomNum1 + ".jpg"
					}
				}
			if (swap==16){	
				if (document.tourPic.complete) {
					randomNum1 = 1 + Math.floor(Math.random() * inhouseCt)
					document.housePic.src="image/house/h" + randomNum1 + ".jpg"
					}
				}

			if (swap==17){	
				if (document.housePic.complete) {
				wdLoad[wdct] = new Image();
				wdLoad[wdct].src = weatherdata[wdct];
				document.images.weatherdatafrm.src = wdLoad[wdct].src;
				}
			wdct++;
			if (wdct > (wdpass)) {wdct=1};

				}


		swap++
		if (swap > 17) { swap = 1}
		  	setTimeout('rotate()',1500);
					}
	}








// Date calculations
// get current date
	dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
	monName = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")







//Display Tariff window
	function tariffWindow() {
		tarWindow = window.open("tariff.htm" , "dirwin" ,  "width=600, height=650")
		}

// drop down menu

		stdBrowser = (document.getElementById) ? true : false

		function toggleMenu(currElem,nextPos) {
			menuObj = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
			if (toggleMenu.arguments.length == 1) {
				nextPos = (parseInt(menuObj.top) == 0) ? -90 : 0
			}
			menuObj.top = (stdBrowser) ? nextPos + "px" : nextPos
		}

// Popup window 
		function popUp(evt,currElem,topPix,leftPix) {
			popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
			if (document.all) {
				popUpWin.pixelTop = topPix
				popUpWin.pixelLeft = leftPix
							}
			else {
				if (stdBrowser) {
					popUpWin.top = topPix + "px"
					popUpWin.left = leftPix + "px"
				}
				else {
					popUpWin.top = topPix
					popUpWin.left = leftPix
				}
			}

			popUpWin.visibility = "visible"
		}

// Popdown window
		function popDown(currElem) {
			popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem)
			popUpWin.visibility = "hidden"
		}



	if (document.images) {
		homeButton1 = new Image
		homeButton2 = new Image
		homeButton3 = new Image
		homeButton1.src="graphics/homep1.gif"
		homeButton2.src="graphics/homep2.gif"
		homeButton3.src="graphics/homep3.gif"

		indexButton1 = new Image
		indexButton2 = new Image
		indexButton3 = new Image
		indexButton1.src="graphics/index1.gif"
		indexButton2.src="graphics/index2.gif"
		indexButton3.src="graphics/index3.gif"
	
		backButton1 = new Image
		backButton2 = new Image
		backButton3 = new Image
		backButton1.src="graphics/back1.gif"
		backButton2.src="graphics/back2.gif"
		backButton3.src="graphics/back3.gif"

		topButton1 = new Image
		topButton2 = new Image
		topButton3 = new Image
		topButton1.src="graphics/top1.gif"
		topButton2.src="graphics/top2.gif"
		topButton3.src="graphics/top3.gif"

		forwardButton1 = new Image
		forwardButton2 = new Image
		forwardButton3 = new Image
		forwardButton1.src="graphics/forward1.gif"
		forwardButton2.src="graphics/forward2.gif"
		forwardButton3.src="graphics/forward3.gif"

		mailButton1 = new Image
		mailButton2 = new Image
		mailButton3 = new Image
		mailButton1.src="graphics/mail1.gif"
		mailButton2.src="graphics/mail2.gif"
		mailButton3.src="graphics/mail3.gif"

		gbButton1 = new Image
		gbButton2 = new Image
		gbButton3 = new Image
		gbButton1.src="graphics/gb1.gif"
		gbButton2.src="graphics/gb2.gif"
		gbButton3.src="graphics/gb3.gif"

		drButton1 = new Image
		drButton2 = new Image
		drButton3 = new Image
		drButton1.src="graphics/dr1.gif"
		drButton2.src="graphics/dr2.gif"
		drButton3.src="graphics/dr3.gif"

		printButton1 = new Image
		printButton2 = new Image
		printButton3 = new Image
		printButton1.src="graphics/dirprint1.gif"
		printButton2.src="graphics/dirprint2.gif"
		printButton3.src="graphics/dirprint3.gif"

		twButton1 = new Image
		twButton2 = new Image
		twButton3 = new Image
		twButton1.src="graphics/tw1.gif"
		twButton2.src="graphics/tw2.gif"
		twButton3.src="graphics/tw3.gif"

		mwButton1 = new Image
		mwButton2 = new Image
		mwButton3 = new Image
		mwButton1.src="graphics/mw1.gif"
		mwButton2.src="graphics/mw2.gif"
		mwButton3.src="graphics/mw3.gif"

		ywButton1 = new Image
		ywButton2 = new Image
		ywButton3 = new Image
		ywButton1.src="graphics/yw1.gif"
		ywButton2.src="graphics/yw2.gif"
		ywButton3.src="graphics/yw3.gif"

		y5Button1 = new Image
		y5Button2 = new Image
		y5Button3 = new Image
		y5Button1.src="graphics/2005w1.gif"
		y5Button2.src="graphics/2005w2.gif"
		y5Button3.src="graphics/2005w3.gif"

		address1 = new Image
		address2 = new Image
		address3 = new Image
		address1.src="graphics/address.gif"
		address2.src="graphics/scotmap.gif"
		address3.src="graphics/address.gif"


	}
	else {
		homeButton1=""
		homeButton2=""
		homeButton3=""
		homeButton.document=""

		indexButton1=""
		indexButton2=""
		indexButton3=""
		indexButton.document=""

		backButton1=""
		backButton2=""
		backButton3=""
		backButton.document=""
		topButton1=""
		topButton2=""
		topButton3=""
		topButton.document=""
		forwardButton1=""
		forwardButton2=""
		forwardButton3=""
		forwardButton.document=""

		mailButton1=""
		mailButton2=""
		mailButton3=""
		mailButton.document=""

		gbButton1=""
		gbButton2=""
		gbButton3=""
		gbButton.document=""

		drButton1=""
		drButton2=""
		drButton3=""
		drButton.document=""

		printButton1=""
		printButton2=""
		printButton3=""
		printButton.document=""

		twButton1=""
		twButton2=""
		twButton3=""
		twButton.document=""


		mwButton1=""
		mwButton2=""
		mwButton3=""
		mwButton.document=""

		ywButton1=""
		ywButton2=""
		ywButton3=""
		ywButton.document=""

		y5Button1=""
		y5Button2=""
		y5Button3=""
		y5Button.document=""

		address1=""
		address2=""
		address3=""
		address.document=""



	}

//Distance calculator

	function getPLACE(milesto) {document.distances.milesShow.value = milesto}
