var tempHtml;
var tempStr1;
var tempStr2;
if (section == null)	var section = 0;
if (level1 == null)	var level1 = "";
if (level2 == null)	var level2 = "";
if (level3 == null)	var level3 = "";
if (selectArray == null)	var selectArray = null;
var id1 = null;
var id2 = null;
var id3 = null;

/*
getLevel();
genId();
*/

function getLevel() {
	var link = location.href.toString();
	var obj = sectionArray[section];
	
	if (level1 == "") {
		for (var i=0; i<obj.length; i++) {
			if (link.indexOf(("/" + obj[i].id + "/")) > -1) {
				level1 = obj[i].id;
				
				if (level2 == "" && obj[i].subSection) {
					var obj1 = obj[i].subSection;
					
					for (var j=0; j<obj1.length; j++) {
						if (link.indexOf((obj1[j].id)) > -1) {
							level2 = obj1[j].id;
							
							if (level3 == "" && obj1[j].subSection) {
								var obj2 = obj1[j].subSection;
								
								for (var k=0; k<obj2.length; k++) {
									if (link.indexOf((obj2[k].id)) > -1) {
										level3 = obj2[k].id;
										
										break;
									}
								}
							} else {
								break;
							}
						}
					}
				} else {
					break;
				}
			}
		}
	}	
	
	
	
//	alert("level2: "+level2);
}


function genId() {	
	var obj = sectionArray[section];
	
	if (level1 != "") {
		for (var i=0; i<obj.length; i++) {
			//alert(obj[i].id + "  " + level1);
			if (obj[i].id == level1) {
				id1 = i;
				
				if (level2 != "") {
					var obj1 = obj[i].subSection;
					for (var j=0; j<obj1.length; j++) {
						//alert(obj[i].id + "  " + level1);
						if (obj1[j].id == level2) {
							id2 = j;
							
							if (level3 != "") {
								var obj2 = obj1[j].subSection;
								for (var k=0; k<obj2.length; k++) {
									//alert(obj[i].id + "  " + level1);
									if (obj2[k].id == level3) {
										id3 = k;
										break;
									}
								}
							} else {
								break;
							}
						}
					}
				} else {
					break;
				}
			}
		}
	}
//window.status = ("id1: "+id1+"   id2: "+id2+"   id3: "+id3);
}

function getTree()
{
	var loc = String(location);
	loc.replace('\\','/');
	var sitePath = loc.split("//")[1];
	var siteSplit = sitePath.split("/");
	var siteSplitIndex = 1;
	if (loc.indexOf("testing")!=-1) siteSplitIndex = 2;
	this["lang"] = siteSplit[siteSplitIndex];
	var tree = new Array();
	for (var i=(1+siteSplitIndex); i<siteSplit.length; i++)
		{
			var txt = siteSplit[i].split("#")[0];
			txt = txt.split("_")[0];
			txt = String(txt).replace(".html","");
			txt = String(txt).replace(".htm","");
			tree.push(String(txt));
		}
	return tree;
}

function genSectionNavElement()
{
	var str = '';
	var sections = sectionArray[0];
	
	for (var i=0; i<sections.length; i++)
		{
			var elementHeight = 22;
			var sect = sections[i];
			if (sect.id != getTree()[0].toString()) {continue};
			
			//var eqw = ' style="display:block;margin:0;padding:0;"';
			var eqw = ' class="navPin" style="margin:0;padding:0;"';
			
			if (typeof(sect.subSection)=='undefined') continue;
			
			for (var k=0; k<sect.subSection.length; k++)
				{
					var subSect = sect.subSection[k];
					
//					str += '<li><a href="'+subSect.link+'">'+subSect.name+'</a></li>';

					str += '<li'+eqw+'><a href="'+subSect.link+'" class="nav'+(1+k)+'">'+subSect.name+'<!--[if IE 7]><!--></a><!--<![endif]-->';
					//eqw = ' style="display:block;margin:0;padding:0;"';
					str += '<!--[if lte IE 6]><table><tr><td><![endif]-->';
					str += '<!--[if lte IE 8]><table><tr><td><![endif]-->';
					
					if (typeof(subSect.subSection)!='undefined')
						{
							if (subSect.subSection.length>0)
								{
									str += '	<ul style="background-position:30px '+(-195+elementHeight*subSect.subSection.length)+'px !important;">';
									//str += '	<ul style="background-position:30px -46px !important;">';
								}
							for (var m=0; m<subSect.subSection.length; m++)
								{
									var sndSubSect = subSect.subSection[m];
									var lastClass = '';
									if (m==(subSect.subSection.length-1))
										{
											lastClass = ' class="last"';
										}
									str += '<li'+lastClass+'><a href="'+sndSubSect.link+'" title="'+sndSubSect.name+'">'+sndSubSect.name+'</a></li>';
								}
							if (subSect.subSection.length>0)
								{
									str += '	</ul>';
								}
						}
					str += '<!--[if lte IE 6]></td></tr></table></a><![endif]-->';
					str += '<!--[if lte IE 8]></td></tr></table></a><![endif]-->';
					str += '</li>';
				}
		}

	return str;
}

