
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}



function onabove(Id, text, number, oEvent){
	var divTag = document.getElementById(Id);
	if(!divTag){
		var scrollleft = f_scrollLeft();
		var scrolltop = f_scrollTop();
		if(oEvent.type == "mouseover"){ // get coordinates
			var mx = oEvent.clientX + 5 + scrollleft;
			var my = oEvent.clientY + 5 + scrolltop;
		}
		
		//alert(scrollleft+"-"+scrolltop);
		var shadowBorder = 8;
		var divTagSh = document.createElement("div");
		divTagSh.id = Id+"sh";
		divTagSh.style.width = "180px";
		divTagSh.style.height = "70px";
		divTagSh.style.position = "absolute";
		var mys = my + shadowBorder;
		var mxs = mx + shadowBorder;
		divTagSh.style.top = mys+"px";
		divTagSh.style.left = mxs+"px";
		divTagSh.style.backgroundColor = "#777777";
		divTagSh.style.filter = 'alpha(opacity='+40+')';  // object.style.filter = 'alpha(opacity='+number+')';

		divTagSh.style.opacity = 0.4;
		document.body.appendChild(divTagSh);

		var divTag = document.createElement("div");
		divTag.id = Id;
		divTag.style.width = "180px";
		divTag.style.height = "70px";
		divTag.style.position = "absolute";
		divTag.style.borderStyle = 'solid';
		divTag.style.borderWidth = '1px';
		divTag.style.top = my+"px";
		divTag.style.left = mx+"px";
		divTag.style.font= '13px arial';
		divTag.style.color = 'black';
		if(number < 5){
			divTag.style.backgroundColor = "#b50404";
			divTag.style.color = 'white';
		}
		else if(number < 10){
			divTag.style.backgroundColor = "#e83c11";
			divTag.style.color = 'white';
		}
		else if(number < 50){
			divTag.style.backgroundColor = "#ea820f";
			
		}
		else {
			divTag.style.backgroundColor = "#fceb0d";
			
		}
		divTag.style.borderColor = 'black';
		divTag.innerHTML = text;
		document.body.appendChild(divTag);
	}
}

function onout(Id) {
	var Ids = Id+"sh";
	var divTag = document.getElementById(Id);
	var divTagSh = document.getElementById(Ids);
	if(divTag){
		document.body.removeChild(divTagSh);
		document.body.removeChild(divTag);
	}
	
}

function gotoBuyABrique(path){
	location.href=path;
}
