function hint(title, text, e, scrolling, leftside, offset, hinttype,yoffset) {
	if(hinttype && hinttype == 'latedeals'){
		var elementID = 'hintboxlatedeals'
	} else {
		var elementID = 'hintbox'
	}
	var hb = document.getElementById(elementID);
	if (!hb || hb.style.display == "none") {
		showHint(title, text, e, scrolling, leftside, offset, elementID,yoffset);
	} else {
		hideHint();
	}
}


function showHint(title, text, e, scrolling, leftside, offset, elementID,yoffset) {
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	// posx and posy contain the mouse position relative to the document
	
  var windowx = 0, windowy = 0;
  if( typeof( window.innerWidth ) == 'number' ) {	// Moz
    windowx = window.innerWidth;
    windowy = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {	// IE
    windowx = document.documentElement.clientWidth;
    windowy = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { // Other
		windowx = document.body.clientWidth;
    windowy = document.body.clientHeight;
  }

	// If end of window, push left
	if ((posx + 270) > windowx) posx = windowx - 300;
	// If left side of cursor has been specified (ie to not get in the way of select box), push left
	if (leftside == true)	posx = posx - 270;
	// If there's an offset add it
	posx = posx + offset;
	posy = posy + yoffset;
	var hb = document.getElementById(elementID);
	if (!hb) var hb=document.createElement("div");	// create it first time
	
	var oldhb = document.getElementById('helphint');
	if (oldhb) oldhb.style.display = "none";	// remove old style	
	
	hb.setAttribute("id", elementID);
	hb.style.left = posx + 10 + "px";
	hb.style.top = posy + 10 + "px";
	hb.style.display = "block";
	hb.innerHTML = "";
	document.body.appendChild(hb);
		
	var hbtitle = document.createElement("div");
	hbtitle.className = "title";
	hbtitle.appendChild(document.createTextNode(title));
	hb.appendChild(hbtitle);

	var hbx = document.createElement("div");
	hbx.className = "x"	
	var hba = document.createElement("a");	
	hba.href = "javascript:hideHint(\'" + elementID + "\')";
	hba.appendChild(document.createTextNode("X"));
	hbx.appendChild(hba);
	hbtitle.appendChild(hbx);

	var hbp = document.createElement("div");
	hbp.className = "p"
	hbp.innerHTML = text;

	
	if (scrolling > 0) {
		hbp.style.height = scrolling + "px";
		hbp.style.overflow = "auto";	
		hbp.style.clear = "both";
	}
	hb.appendChild(hbp);
	

	
	var hbclose = document.createElement("div");
	hbclose.style.border = "1px solid #0275AB";
	hbclose.style.borderTop = "none";
	hbclose.style.textAlign = "right";
	hbclose.style.padding = "3px";
	var hba = document.createElement("a");	
	hba.href = "javascript:hideHint(\'" + elementID + "')";
	hba.appendChild(document.createTextNode("Close"));
	hbclose.appendChild(hba);

	hb.appendChild(hbclose);

}

function hideHint(elementID) {
	var hb = document.getElementById(elementID);
	if (hb) hb.style.display = 'none';
}
