
sfFocus = function() {
	var sfEls = document.getElementsByTagName("A");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" sffocus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" sffocus\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfFocus);

sfHover = function() {
	var sfEls = document.getElementsByTagName("tr");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	if (document.getElementById('reporting_section')) {
		divs = document.getElementById('reporting_section').getElementsByTagName('div');
		for (var i=0; i<divs.length; i++) {
			if (divs[i].className=='tooltip') {
				divs[i].parentNode.onmouseover=function() {
					this.lastChild.firstChild.className+=" sfhover";
				}
				divs[i].parentNode.onmouseout=function() {
					this.lastChild.firstChild.className="";
				}
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function bgrCache() {
	try {
	  document.execCommand('BackgroundImageCache', false, true);
	} catch(e) {}
}
if (window.attachEvent) window.attachEvent('onload', bgrCache);

// check if <q> tag is handled, and fix it
function checkQ() {
	quotesElements = document.getElementsByTagName('q');
	if (quotesElements.length > 0) {
		q=quotesElements[0];
		if (q.currentStyle) s = q.currentStyle;
		supportsQuotes = false;
		for (prop in s) {
			if (prop.toLowerCase() == 'quotes') {
				supportsQuotes = true;
				break;
			}
		}
		if (supportsQuotes) {
//			alert('Supports quotes declaration');
		} else {
//			alert('Does not support quotes declaration');
			fixQ();
		}
	}
}
function fixQ() {
	quotesElements = document.getElementsByTagName('q');
	for  (var i=0; i<quotesElements.length; i++) {
		alert(i);
		quotesElements[i].innerHTML = '&#8220;' + quotesElements[i].innerHTML + '&#8221;';
	}
}
if (window.attachEvent) window.attachEvent('onload', checkQ);
