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++){
			inputs[i].onfocus = function () {
			  if(this.parentNode.getElementsByTagName("div")[0])
			    this.parentNode.getElementsByTagName("div")[0].style.display = "inline";
			}
			inputs[i].onblur = function () {
				if(stausDiv== "hide")
				{
				    if(this.parentNode.getElementsByTagName("div")[0])
			            this.parentNode.getElementsByTagName("div")[0].style.display = "none";
				} 
				else
				{
					stausDiv= "hide"
				}   
			}
		}
	}
	
	if (document.getElementById("contactWrapper")){
		var inputs2 = document.getElementById("contactWrapper").getElementsByTagName("input");
		
		
		for (var i=0; i<inputs2.length; i++){
			if (inputs2[i].type == "text"){			
				inputs2[i].onfocus = function () {
				  this.parentNode.getElementsByTagName("div")[0].style.display = "inline";
				}
				inputs2[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";
			}
		}
	}
	
	
}
addLoadEvent(prepareInputsForHints);
var stausDiv= "hide";