// JavaScript Document

//code for the gallery
// JavaScript Document
var tourDiv;
var tour_show_mode = "thumbnails";
var tour_thumbnails;
var tab_heading2;

function tour_init() {
	//alert("init()");
	tab_heading2 = document.getElementById("undefinednav2");
	tour_thumbnails = document.getElementById("tour_thumbnails");
	tourDiv = document.getElementById("tourDiv");

	//alert("thumbnails=" + thumbnails + " tab_heading1=" + tab_heading1 + " imageDiv=" + imageDiv + " imageHolder=" + imageHolder + " textSpan=" + textSpan);
}

function showTourThumbnails() {
	tour_show_mode = "thumbnails";
	tour_thumbnails.className="visible";
	tourDiv.className="hidden";

	tab_heading2.innerHTML = "Visite Virtuelle";
	tab_heading2.className = "normal_link";
}

function showTourImage() {
	tour_show_mode = "tour";
	tour_thumbnails.className="hidden";
	tourDiv.className="visible";

	tab_heading2.innerHTML = "Back to Tours";
	tab_heading2.className = "back_link";
}

function showTour(path_prefix, tour, res) {
	if ((tour_thumbnails == null)
	|| (tourDiv == null)) {
		tour_init();
	}

	//alert("showTour(" + path_prefix + ", " + tour + ", " + res + ")");

	var width = 525;
	var height = 350;
	if (res == "low") {
		width = 402;
		height = 247;
	}

	var html = '';
	//var html = '<DIV style="Z-INDEX: 2; LEFT: 0px; WIDTH: 200px; POSITION: absolute; TOP: 2px; HEIGHT: 115px">\n';
	//html += '<script type="text/javascript">\n';
	//html += "AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0','width','525','height','350','id','" + tour + "-high','align','middle','src','" + tour + "-high','quality','high','wmode','transparent','bgcolor','#ffffff','name','" + tour + "-high','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','" + tour + "-high' );\n";
	//html += '</script><noscript>\n';
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '" height="' + height + '" id="' + tour + '-high" align="middle">\n';
	html += '<param name="allowScriptAccess" value="sameDomain" />\n';
	html += '<param name="movie" value="' + path_prefix + '/' + tour + '/' + res + '/' + tour + '-' + res + '.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="' + path_prefix + '/' + tour + '/' + res + '/' + tour + '-' + res + '.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="' + tour + '-' + res + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
	html += '</object>\n';
	//html += '</noscript>\n';
	//html += '</DIV>\n';

	tourDiv.innerHTML = html;
	//alert(html);
	showTourImage();
}

function showMovie(path_prefix, tour) {
	if ((tour_thumbnails == null)
	|| (tourDiv == null)) {
		tour_init();
	}

	//alert("showTour(" + path_prefix + ", " + tour + ")");

	var folder = "video";

	var html = '';

	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="480" height="320" id="ALA video2" align="middle">\n';
	html += '<param name="allowScriptAccess" value="sameDomain" />\n';
	html += '<param name="movie" value="' + path_prefix + '/' + folder + '/' + tour + '.swf" /><param name="loop" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="' + path_prefix + '/' + folder + '/' + tour + '.swf" loop="false" quality="high" bgcolor="#000000" width="480" height="320" name="ALA video" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
	html += '</object>\n';

	tourDiv.innerHTML = html;
	//alert(html);
	showTourImage();
}