/*<#SETCONTENTTYPE NAME="text/javascript" condition="params.setcontenttype != false"><#SETCUSTOMHEADER NAME="Cache-Control" VALUE="max-age=3600">*/
function embedFP(file, div, w, h) {
  if (!w) 
	w = '550';
  if (!h)
	h = '400';
  var str = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="' + w + '" HEIGHT="' + h + '" id="flashFloorplan" onmousewheel="zoomFlash(window.event.wheelDelta);return false;">';
  str += '<PARAM NAME="movie" VALUE="' + file + '">';
  str += '<PARAM NAME="quality" VALUE="high">';
  str += '<PARAM NAME="bgcolor" VALUE="#FFFFFF">';
  str += '<param name="wmode" value="transparent">';
  str += '<param name="loop" value="false">';
  str += '<param name="play" value="false">';
  str += '<EMBED wmode="transparent" src="' + file + '" quality="high" bgcolor="#FFFFFF" WIDTH="' + w + '" HEIGHT="' + h + '" NAME="flashFloorplan" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" loop="false" play="false"></EMBED></OBJECT>';
  if (div) {	
	document.getElementById(div).innerHTML = str;
  } else
	document.write(str);
}

function embedVideo(file, div, w, h) {
  if (!w) 
	w = '300';
  if (!h)
	h = '223';
  var str = '<object id="propertyvideo" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" wmode="transparent" data="/media/video/flvplayer.swf?file=' + file + '&autoStart=false">';
  str += '<param name="movie" value="/media/video/flvplayer.swf?file=' + file + '&autoStart=true" />';
  str += '<param name="wmode" value="transparent" />';
  str += '<EMBED wmode="transparent" src="/media/video/flvplayer.swf?file=' + file + '&autoStart=true" quality="high" bgcolor="#FFFFFF" WIDTH="'+w+'" HEIGHT="'+h+'" NAME="flashFloorplan" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
  if (div) {	
	document.getElementById(div).innerHTML = str;
  } else
	document.write(str);
}

function getFlashMovieObject(movieName) {
  if (window.document[movieName]) 
    return window.document[movieName];
  if (navigator.appName.indexOf("Microsoft Internet")==-1) {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else
    return document.getElementById(movieName);
}
function zoomFlash(dir) {
  var flashMovie=getFlashMovieObject("flashFloorplan");
  zL = (dir>0)?75:134;
  flashMovie.Zoom(zL);
}
function doZoom(dir) {
  if (inZoom) {
    zoomFlash(dir);
    t = window.setTimeout('doZoom(' + dir + ')', 200);
  }
}
var inZoom = false;
function zoom(dir) {
  inZoom = true;
  doZoom(dir);
}
function doPan(x, y) {
  if (inPan) {
    var flashMovie=getFlashMovieObject("flashFloorplan");
    flashMovie.Pan(x, y, 1);
    t = window.setTimeout('doPan(' + x + ', ' + y + ')', 200);
  }
}
var inPan = false;
var t = null;
function pan(x, y) {
  inPan = true;
  doPan(x, y);
}
function swapImg(img, state) {
	document.getElementById(img).style.display = state;
}
