// /js/isol/isol.flash.6.js// global functions

function $() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);
    if (arguments.length == 1) return element;
    elements.push(element);
  }
  return elements;
}

// ISOL Javascript Loader

var isol = {

	site: {

		root: '/',

		admin_root: function() {
			return this.root+'zAz/'
		},

		editkey: 'dskgjw43tjsejLv43dsmv4mf0wmw346346'
	},	

	// append script to html head, now or onload
	loadScript: function(url,delayed) {

		var delayed = delayed || false;

		if (delayed) {
			this.addEvent('load',
				function () {
					isol.loadScript(url);
				}
			);
		} else {
			var script = document.createElement("script");  
			script.src = url;
			script.type = "text/javascript";
			document.getElementsByTagName('head')[0].appendChild(script);
		}		
	},

	// load known isol module, now or onload
	loadModule: function(module,delayed) {

		var delayed = delayed || false;

		if (typeof this[module] == 'undefined')	{
			this[module] = {};
		}
		if (typeof this[module].loaded == 'undefined') {
			this[module].loaded = true;
			this.loadScript(this.site.root+'js/isol/isol.'+module+'.js',delayed);
		}			
	},

	// add event function to element
	addEvent: function(evt,fn,elm) {

		elm = $(elm) || window;

        if (elm.addEventListener) {
                elm.addEventListener(evt, fn, false);
		} else if (elm.attachEvent) {
		    elm.attachEvent('on' + evt,
				function() {
					return fn.call(elm,window.event);
				}
			);
		}
	},

	windows: {}
};

// windows object

// open windows with opener and focus
isol.windows.open = function(url,windowname,settings) {

	popupWin = window.open(url,windowname,settings);
	if (!popupWin.opener) {
		popupWin.opener=self;
		popupWin.focus();
	}
}

if (typeof isol['flash'] == 'undefined')	{
	isol['flash'] = {};
}
isol['flash'].loaded = true;
isol.flash = function(navigator, flash_file, flash_height, flash_width, bg_color, no_flash) {

	var FlashCanPlay = true;

	var contentVersion = 6;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
			if (isNaN(parseInt(words[i]))) continue;
			var PluginVersion = words[i]; 
			}
		var FlashCanPlay = PluginVersion >= contentVersion;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
	   && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + "IPT LANGUAGE=VBScript\>\n"); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next\n');
		document.write('FlashCanPlay = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & contentVersion)))\n');
		document.write('</SCR' + 'IPT>\n');	
	}
	
	if ( FlashCanPlay ) {
		document.write("<div class=\"flash\"><OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=\"" + flash_width + "\" HEIGHT=\"" + flash_height + "\" id=\"ISOL_Flash\" ALIGN=\"\">\n<PARAM NAME=movie VALUE=\"" + flash_file + "\" />\n<PARAM NAME=menu VALUE=false>\n<PARAM NAME=quality VALUE=\"high\" />\n<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n<PARAM NAME=bgcolor VALUE=\"" + bg_color + "\" />\n<EMBED src=\"" + flash_file + "\" menu=false quality=high bgcolor=\"" + bg_color + "\" WIDTH=\"" + flash_width + "\" HEIGHT=\"" + flash_height + "\" NAME=\"ISOL_Flash\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\" />\n</OBJECT></div>");	
	} else {
		document.write(no_flash);
	}
};// WLTN property search

// apartments is checked
function checkApts() {
	if (document.psearch.elements['s_category[5]'].checked) {
		document.psearch.elements['s_category[15]'].checked = false;
		document.psearch.elements['s_category[8]'].checked = false;
		document.psearch.elements['s_category[6]'].checked = false;
		document.psearch.elements['s_category[16]'].checked = false;
		document.psearch.elements['s_category[9]'].checked = false;
		document.psearch.s_avail[0].checked = true;
		document.all('slabel').innerText='Bedrms';
	} else {
		document.all('slabel').innerText='Sq.Ft.';
	}			
}
// land is checked
function checkLand() {
	if (document.psearch.elements['s_category[9]'].checked) {
		document.psearch.elements['s_category[15]'].checked = false;
		document.psearch.elements['s_category[8]'].checked = false;
		document.psearch.elements['s_category[6]'].checked = false;
		document.psearch.elements['s_category[16]'].checked = false;
		document.psearch.elements['s_category[5]'].checked = false;
		document.all('slabel').innerText='Acres';
	}	else {
		document.all('slabel').innerText='Sq.Ft.';
	}		
}
// other is checked
function checkOther(thisCheckbox) {
	if (thisCheckbox.checked) {
		document.psearch.elements['s_category[5]'].checked = false;
		document.psearch.elements['s_category[9]'].checked = false;
		document.all('slabel').innerText='Sq.Ft.';
	}			
}

// WLTN custom flash code

// sned mouseover action to flash site plan
function space_hover(spaceid,tr) {
	window.document.ISOL_Flash.SetVariable('/ext_hover.hover_id', spaceid); 
	window.document.ISOL_Flash.TCallFrame( '/ext_hover', 1);
	prev_color=tr.bgColor;
	tr.bgColor='#aaddaa';
}
// sned mouseout action to flash site plan
function space_dehover(spaceid,tr) {
	window.document.ISOL_Flash.SetVariable('/ext_dehover.hover_id', spaceid); 
	window.document.ISOL_Flash.TCallFrame( '/ext_dehover', 1);
	tr.bgColor=prev_color;
}