function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}


function prepareInputsForHints() {
	if (document.getElementById('mylink')){
		document.getElementById('mylink').onmouseover=function(){
			stausDiv= "show"; 
		}
		document.getElementById('mylink').onmouseout=function(){
			stausDiv= "hide";
		}
		document.getElementById('mylink').onclick=function(){	
			document.getElementById('hint1').style.display = "none";
		}
	}
	
	if(document.getElementById("joinformWrapper")){
		var inputs = document.getElementById("joinformWrapper").getElementsByTagName("input");	
		
		for (var i=0; i<inputs.length; i++){
			
			if (inputs[i].type != "checkbox") {
			
				inputs[i].onfocus = function () {
				  this.parentNode.getElementsByTagName("div")[0].style.display = "inline";
				}
				inputs[i].onblur = function () {
					if(stausDiv== "hide")
					{
						this.parentNode.getElementsByTagName("div")[0].style.display = "none";
					} 
					else
					{
						stausDiv= "hide"
					}   
				}
			
			}
			
		}
	}
	
	if (document.getElementById("enquiryCategory")){
		document.getElementById("enquiryCategory").onfocus = function(){
			document.getElementById("selectHint").style.display ="inline";
		}
		document.getElementById("enquiryCategory").onblur = function () {
		 	document.getElementById("selectHint").style.display = "none";
		}
	}
	
	if(document.getElementById('earnContent')){
		var tiplist = document.getElementById('earnContent').getElementsByTagName("li");		
		
		for(var i=0; i<tiplist.length; i++){
			  tiplist[i].onmouseover = function () {
				  this.getElementsByTagName("div")[0].style.display = "block";
			  }
			  tiplist[i].onmouseout = function () {				  	
				  this.getElementsByTagName("div")[0].style.display = "none";
			}
		}
	}
	
	if(document.getElementById('redeemContent')){
		var tiplist = document.getElementById('redeemContent').getElementsByTagName("li");		
		
		for(var i=0; i<tiplist.length; i++){
			  tiplist[i].onmouseover = function () {
				  this.getElementsByTagName("div")[0].style.display = "block";
			  }
			  tiplist[i].onmouseout = function () {				  	
				  this.getElementsByTagName("div")[0].style.display = "none";
			}
		}
	}
}
addLoadEvent(prepareInputsForHints);
var stausDiv= "hide";