var bookmark = window.location.hash;
var tilt;
var fov;
var i;
var autopan = null;
var test1;
var initPan = 0.07;
var panValue = 0.07;

if (bookmark.charAt(0) == '#')
{
	var tmp = bookmark.substr(1).split(',');
	bookmark = unescape(tmp[0]);
	tilt = unescape(tmp[1]);
	fov = unescape(tmp[2]);
}

function change_mov(thisFile)
{
	path="/hdw/content/static/file/en/residential/hos07/phase3/vt/";
	
	var urlArr=location.href.split("/");
	var currSubDom = urlArr[2].split(".");
	
	if (currSubDom[0].substr(0,1).toLowerCase()=="s")
		imgPath="/hdw/content/static/images/gb/residential/hos07/phase3/";
	else
		imgPath="/hdw/content/static/images/b5/residential/hos07/phase3/";
	
	filename = thisFile + ".mov";
	thisURL = path + filename;
	imgSrc = imgPath + thisFile + ".jpg";
	
	html  = '<object id="_2" width="402" height="199"';
	html += ' onmouseover="window.clearInterval(document._2.autopan)"';
	html += ' classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"';
	html += ' codebase="http://www.apple.com/qtactivex/qtplugin.cab">';
	html += '  <param name="src" value="' + thisURL + '">';
	html += '  <param name="scale" value="tofit">';
	html += '  <param name="autoplay" value="true">';
	html += '  <param name="controller" value="false">';
	html += '  <param name="pan" value="0">';
	html += '  <embed name="_2" src="'+ thisURL + '"';
	html += '   width="400" height="200" scale="tofit"';
	html += '   pluginspage="http://www.apple.com/quicktime"';
	html += '   autoplay="true" controller="false" bgcolor="ffffff"';
	html += '   onmouseover="window.clearInterval(document._2.autopan)"';
	html += '   enablejavascript="true" pan="0">';
	html += '  </embed>';
	html += '</object>';
	
	document.getElementById("qt_mov").innerHTML = html;
	document.getElementById("qt_mov").style.visibility = "hidden";
	
	if(thisFile.toString().substring(0,4)=="tt_b")
	{
		if(document.getElementById("floorplan1"))
		{
			document.getElementById("floorplan2").style.display = "none";
			document.getElementById("floorplan1").style.display = "block";
			document.getElementById("floorplan1").src = imgSrc;
		}
	}
	else if(thisFile.toString().substring(0,4)=="tt_c")
	{
		if(document.getElementById("floorplan2"))
		{
			document.getElementById("floorplan1").style.display = "none";
			document.getElementById("floorplan2").style.display = "block";
			document.getElementById("floorplan2").src = imgSrc;
		}
	}
	else
	{
		if(document.getElementById("floorplan"))
			document.getElementById("floorplan").src = imgSrc;
	}
	
	//var d = new Date();
	//document._2.autopan = window.setInterval('{try{var d = new Date();document._2.SetPanAngle(document._2.GetPanAngle()+(d.getTime()-document._2.autotime)/-100);document._2.autotime=d.getTime()}catch(ex){window.clearInterval(document._2.autopan)}}',25);
	//document._2.SetPanAngle(10);
	//document._2.SetPanAngle(360);
	//alert(document._2.GetPanAngle());
	setTimeout("displayVT()",2000);
}

function setAutoPan()
{
	try
	{
		document._2.SetPanAngle(document._2.GetPanAngle() + panValue);
		
		if(document._2.GetPanAngle() <= 0 || document._2.GetPanAngle() >= 360)
			panValue = panValue * -1;
	}
	catch(ex)
	{
		panValue = panValue * -1;
		//window.clearInterval(autopan);
	};
}

function displayVT()
{
	document.getElementById("qt_mov").style.visibility = "visible";
	panValue = initPan;
	clearInterval(autopan);
	autopan = window.setInterval("setAutoPan()",25);
}


// -->