function getPinWidth()
{
	var elem = document.getElementById('navMenuContainer');
	var liList = elem.getElementsByTagName("li");
	var pinsWidth = 0;
	var gap = 0;
	//var count = 0;
	
//	alert(liList.length);
	for (var i=0; i<liList.length; i++)
		{
			var pin = liList[i];
			if (pin.className.toString() != 'navPin') continue;
			//count++;
			//alert(pin.clientWidth);
			pinsWidth += pin.clientWidth;
		}
	var diff = gap*(liList.length-1) + pinsWidth;
//	elem.style.position = 'absolute';
	elem.style.width = diff +'px';
	//elem.style.left = -diff/2+'px';
	//alert(count + " :" + diff);
	var w = document.getElementById('mainContainer').offsetWidth;
//	alert('pinsWidth :' + (w - diff)/2);
//	alert(Math.round((w - diff)/2))
	elem.style.left = Math.round((w - diff)/2)  + 'px';
}


function genSectionNav() {
	tempHtml = '';
	tempHtml += '<div id="titleImage"><img src="'+path+'images/about/title_about.gif" alt="About MFW" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" class="navMenu resetstyles">';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}

function genActNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/activities/title_activities.gif" alt="Activities" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" class="navMenu resetstyles">';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Wedding</a></li>';
	// tempHtml += '			<li><a href="#">Birthday</a></li>';
	// tempHtml += '			<li><a href="#">Graduation</a></li>';
	// tempHtml += '			<li><a href="#">Packages</a></li>';
	// tempHtml += '			<li><a href="#">Graduation</a></li>';
	// tempHtml += '			<li><a href="#">Outside Catering</a></li>';
	// tempHtml += '			<li><a href="#">Roman Amphitheatre</a></li>';
	// tempHtml += '			<li><a href="#">Street Performance</a></li>';
	// tempHtml += '			<li><a href="#">Contact Us</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}

function genConNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/convention/title_convention.gif" alt="Convention" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" class="navMenu resetstyles">';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Meeting</a></li>';
	// tempHtml += '			<li><a href="#">Icentive</a></li>';
	// tempHtml += '			<li><a href="#">Conference</a></li>';
	// tempHtml += '			<li><a href="#">Exhibition</a></li>';
	// tempHtml += '			<li><a href="#">Hotel</a></li>';
	// tempHtml += '			<li><a href="#">Convention Fact Sheet</a></li>';
	// tempHtml += '			<li><a href="#">Enquiry Form</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}

function genHotelNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/hotel/title_hotel.gif" alt="Hotel" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" class="navMenu resetstyles">';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Rocks Hotel</a></li>';
	// tempHtml += '			<li><a href="#">The Landmak Macau</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}
function genGameNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/gaming/title_gaming.gif" alt="Gaming" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" class="navMenu resetstyles">';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Rocks Hotel</a></li>';
	// tempHtml += '			<li><a href="#">The Landmak Macau</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}

function genInteractiveNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/interactive/title_interactive.gif" alt="Interactive Zone" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" class="navMenu resetstyles">';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Photo Library</a></li>';
	// tempHtml += '			<li><a href="#">Virtual Gallery</a></li>';
	// tempHtml += '			<li><a href="#">Download Wallpaper</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}

function genPlanvisitNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/planvisit/title_planvisit.gif" alt="Plan Your Visit" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" class="navMenu resetstyles">';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Opening Time / Weather Arrangement</a></li>';
	// tempHtml += '			<li><a href="#">Location Map</a></li>';
	// tempHtml += '			<li><a href="#">Transportation</a></li>';
	// tempHtml += '			<li><a href="#">Car Parking</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}


function genSearchNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/search/title_search_nav.gif" alt="Search" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" >';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Introduction</a></li>';
	// tempHtml += '			<li><a href="#">Press Room</a></li>';
	// tempHtml += '			<li><a href="#">Career Opportunity</a></li>';
	// tempHtml += '			<li><a href="#">Business Opportunity</a></li>';
	// tempHtml += '			<li><a href="#">Our Partners</a></li>';
	// tempHtml += '			<li><a href="#">Contact Us</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
	
}
function genSitemapNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/sitemap/title_sitemap_nav.gif" alt="Sitemap" /></div>';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '		<div id="navMenuContainer" >';
	tempHtml += '		<ul>';
	tempHtml += genSectionNavElement();
	// tempHtml += '			<li><a href="#">Introduction</a></li>';
	// tempHtml += '			<li><a href="#">Press Room</a></li>';
	// tempHtml += '			<li><a href="#">Career Opportunity</a></li>';
	// tempHtml += '			<li><a href="#">Business Opportunity</a></li>';
	// tempHtml += '			<li><a href="#">Our Partners</a></li>';
	// tempHtml += '			<li><a href="#">Contact Us</a></li>';
	tempHtml += '		</ul>';
	tempHtml += '	</div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
	
}

function genOtherNav() {
	tempHtml = '';
	tempHtml += '<div class="navMenuBg">';
//	tempHtml += '<div id="sectionContainer" class="resetstyles">';
	tempHtml += '	<div align="center"><div id="titleImage"><img src="'+path+'images/other/title_others.gif" alt="Other Services / Facilities" /></div></div>';
//	tempHtml += '</div>';
	tempHtml += '</div>';
	
	
	document.write(tempHtml);
	
	getPinWidth();
}

function genShopInfoNav() {
	tempHtml = '';
	tempHtml += '	<div id="titleImage"><img src="'+path+'images/'+getTree()[0].toString()+'/title_'+getTree()[0].toString()+'.gif" alt="Fun" /></div>';
	tempHtml += '	<div class="">';
	tempHtml += '	<div class="shop_nav">';
	tempHtml += '		<div id="shop_prev" class="shop_prev"><a>Previous Shop Name</a></div>';
	tempHtml += '		<div class="shop_back"><a>Back to Fun Directory</a></div>';
	tempHtml += '		<div id="shop_next" class="shop_next"><a>Next Shop Name</a></div>';
	tempHtml += '		<br class="clearer" />';
	tempHtml += '	</div>';
	tempHtml += '</div>';
	
	document.write(tempHtml);
}

