<!--
if (document.images){
//caches tour nav
	cat1 = new Image();
	cat1.src = "/images/commonuk/tour/catnav1.gif";
	cat11 = new Image();
	cat11.src = "/images/commonuk/tour/catnav1_over.gif";
	
	cat2 = new Image();
	cat2.src = "/images/commonuk/tour/catnav2.gif";
	cat21 = new Image();
	cat21.src = "/images/commonuk/tour/catnav2_over.gif";
	
	cat3 = new Image();
	cat3.src = "/images/commonuk/tour/catnav3.gif";
	cat31 = new Image();
	cat31.src = "/images/commonuk/tour/catnav3_over.gif";
	
	cat4 = new Image();
	cat4.src = "/images/commonuk/tour/catnav4.gif";
	cat41 = new Image();
	cat41.src = "/images/commonuk/tour/catnav4_over.gif";
	
	prev = new Image();
	prev.src = "/images/commonuk/tour/previous.gif";
	prev1 = new Image();
	prev1.src = "/images/commonuk/tour/previous_over.gif";
	prev0 = new Image();
	prev0.src = "/images/commonuk/tour/previous0.gif";
	
	next = new Image();
	next.src = "/images/commonuk/tour/next.gif";
	next1 = new Image();
	next1.src = "/images/commonuk/tour/next_over.gif";
	
	
	function iCt(i, iName){
    	document.images[i].src = eval(i + iName + ".src");
   	}
}

var current = 1;
var a = 1;          //historical tour start number
var b = 9;          //welcome to l-p
var c = 13;         //a year in champagne
var d = 24;         //winemaking process
var total = 43;

//invoked by next button - skips to next photo
function nextph(){
	hideText();
    if (current < total){
		transition(current, current+1);
		current += 1;
	}
	checkLayers();
	checkCategory();
}

//invoked by previous button - skips to prev photo
function prevph(){
	hideText();
    if (current > 1){
		transition(current, current-1);
		current -= 1;
	}
	checkLayers();
	checkCategory();
}

//determines whether to hide or show the previous or next buttons and shows the current text blurb
function checkLayers(){
	hideText();
	showLayer("text"+current)
	if (current == 1){
		hideLayer("previous")
		showLayer("next")
	} else if (current == total) {
		hideLayer("next")
	} else {
		showLayer("next")
		showLayer("previous")
	}
}

//advances to a particular section of the tour - invoked by tour nav
function advance(num){
	transition(current, num);
	current = num;
	checkLayers();
	checkCategory();
}

//hides text blurbs
function hideText(){
	for (i = 1; i <=total; i++){
	 	hideLayer("text"+i)
	}
}

//highlights approp tour nav button depending on current section
function checkCategory(){
	if (current < b){
		iCt('cat1',1); iCt('cat2',''); iCt('cat3',''); iCt('cat4',''); 
	} else if (current >= b && current < c) {
		iCt('cat1',''); iCt('cat2',1); iCt('cat3',''); iCt('cat4',''); 
	} else if (current >= c && current < d) {
		iCt('cat1',''); iCt('cat2',''); iCt('cat3',1); iCt('cat4',''); 
	} else if (current >= d) {
		iCt('cat1',''); iCt('cat2',''); iCt('cat3',''); iCt('cat4',1); 
	}
}

//transitions between photos
function transition(a,b){
if (a < 10) a = "0" + a
if (b < 10) b = "0" + b
if (IEnot5){
	

	var startImage = "/images/tour/ph"+ a +".jpg"
	var endImage = "/images/tour/ph"+ b +".jpg"
	  
    
	    photo.filters[0].apply();
		ph.src = endImage;
       	photo.filters[0].play();
} else {document.images["ph"].src = "/images/tour/ph"+ b +".jpg";}
}



