            
            function toTitleCase(str) {
                return str.substr(0,1).toUpperCase() + str.substr(1);
            }      
            
            function formatTitle(title) {
                return 'Lorraine Lax' + (title != '/' ? ' | ' + toTitleCase(title.substr(1, title.length - 2).replace(/\//g, ' | ').replace(/-/g, ' ')) : '');
            }
             
            function getTransport() {
                if (window.XMLHttpRequest) {
                    return new XMLHttpRequest();
                } else if (window.ActiveXObject) {
                    try {
                        return new ActiveXObject('Msxml2.XMLHTTP');
                    } catch(e) {
                        return new ActiveXObject('Microsoft.XMLHTTP');
                    }
                }
            }

            function updateContent(html) {
                var content = document.getElementById('content');
                if (com.asual.util.Browser.isIE()) {
                    var _content = document.getElementById('_content');
                    if (_content == null) {
                        var _content = content.cloneNode(false);
                        _content.id = '_content';
                        //_content.style.position = 'absolute';
                        //_content.style.top = content.offsetTop;
                        //_content.style.left = '50%';
                        //_content.style.width = content.offsetWidth;
                        //_content.style.marginLeft = -content.offsetWidth/2;
                        //document.body.appendChild(_content);
                    	document.getElementById('frame').insertBefore(_content, document.getElementById('footer')); //NMS
                    }
                    _content.innerHTML = html;
                    //content.style.height = _content.offsetHeight;
					//content.style.height = 0; //NMS
					content.innerHTML = "";
                } else {
                    content.innerHTML = html;
                }
                while (html.match(/(<script[^>]+javascript[^>]+>\s*(\/\/*<!\[CDATA\[)?(<!--)?\s*)/i)) {
                    html = html.substr(html.indexOf(RegExp.$1) + RegExp.$1.length);
                    if (!html.match(/((\/\/ *\]\]>)?(-->)?\s*<\/script>)/)) break;
                    block = html.substr(0, html.indexOf(RegExp.$1));
                    html = html.substring(block.length + RegExp.$1.length);
                    eval(block);
                }
            }
            
            function updateChange(xhr) {
                if (xhr.readyState == 4) {
                    if (xhr.status == 200) {
						//HACK: for some reason I'm getting 200 even when the file doesn't exist - maybe b/c of mod_rewrite - hack it for now,
						//check responseText against what I'm looking for (i.e. NOT the entire site... should begin with <div not <script (or whatever is first))
						if (!xhr.responseText.match("<meta")) {
                        	updateContent(xhr.responseText);
						}
						else {
							updateContent('<div id="subhead"><img src="/lorrainelax-artist.gif" alt="Lorraine Lax - Fine Artist"/></div><div id="gallerycontent"><p>&nbsp;</p><h2>404: File Not Found</h2><p>&nbsp;</p><p>Sorry for the detour - you have tried to visit a page that does not exist. If you think you are seeing this page in error, why don\'t you <a href="mailto:lorrainelax@cfl.rr.com">email Lorraine</a> and tell her about it? Thanks for visiting Lorraine Lax\'s fine art website.</p></div>');
						}
                    } else {
                        alert('Error: ' + xhr.status + '!');
                    }
                }
            }
            
            function handleChange(event) {
				//alert('xml_loaded = ' + xml_loaded);
				if (xml_loaded == 0 || (event.value != '/' && event.value != 'home')) { //NMS hack
					xmlNotLoaded();
					var xhr = getTransport();
					xhr.onreadystatechange = function() {
						updateChange(xhr);
					}
					var xmlfilename = 'datasource/' + (event.value == '/' ? 'home' : event.value.replace(/\//g, '')) + '.xml';
					//regular datasource lookup for non- static gallery pages
					//if (event.value.indexOf('gallery') == -1)
                		xhr.open('get', xmlfilename, true);
					//XSLT lookup for static gallery pages
/*					else {
						var xslStylesheet;
						var xsltProcessor = new XSLTProcessor();
						//load the xml file
						var xmlSource = getResponseXml(xmlUrl).responseXML;
						//load the xsl file into the xslt Processor
						xslStylesheet = getResponseXml(xslUrl).responseXML;
						xsltProcessor.importStylesheet(xslStylesheet);
						return xsltProcessor.transformToFragment(xmlSource, document);
					}*/
					xhr.send('');
					SWFAddress.setTitle(formatTitle(event.value));
				}
            }
            
            SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleChange);
            