var menuH = 200;
function genMenu(i, isSect) {
	var sect = 0;
	var obj = sectionArray[sect];
	var total = obj.length;
	
	tempHtml += '<div style="position:absolute; z-index:100;">';
	
	if (navigator.appName.indexOf("Microsoft") > -1) {
		tempHtml += '<div id="mask_'+i+'" style="position:absolute; overflow:hidden; left:5px; top:35px; width:150px; height:200px;">';
	} else {
		tempHtml += '<div id="mask_'+i+'" style="position:absolute; left:5px; top:235px;">';
	}
	
		if (obj[i].subSection) {
			var obj1 = obj[i].subSection;
			
			tempHtml += '<div id="navMenu_'+i+'" style="position:absolute; top:'+(-menuH)+'px; visibility:hidden; left:0px;" onMouseOver="navOver('+i+', 1, '+isSect+');" onMouseOut="navOver('+i+', 0, '+isSect+');" class="subNavWidth">';
			tempHtml += '	<table width="135" border="0" cellspacing="0" cellpadding="0">';
			tempHtml += '		<tr>';
			tempHtml += '			<td><img src="'+path+'images/subnav_top.gif" alt=""></td>';
			tempHtml += '		</tr>';
			tempHtml += '		<tr>';
			tempHtml += '			<td bgcolor="#333333">';
			tempHtml += '				<table width="100%" border="0" cellspacing="0" cellpadding="0">';
			
			for (var j=0; j<obj1.length; j++) {
				tempHtml += '					<tr>';
				tempHtml += '						<td style="padding:5px 0px 5px 5px;"><a href="'+genLink(obj1[j].link)+'" target="'+obj1[j].target+'" class="subNav">'+obj1[j].name+'</a></td>';
				tempHtml += '					</tr>';
				
			if (j<(obj1.length-1))	tempHtml += '<tr><td style="border-right:3px solid #333333; border-left:3px solid #333333;"><img src="'+path+'images/subnav_dash.gif" width="129" height="1"></td></tr>';
			
			if (obj1[j].subSection) {
				var obj2 = obj1[j].subSection;
				
				tempHtml += '					<tr>';
				tempHtml += '						<td>';
				tempHtml += '							<table width="100%" border="0" cellspacing="0" cellpadding="0">';
				for (var k=0; k<obj2.length; k++) {
					tempHtml += '								<tr valign="top">';
					tempHtml += '<td style="padding:3px 5px 3px 10px; color:#FFFFFF;">-</td>';
					tempHtml += '<td style="padding:3px 0px 3px 0px;"><a href="'+genLink(obj2[k].link)+'" target="'+obj2[k].target+'" class="subNav">'+obj2[k].name+'</a></td>';
					tempHtml += '								</tr>';
					
					tempHtml += '<tr><td colspan="2" style="border-right:3px solid #333333; border-left:3px solid #333333;"><img src="'+path+'images/subnav_dash.gif" width="129" height="1"></td></tr>';
				}
				tempHtml += '							</table>';
				tempHtml += '</td>';
				tempHtml += '					</tr>';
			}
		}
				
			tempHtml += '				</table>';
			tempHtml += '			</td>';
			tempHtml += '		</tr>';
			tempHtml += '		<tr>';
			tempHtml += '			<td><img src="'+path+'images/subnav_shadow.png" width="135" height="26" class="pngImg" alt=""></td>';
			tempHtml += '		</tr>';
			tempHtml += '	</table>';
			tempHtml += '</div>';
		}
	tempHtml += '</div>';
	tempHtml += '</div>';
}

function genLink(i) {
	if ((i.indexOf('javascript') > -1) | (i.indexOf('http') > -1) | (i.indexOf('#') > -1)) {
		var link = i;
	} else {
		var link = path + i;
	}
	
	return link;
}

var maskDiv;
var layer;

function navOver(i, over, isSect) {
	var sect = 0;
	var obj = sectionArray[sect];
	var btn = document.getElementById('nav_'+i);
	
	if (document.getElementById('navMenu_'+i)) {
		var layer = document.getElementById('navMenu_'+i);
		maskDiv = document.getElementById('mask_'+i);
	}
	
	if (over == 1) {
		if (!isSect)	btn.src = path + 'images/nav/nav_'+obj[i].id+'_over.gif';
		
		if (layer) {
			menuGo(i, 1, 1);
			maskDiv.style.height = menuH;
		}
	} else {
		if (!isSect)	btn.src = path + 'images/nav/nav_'+obj[i].id+'.gif';
		
		if (layer) {
			menuGo(i, 0, 1);
		}
	}
}

var goSpeed = 1;
var speed;
var goStep;
var timeOut;
var objTop;
var tempTop;
var layer;


function menuGo(i, over, motion) {
	var sect = 0;
	var obj = sectionArray[sect];
	
	layer = document.getElementById('navMenu_'+i);
	
	if (over) {
	/*	for (var k=0; k<obj.length; k++) {
			if (k != i) {
				if (document.getElementById('navMenu_'+k)) {
					var temp = document.getElementById('navMenu_'+k);
					temp.style.top = -menuH;
					var	temp = document.getElementById(('mask_'+k));
					temp.style.height = 1;
				}
			}
		}*/
		
		if (layer)	layer.style.visibility = 'visible';
		
		layer.tempTop = -3;
		layer.speed = 10;
		pulldownMotion();
	} else {
		if (navigator.appName.indexOf("Microsoft") > -1) {
			layer.tempTop = -menuH;
			layer.speed = 5;
			layer.timeOut = setTimeout('pulldownMotion();', 200);
		} else {
			layer.style.visibility = 'hidden';
		}
	}
}

