// No More IE6 Background Flicker - http://www.hedgerwow.com/360/bugs/dom-fix-ie6-background-image-flicker.html
(function(){ /*Use Object Detection to detect IE6*/ var m = document.uniqueID /*IE*/ && document.compatMode /*>=IE6*/ && !window.XMLHttpRequest /*<=IE6*/ && document.execCommand ; try{ if(!!m){ m("BackgroundImageCache", false, true) /* = IE6 only */ } }catch(oh){}; })();
// Load Function on DOM.Contentload - crossbrowser
function onContent(f){//(C)webreflection.blogspot.com
var b=navigator.userAgent,d=document,w=window,
c="__onContent__",e="addEventListener",o="opera",r="readyState",
s="<scr".concat("ipt defer src='//:' on",r,"change='if(this.",r,"==\"complete\"){this.parentNode.removeChild(this);",c,"()}'></scr","ipt>");
w[c]=(function(o){return function(){w[c]=function(){};f(o?o():o)}})(w[c]);
if(d[e])d[e]("DOMContentLoaded",w[c],false);
if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))
(function(){/loaded|complete/.test(d[r])?w[c]():setTimeout(arguments.callee,1)})();
else if(/MSIE/i.test(b))d.write(s);
};
/*
addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html
*/
function addEvent( obj, type, fn )
{
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function removeEvent( obj, type, fn )
{
	if (obj.removeEventListener)
		obj.removeEventListener( type, fn, false );
	else if (obj.detachEvent)
	{
		obj.detachEvent( "on"+type, obj[type+fn] );
		obj[type+fn] = null;
		obj["e"+type+fn] = null;
	}
}

function prepareInputsForHints() {
//	if (typeof document.getAttributeNode == 'function') {
		var inputs = document.getElementById("c-content").getElementsByTagName("input");
		for (var i=0; i<inputs.length; i++){
			// test to see if the hint span exists first
			if (inputs[i].getAttribute("title") != "" && inputs[i].getAttributeNode("title") ) {
				// the span exists!  on focus, show the hint
				inputs[i].onfocus = function () {
					var objHint = document.createElement("span");
					objHint.className = 'hint';
//					objHint.setAttribute('class','hint');
					objHint.innerHTML = this.getAttribute("title");
					this.parentNode.style.zIndex = "10";
					this.parentNode.appendChild(objHint);
				}
				// when the cursor moves away from the field, hide the hint
				inputs[i].onblur = function () {
					var objHint = this.parentNode.lastChild;
					this.parentNode.style.zIndex = "1";
					if (objHint.nodeName == "SPAN") {
						this.parentNode.removeChild(objHint);
					}
				}
			}
		}
		// repeat the same tests as above for selects
		var selects = document.getElementById("c-content").getElementsByTagName("select");
		for (var k=0; k<selects.length; k++){
			if (selects[k].getAttribute("title") != "" && selects[k].getAttributeNode("title")) {
				selects[k].onfocus = function () {
					var objHint = document.createElement("span");
					objHint.className = 'hint';
//					objHint.setAttribute('class','hint');
					objHint.innerHTML = this.getAttribute("title");
					this.parentNode.style.zIndex = "10";
					this.parentNode.appendChild(objHint);
				}
				selects[k].onblur = function () {
					var objHint = this.parentNode.lastChild;
					this.parentNode.style.zIndex = "1";
					if (objHint.nodeName == "SPAN") {
						this.parentNode.removeChild(objHint);
					}
				}
			}
		}
//	}
}
addEvent(window,'load',prepareInputsForHints);