function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {  // if window.onload has already happened
		window.onload = func;
	} else { // if it's our FIRST function (window not yet loaded)
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function prepareTitle() {
	//alert('development note 1');
	if (!document.getElementsByTagName) return false; // DOM compatability check
	//alert('development note 2');
	var spans = document.getElementsByTagName("a");
	for (var i=0; i<spans.length; i++) {
		
		if (spans[i].className == "ResultsCustomLink") {	
			tmp_text = spans[i].firstChild.nodeValue;
			if (tmp_text == "Virtual Tour"){
				spans[i].setAttribute("class", "ResultsCustomLink_vtour");
				spans[i].setAttribute("className", "ResultsCustomLink_vtour");
				//spans[i].className = "ResultsCustomLink_vtour";
			} else if (tmp_text == "VIRTUAL TOUR") {
				spans[i].setAttribute("class", "ResultsCustomLink_vtour");
				spans[i].setAttribute("className", "ResultsCustomLink_vtour");
			}
			//alert(tmp_text);
		}
	}
}

addLoadEvent(prepareTitle); // load func()