function hov(loc,cls){if(loc.className)loc.className=cls}function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features)}function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc}function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i]}}}function MM_preloadImages2(){var d=document;if(d.images){if(!d.MM_p2)d.MM_p2=new Array();var i,j=d.MM_p2.length,a=MM_preloadImages2.arguments;for(i=0;i<a.length;i++)if(a[i].indexOf("#")!=0){d.MM_p2[j]=new Image;d.MM_p2[j++].src=a[i]}}}function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p)}if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x}function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2]}}function HiLite_On(id){d=document;re=d.all?d.all[id]:getElementById(id);re.style.borderLeft="#9999b9 3px solid";re.style.borderRight="#7777a7 3px solid";re.style.borderTop="#9999b9 3px solid";re.style.borderBottom="#7777a7 3px solid"}function HiLite_Off(id){d=document;re=d.all?d.all[id]:getElementById(id);re.style.borderLeft="#888888 3px solid";re.style.borderRight="#666666 3px solid";re.style.borderTop="#888888 3px solid";re.style.borderBottom="#666666 3px solid"}function LoadMoreImages(){}function load(){loadData("./favs.htm");}function GUnload(){}function setOpacity(value){document.getElementById("styled_popup").style.opacity=value/10;document.getElementById("styled_popup").style.filter='alpha(opacity='+value*10+')'}function fadeInMyPopup(){for(var i=0;i<=100;i++)setTimeout('setOpacity('+(i/10)+')',8*i)}function fadeOutMyPopup(){for(var i=0;i<=100;i++){setTimeout('setOpacity('+(10-i/10)+')',8*i)}setTimeout('closeMyPopup()',800)}function closeMyPopup(){document.getElementById("styled_popup").style.display="none"}function fireMyPopup(){setOpacity(0);document.getElementById("styled_popup").style.display="block";fadeInMyPopup()}function open_window(url){cwin=window.open(url,"attach","width=350,height=400,toolbar=no,resizable=yes")}function bookmarksite(title,url){if(window.sidebar)window.sidebar.addPanel(title,url,"");else if(window.opera&&window.print){var elem=document.createElement('a');elem.setAttribute('href',url);elem.setAttribute('title',title);elem.setAttribute('rel','sidebar');elem.click()}else if(document.all)window.external.AddFavorite(url,title)}

function loadData(URL)
{
// Create the XML request 
    xmlReq = null;
    if(window.XMLHttpRequest) xmlReq = new XMLHttpRequest();
    else if(window.ActiveXObject) xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
    if(xmlReq==null) return; // Failed to create the request

// Anonymous function to handle changed request states
    xmlReq.onreadystatechange = function()
    {

        switch(xmlReq.readyState)
        {
        case 0: // Uninitialized
            break;
        case 1: // Loading
            break;
        case 2: // Loaded
            break;
        case 3: // Interactive
            break;
        case 4: // Done!
        // Retrieve the data between the <quote> tags
        
        var nodes=xmlReq.responseXML.getElementsByTagName("fav");
        
        var _strFavs="";
                
        // make it comma separated
        for (i=0; i<nodes.length; i++)
 		{	 			
 			_strFavs += nodes.item(i).firstChild.data; 			
 			
 			if (i < (nodes.length - 1))
 			{
 				_strFavs += ",";
 			} 			
		}
        
		doSomethingWithData(_strFavs);
		
        // doSomethingWithData(xmlReq.responseXML.getElementsByTagName('fav')[0].firstChild.data);
            break;
        default:
            break;
        }
    }

// Make the request
    xmlReq.open ('GET', URL, true);
    xmlReq.send (null);
}


// Function to call with the data retrieved from the XML file 
function doSomethingWithData(strFavs)
{	
	var strOutFavs="";
	
	if (strFavs.length > 1)
	{
		var arrFavs = strFavs.split(",");			
		
	    for (i=0; i<arrFavs.length; i++)
		{	
			var arrFavComp = arrFavs[i].split("-");		
			
			strOutFavs += "&nbsp;<a href=\"http://www.boston-condo.com/MDetails2.htm?type=CC&mID=";
			strOutFavs += arrFavComp[0]; 			
			strOutFavs += "\">";
			strOutFavs += arrFavComp[1];
			strOutFavs += "-$";
			strOutFavs += arrFavComp[2];
			strOutFavs += "</a>&nbsp;<br>";
		}
	}
	
	var eFavs = document.getElementById('favs');

	if (eFavs)
	{
    	eFavs.innerHTML = strOutFavs;
    }
}


function submitForm()
{
	var f = document.forms[0];
	
	// var arrEmail = f.sender.value.split("@");
	
	if (f.name.value == "") 
	{
		alert("Please enter your name.");
		f.name.focus();
		return(false);
	}
	else if (f.sender.value == "")
	{
		alert("Please enter your email so that we can respond.");
		f.sender.focus();
		return(false);
	}
	else if (f.message.value == "")
	{
		alert("Please enter your message.");
		f.message.focus();
		return(false);
	}
}
