/*

  flash embed + scale 1.0rc4 :: [07.17.05]
  (c) 2005 jeff silvestris :: x-industries.com :: portions by macromedia
  free for use if copyright is intact.

  usage: [req]uired
  jsxwm(
    idName,           // the filename (without ".swf") of the movie (used as id)    [req]
    defaultWidth,     // the [starting] width of the flash movie                    [req]
    defaultHeight,    // the [starting] height of the flash movie                   [req]
    path,             // the virtual path from the page to the flash movie          [req]
    flashVersion,     // the required flash version -- defaults to 6
    scale,            // boolean, turns vertical and horizontal scaling on and off
    query,            // additional variables in query form to be sent to the flash movie
    backgroundColor   // the background color in hex (ex. "ffffff")
  );

  using the same id as the flash movie, a <noscript> tag with "ns-" appended to the id
  is required before the script is called to provide alternate HTML content.

*/
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
var jsns = "http://www.w3.org/1999/xhtml"; var jsxfok = false; var jsxfcp = false;
function jsxwm(jsxf,jsxw,jsxh,jsxp,jsxfv,jsxscale,jsxq,jsxbgc) { if (!jsxfv) jsxfv=6; 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 jsxfpv = words[i]; } var jsxfok = jsxfpv >= jsxfv; } else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) { document.write('<scr'+'ipt language=VBScript\>\non error resume next\njsxfcp = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+jsxfv+')))\n</scr'+'ipt\>'); } if (jsxfok || jsxfcp) { document.write('<embed src="'+jsxp+jsxf+'.swf?jsxp='+jsxp+'&jsxscale='+jsxscale+'&jsxw='+jsxw+'&jsxf='+jsxf+"&"+jsxq+'" quality="high" bgcolor="#'+jsxbgc+'" width="'+jsxw+'" height="'+jsxh+'" name="'+jsxf+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" id="'+jsxf+'" scale="noscale" salign="lt" />'); } else { var jsxnsd = jsxce("div"); jsxnsd.innerHTML = jsxge("ns-"+jsxf).innerHTML; var jsxtd = jsxnsd.innerHTML.replace(/\&gt;/gi, ">"); document.write([jsxtd.replace(/\&lt;/gi, "<")].join("")); } }

function jsxce(jsxt) {
return (document.createElementNS) ? document.createElementNS(jsns, jsxt) : document.createElement(jsxt); };
function jsxss(jsxmw,jsxmh,jsxf) { jsxge(jsxf).setAttribute("height",jsxmh); jsxge(jsxf).setAttribute("width",jsxmw); }
function jsxge(jsxe,jsxn) { jsxn = jsxn ? 'document.'+jsxn+'.' : ''; return document.getElementById ? document.getElementById(jsxe) : document.all ? document.all[jsxe] : document.layers ? eval(jsxn+'document.'+jsxe) : false; }
function jsxow(l) { window.open(l, "ecrwindow", "width=700, height=500, menubar=no, resizable=no, status=yes, toolbar=no, scrollbars=yes, directories=no"); }
loadpage = function(){
	if(jsxge("sign_up")) jsxge("sign_up").href="javascript:jsxow('http://www.mlsplug-in.com/mlsplugin/signup.asp?Office=60')";
		if(jsxge("alert")) jsxge("alert").href="javascript:jsxow('http://www.mlsplug-in.com/mlsplugin/default.asp?Office=60')";
}

if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	document.writeln('<style type="text/css">img, input.image { visibility:hidden; } </style>');
	window.attachEvent("onload", fnLoadPngs);
}
function fnLoadPngs() {
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
		if (itsAllGood && img.src.match(/\.png$/i) != null) {
			fnFixPng(img);
			img.attachEvent("onpropertychange", fnPropertyChanged);
		}
		img.style.visibility = "visible";
	}
	var nl = document.getElementsByTagName("INPUT");
	for (var i = nl.length - 1, e = null; (e = nl[i]); i--) {
		if (e.className && e.className.match(/\bimage\b/i) != null) {
			if (e.src.match(/\.png$/i) != null) {
				fnFixPng(e);
				e.attachEvent("onpropertychange", fnPropertyChanged);
			}
			e.style.visibility = "visible";
		}
	}
}
function fnPropertyChanged() {
	if (window.event.propertyName == "src") {
		var el = window.event.srcElement;
		if (!el.src.match(/x\.gif$/i)) {
			el.filters.item(0).src = el.src;
			el.src = "x.gif";
		}
	}
}
function dbg(o) {
	var s = "";
	var i = 0;
	for (var p in o) {
		s += p + ": " + o[p] + "\n";
		if (++i % 10 == 0) {
			alert(s);
			s = "";
		}
	}
	alert(s);
}
function fnFixPng(img) {
	var src = img.src;
	img.style.width = img.width + "px";
	img.style.height = img.height + "px";
	img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
	img.src = "img/x.gif";
}

function showMap(which) {
	var mapDiv = jsxge('mapContainer');
	var newMap = jsxge(which);
	mapDiv.src = newMap.src;
}

function pop(link) {
	window.open(link,'popwindow','width=640,height=440,scrollbars=yes,resizable=yes');
}

function validateContactForm() {
	error="";
	if (jsxge("fullname").value == "") error += ("\nYour name.");
	if (jsxge("email").value == "" && jsxge("phone").value == "") error+=("\nEither a phone number or email address.");
	if(error != "") {
		alert("Before we can process your request we need the following information:\n"+error);
		return false;
	} else return true;
}
