﻿//Yazan; Ufuk YAYLA: http://www.ufukyayla.com
//Teşekkürler; Ferruh MAVİTUNA: http://ferruh.matvituna.com
//Mavi turuncu tonlarda; toplansın dalgalar kumsalda.

var tip_x = 0;
var tip_y = 0;

function tip_konum_bul(e){
	if (!e) e = window.event;
	
	if (e){
		if (e.pageX || e.pageY){
			tip_x = e.pageX;
			tip_y = e.pageY;
		}
		else if (e.clientX || e.clientY){
			tip_x = e.clientX + document.body.scrollLeft;
			tip_y = e.clientY + document.body.scrollTop;
		}
	}
	
	if(tip_x<0){tip_x = 0};
	if(tip_y<0){tip_y = 0};
	
}

function tip_konum(e){
	tip_konum_bul(e);
	
	if(!e){e = window.event};
	var nesne;
	
	if (e.target!= null){nesne = e.target}
	else {nesne = e.srcElement}
	
	var yardim = tip_yardim(nesne)
	var yardimdiv = document.getElementById("dene");
	
	if(yardim == "-"){
		yardimdiv.style.display = 'none';
		}
	else{
		yardim=yardim.replace(/\[/g,"<")
		yardim=yardim.replace(/\]/g,">")
		yardimdiv.style.left = tip_x + 20 + "px";
		yardimdiv.style.top = tip_y - 20 + "px";
		
		yardimdiv.innerHTML = yardim;
		yardimdiv.style.display = 'block';
	}
}

function tip_yardim(n){
	var metin = "-";
	var x = 0;
	var ozellik = n.attributes;
	
	for (x = 0; x < ozellik.length; x++) {
		if (ozellik[x].name == "tips"){
			metin = ozellik[x].value;
			break;
		}
	}
	
	return metin;
}

document.write("<div id='dene' name='dene' style='")
	document.write("position:absolute;")
	document.write("display:none;")
	document.write("z-index:255;")
	
	document.write("background-color:#666666;")
	document.write("border:1px solid #333333;")
	document.write("padding:5px;")
	
	document.write("top:0px;")
	document.write("left:0px;")
	
	var seffaflik = "50";
	document.write("filter:alpha(opacity:" + seffaflik + ");")
	document.write("-khtml-opacity:0." + seffaflik + ";")
	document.write("-moz-opacity:0." + seffaflik + ";")
	document.write("-o-opacity:0." + seffaflik + ";")
	document.write("opacity:0." + seffaflik + ";")
	
document.write("'>&nbsp;</div>")

document.onmousemove = tip_konum;