var glowShade = '#e3e3e3';

function glowRow(rowNum){
	document.getElementById('row' + rowNum).style.backgroundColor = glowShade;
}

function unGlowRow(rowNum){
	document.getElementById('row' + rowNum).style.backgroundColor = '';
}

function glowGrid(rowNum){
	document.getElementById('spot' + rowNum).style.backgroundColor = glowShade;
}

function unGlowGrid(rowNum){
	document.getElementById('spot' + rowNum).style.backgroundColor = '';
}

function morePhotos(realty_id){
	window.open('PhotosServlet?realty_id=' + realty_id,'morePhotos','scrollbars=1,menubar=0,location=no,toolbar=0,status=0,resizable=0,width=694,height=490');
}

function openPrint(realty_id){
	window.open('RealtyListServlet?action=printdetails&realty_id=' + realty_id,'openPrint','scrollbars=1,menubar=0,location=no,toolbar=0,status=0,resizable=0,width=720,height=700');
}


function glowImg(imgId){
	document.getElementById(imgId).src = 'img/' + imgId + '-1.gif';
}

function redoImg(imgId){
	document.getElementById(imgId).src = 'img/' + imgId + '-0.gif';
}
function getStr(strX){
	var vEnd;
	var rExp1 = /&quot;/gi;
	var rExp2 = /&apos;/gi;
	var rExp3 = /&amp;/gi;

	var qStr = self.location.search;
	var dStart = qStr.indexOf(strX);
	var vStart = dStart + strX.length + 1;
	var dNext   = qStr.indexOf('&',vStart);
	var oMark   = qStr.indexOf('#',vStart);
	if (dNext != -1){vEnd = (dNext-dStart)+1;}
	if (dNext == -1 && oMark != -1){vEnd = (oMark-dStart)+1;}
	if (vEnd && strX != 'pr'){vEnd = vEnd;} else {vEnd = qStr.length;}
	if (dStart != -1){
		soughtVar = qStr.substring(vStart,vEnd);
		//window.alert(strX + ' = ' + soughtVar);
		soughtVar = soughtVar.replace(rExp1,'\"');
		soughtVar = soughtVar.replace(rExp2,'\'');
		soughtVar = soughtVar.replace(rExp3,'&');
		return unescape(soughtVar);
	} else {
		return '';
	}
}
