function GShowPopup() {
	var args = GShowPopup.arguments;
	var popWin;
	var url = args[0]; 
	var win = args[1];
	var width = (args[2]) ? args[2] : 630;
	var height = (args[3]) ? args[3] : 450;
	var winArgs;
	
	winArgs = 'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,status=no,help=no,center=yes'
//	alert(url + ':::' + window + ':::' + winArgs);
	popWin = window.open(url,win,winArgs);
}

function popup_email(email, subject, refer) {
		var sUrl = VirtualDirectory + '/MailForm.aspx?e=' + gStringReplace(email, '%', '\%') + '&s=' + escape(subject) + '&r=' + escape(refer);
		window.open(sUrl, 'Marcus', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=560,height=495').focus();
}

function gHTMLEncode(strSrc) {
	var temp = "" + strSrc;
	
	temp = gStringReplace(temp, '&', '&amp;')
	temp = gStringReplace(temp, '"', '&quot;')
	temp = gStringReplace(temp, '<', '&lt;')
	temp = gStringReplace(temp, '>', '&gt;')
	temp = gStringReplace(temp, ' ', '%20')
	temp = gStringReplace(temp, '#', '%23')
	return temp;
}

function gStringReplace(strSrc, strSearch, strReplace) {
	// replace strSearch with strReplace
	var strBegin, strEnd;
	var temp = "" + strSrc;
	var pos = -1

	while (temp.indexOf(strSearch, (pos + 1)) > -1) {
		pos = temp.indexOf(strSearch, (pos + 1));
		strBegin = temp.substring(0, pos)
		strEnd = temp.substring((pos + strSearch.length), temp.length)
		temp = "" + (strBegin + strReplace + strEnd);
	}

	return temp;
}

var imageName = '';
function LoadImages() {
	PropertySearch_on = new Image();
	PropertySearch_on.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/TopPropertySearch_on.gif";
	PropertySearch_off = new Image();
	PropertySearch_off.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/TopPropertySearch_off.gif";
	
	FindAgent_on = new Image();
	FindAgent_on.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/TopFindAgent_on.gif";
	FindAgent_off = new Image();
	FindAgent_off.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/TopFindAgent_off.gif";
	
	NavResidential_on = new Image();
	NavResidential_on.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavResidential_on.gif";
	NavResidential_off = new Image();
	NavResidential_off.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavResidential_off.gif";
	
	NavCommercial_on = new Image();
	NavCommercial_on.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavCommercial_on.gif";
	NavCommercial_off = new Image();
	NavCommercial_off.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavCommercial_off.gif";

	NavProperty_on = new Image();
	NavProperty_on.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavProperty_on.gif";
	NavProperty_off = new Image();
	NavProperty_off.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavProperty_off.gif";
	
	NavResources_on = new Image();
	NavResources_on.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavResources_on.gif";
	NavResources_off = new Image();
	NavResources_off.src = VirtualDirectory + "http://www.marcusrealty.com/images/headersfooters/NavResources_off.gif";
}
LoadImages();

function ColorOn(imageName) {
	document[imageName].src = eval(imageName + '_on.src');
}

function ColorOff(imageName) {
	document[imageName].src = eval(imageName + '_off.src');
}