function pulldownMotion() {
	if (navigator.appName.indexOf("Microsoft") > -1) {
		layer.objTop = Number(layer.style.pixelTop);
		
		layer.goStep = (layer.tempTop - layer.objTop)/layer.speed;
		
		if (!(Math.abs(layer.objTop - layer.tempTop) < 1)) {
			layer.objTop += layer.goStep;
			layer.timeOut = setTimeout("pulldownMotion()", goSpeed);
		} else {
			layer.objTop = layer.tempTop;
			clearTimeout(layer.timeOut);
		}
		window.status = layer.objTop;
		layer.style.pixelTop = layer.objTop;
		maskDiv.style.pixelHeight += layer.goStep;
	} else {
		layer.objTop = layer.tempTop;
		
		layer.style.top = layer.objTop;
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function genFooter() {
	document.writeln("<div id=\"footerContainer\">&copy; Copyright Macau Fisherman's Wharf International Investment LTD. 2008&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"javascript:MM_openBrWindow(\'..\/disclaimer.html\',\'Disclaimer\',\'scrollbars=yes,width=425,height=600\')\">Disclaimer<\/a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"javascript:MM_openBrWindow(\'..\/privacy.html\',\'Privacy\',\'scrollbars=yes,width=425,height=560\')\">Privacy Statement<\/a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href=\"..\/about\/contact.html\">Contact Us<\/a><\/div>")
}

var videoArray = new Array();
videoArray = ['aladdlin', 'convention', 'afikana', 'babylon', 'centre', 'outside', 'louisiana', 'legend', 'rock', 'rossio', 'pier'];

function changeVrVideo(link)
{
	var video = videoArray[(link-1)];
	
	tempHtml = '';
	tempHtml += '		  <applet archive = "ptviewer.jar" code="ptviewer.class" width="490" height="245" id="vr">';
	tempHtml += '				<param name="file" value="'+path+'images/vr/'+video+'.jpg" />';
	tempHtml += '				<param name="frame" value="ptv_navbar.gif" />';
	tempHtml += '				<param name="wait" value="0" />';
	tempHtml += '				<param name="frame" value="0" />';
	tempHtml += '				<param name="barcolor" value="0000ff" />';
	tempHtml += '				<param name="bgcolor" value="D7F4F0" />';
	tempHtml += '				<param name="auto" value="-0.3" />';
	tempHtml += '				<param name="panmin" value="-180" />';
	tempHtml += '				<param name="panmax" value="180" />';
	tempHtml += '				<param name="pan" value="-175" />';
	tempHtml += '				<param name="tiltmin" value="-90" />';
	tempHtml += '				<param name="tiltmax" value="90" />';
	tempHtml += '				<param name="tilt" value="12" />';
	tempHtml += '				<param name="fovmin" value="40" />';
	tempHtml += '				<param name="fovmax" value="120" />';
	tempHtml += '				<param name="fov" value="102" />';
	tempHtml += '			</applet>';
	
	document.getElementById('vrContainer').innerHTML = tempHtml;
}

function changeVrTitle(link)
{
	var video = videoArray[(link-1)];
	
	tempHtml = '';
	tempHtml += '		  <img src="../images/interactive/txt_'+video+'.gif" alt="" />';
	
	document.getElementById('vr_txt').innerHTML = tempHtml;
}

var videoSection = null;

function changeVideo(i)
{
	if (videoSection == i)	return;
	var btn = document.getElementById('vr_photo_'+i);
	btn.src = path + 'images/interactive/btn_'+videoArray[i-1]+'_over.jpg';
	btn.clicked = true;
	
	if (videoSection)
	{
		var btn = document.getElementById('vr_photo_'+videoSection);
		btn.src = path + 'images/interactive/btn_'+videoArray[videoSection-1]+'.jpg';
		btn.clicked = false;
	}
	
	videoSection = i;
	
	changeVrVideo(i);
	changeVrTitle(i);
}


var d = document;

function contentOpen(target)
{	
	var title = d.getElementById('photoTitle');
	var desc = d.getElementById('photoDesc');
	
	title.innerHTML = photoArray [target - 1].title;
	
	desc.innerHTML = photoArray [target - 1].desc;
}

function popupClose()
{	
	d.getElementById('popup_content').style.display = 'none';
	
}

function popupPhoto(target)
{	
	
	d.getElementById('popup_content').style.display = 'block';
	
	tempHtml = '';
	tempHtml += '<div class="popup_btn_close"><a href="javascript:popupClose();"><img src="'+path+'images/interactive/btn_close.gif" alt="" border="0" /></a></div>';
	tempHtml += '<div class="popup_photo"><img src="'+path+'images/interactive/event/'+photoArray [target - 1].image+'.jpg" alt="" border="0" /></div>';
	
	d.getElementById('popup_content').innerHTML = tempHtml;
	
}