function loadTour(){
//caches tour photos
	ph1 = new Image();
	ph1.src = "/images/tour/ph01.jpg";
	ph2 = new Image();
	ph2.src = "/images/tour/ph02.jpg";
	ph3 = new Image();
	ph3.src = "/images/tour/ph03.jpg";
	ph4 = new Image();
	ph4.src = "/images/tour/ph04.jpg";
	ph5 = new Image();
	ph5.src = "/images/tour/ph05.jpg";
	ph6 = new Image();
	ph6.src = "/images/tour/ph06.jpg";
	ph7 = new Image();
	ph7.src = "/images/tour/ph07.jpg";
	ph8 = new Image();
	ph8.src = "/images/tour/ph08.jpg";
	ph9 = new Image();
	ph9.src = "/images/tour/ph09.jpg";
	ph10 = new Image();
	ph10.src = "/images/tour/ph10.jpg";
	ph11 = new Image();
	ph11.src = "/images/tour/ph11.jpg";
	ph12 = new Image();
	ph12.src = "/images/tour/ph12.jpg";
	ph13 = new Image();
	ph13.src = "/images/tour/ph13.jpg";
	ph14 = new Image();
	ph14.src = "/images/tour/ph14.jpg";
	ph15 = new Image();
	ph15.src = "/images/tour/ph15.jpg";
	ph16 = new Image();
	ph16.src = "/images/tour/ph16.jpg";
	ph17 = new Image();
	ph17.src = "/images/tour/ph17.jpg";
	ph18 = new Image();
	ph18.src = "/images/tour/ph18.jpg";
	ph19 = new Image();
	ph19.src = "/images/tour/ph19.jpg";
	ph20 = new Image();
	ph20.src = "/images/tour/ph20.jpg";
	ph21 = new Image();
	ph21.src = "/images/tour/ph21.jpg";
	ph22 = new Image();
	ph22.src = "/images/tour/ph22.jpg";
	ph23 = new Image();
	ph23.src = "/images/tour/ph23.jpg";
	ph24 = new Image();
	ph24.src = "/images/tour/ph24.jpg";
	ph25 = new Image();
	ph25.src = "/images/tour/ph25.jpg";
	ph26 = new Image();
	ph26.src = "/images/tour/ph26.jpg";
	ph27 = new Image();
	ph27.src = "/images/tour/ph27.jpg";
	ph28 = new Image();
	ph28.src = "/images/tour/ph28.jpg";
	ph29 = new Image();
	ph29.src = "/images/tour/ph29.jpg";
	ph30 = new Image();
	ph30.src = "/images/tour/ph30.jpg";
	ph31 = new Image();
	ph31.src = "/images/tour/ph31.jpg";
	ph32 = new Image();
	ph32.src = "/images/tour/ph32.jpg";
	ph33 = new Image();
	ph33.src = "/images/tour/ph33.jpg";
	ph34 = new Image();
	ph34.src = "/images/tour/ph34.jpg";
	ph35 = new Image();
	ph35.src = "/images/tour/ph35.jpg";
	ph36 = new Image();
	ph36.src = "/images/tour/ph36.jpg";
	ph37 = new Image();
	ph37.src = "/images/tour/ph37.jpg";
	ph38 = new Image();
	ph38.src = "/images/tour/ph38.jpg";
	ph39 = new Image();
	ph39.src = "/images/tour/ph39.jpg";
	ph40 = new Image();
	ph40.src = "/images/tour/ph40.jpg";
	ph41 = new Image();
	ph41.src = "/images/tour/ph41.jpg";
	ph42 = new Image();
	ph42.src = "/images/tour/ph42.jpg";
	ph43 = new Image();
	ph43.src = "/images/tour/ph43.jpg";
	
	next0 = new Image();
	next0.src = "/images/tour/next0.gif";
	
	//loads the next button, the first photo and the first text blurb after the last image is cached
	ph43.onLoad = showLayer("next"); ph43.onLoad = iCt("ph",1); ph43.onLoad = iCt("next",""); ph43.onLoad = showLayer("text1")
	
}

-->