function rsDirectory() {
}

rsDirectory.prototype.popup = function(target, directoryPage) {
	
	if (!directoryPage)
		window.open('/directory_'+target+'.html','','status=yes,resizable=yes,scrollbars=yes');	
		
	else
		window.open(directoryPage,'','status=yes,resizable=yes,scrollbars=yes');	
		

}

function directoryChangeColor(row) {
	
	var overColor = '#1e90ff';
		
	currentColor = row.style.backgroundColor.toString();
	
	if (currentColor.toLowerCase() != overColor) {
		
		row.oldColor = row.style.backgroundColor.toString();
		row.style.backgroundColor = overColor;
		
	} else
		row.style.backgroundColor = row.oldColor;
	
}

function directoryReturnValue(valueId, viewValue, target, updateFunc, returnField) {
		
	srcElement = eventElement(window.event)
	if (srcElement.tagName=='IMG') return false;
	
	eval('window.opener.document.all.'+target+'.value = valueId;');

	if (returnField!='') {
		
		eval('window.opener.document.all.'+returnField+'.value = viewValue;');
		
	} else {
		
		eval('window.opener.document.all.'+target+'_viewState'+'.value = viewValue;');
		
	}
	
	
	
	if (updateFunc!='') 
		eval('opener.'+updateFunc+'();');
	
	window.opener.focus();	
	window.close();
		
}
