function qsgo(MLS, Brand)
{
    //var Brand = NRT.Utility.getElementByTagNameAndID('abrand', 'hidden');
    if (Brand !== null)
    {
        if(MLS !== null)
        {
            sMlsNumber = MLS.value
            idx = sMlsNumber.search(/MLS\/Ad#/);
            if (idx == 0)
            {
                _oUtility.showMessage('Invalid MLS Number, please enter a MLS number without MLS#.');
                return;
            }                    
            else if (sMlsNumber === 'MLS/Ad#' || sMlsNumber === '')
            {
                _oUtility.showMessage(NRT.Property.Validation.MESSAGE_MLS_MLS_EMPTY);
                return;
            }    
            else
            {
                var str = '/property/propertyresults.aspx?CallingPage=2&abrand=' + Brand.value + '&qstext=' + MLS.value;
                document.location = str;            
            }
        }    
    }
}

function SetAgent(agentID, firstName, lastName)
{
	getObjectByID('agentName').innerHTML = firstName + ' ' + lastName;
	getObjectByID('TextBoxAgentID').value = agentID;
	
	if (isLoggedIntoMySite)
	{
	    NRT.MySite.UI.setAgentInfo(agentID, firstName + ' ' + lastName);
	}
	
}

	
function getObjectByID(id)
{
   if (document.getElementById) { // DOM-compliant browsers (MSIE5, NSN6, O5)
       return document.getElementById(id);
   } else if (document.all) { // MSIE4
       return document.all[id];
   } else if (document.layers) { // NSN4
       return document.layers[id];
   } else { // Trap DHTML-impaired browsers 
       //alert("Your browser does not support DHTML!");
       return false;
   }
}

function fnNewWindow( MyURL, MyProperties, MyWidth, MyHeight )
{
	var newWindow;
	var strProperties = "";
	var strProp = new String();
	
	strProp = MyProperties;
	strProp = strProp.replace(' ', '');


	if (strProp.length == 0)
	{
		if (MyWidth != "")
		{
			if (MyWidth==100)
			{
				MyWidth=750;	
			}

			//Contact form needs to be scrollable and resizable, per Steph. csv 9/14/2003
			if (MyURL.indexOf("/aboutus/contactus.aspx") != -1 || MyURL.indexOf("eventsigninform.aspx") != -1)
			{
				strProperties = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=' + MyWidth;
			}else{
				strProperties = 'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=' + MyWidth;
			}
		}else{
			//Contact form needs to be scrollable and resizable, per Steph. csv 9/14/2003
			if (MyURL.indexOf("/aboutus/contactus.aspx") != -1 || MyURL.indexOf("eventsigninform.aspx") != -1)
			{
				strProperties = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=500';
			}else{
				strProperties = 'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=500';
			}
		}

		if (MyHeight != "")
		{
			if (MyHeight=='100')
			{
				MyHeight=580;
			}

			strProperties += ',height=' + MyHeight;
		}else{
			strProperties += ',height=500';
		}

	
	}else{

		//	strProperties = 'status=yes,scrollBars=yes,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=600,height=600';	
		//  last minute fix... always force contactus to a certain size		
		if (MyURL.indexOf("/aboutus/contactus.aspx") != -1)
		{
			strProperties = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=750,height=580';
		}else{
			strProperties = strProp;
		
			if ( (MyHeight != "") && (strProperties.indexOf("height") == -1 ) )
			{
				strProperties += ',height=' + MyHeight;
			}else{
				if ( (MyHeight == "") && (strProperties.indexOf("height") == -1 ) )
				{
					strProperties += ',height=500';
				}else{
					//nothing needed
				}
			}


			if ( (MyWidth != "") && (strProperties.indexOf("width") == -1 ) )
			{
				strProperties += ',width=' + MyWidth;
			}else{
				if( (MyWidth == "") && (strProperties.indexOf("width") == -1 ) )
				{
					strProperties += ',width=500';
				}else{
					//nothing needed
				}	
			}
		
		}
	}

	// 10/9/03 Danny Tso
	//  added "ALL" option to open a full browser window without any restriction
	//   attached per Stephanie Zais for Link to Mortgage in Agent Profile page
	if (strProperties == "ALL")
	{
		newWindow = window.open(MyURL, "");
	}else{
		newWindow = window.open(MyURL, "", strProperties);
	}
}