﻿//Yazan; Ufuk YAYLA: http://www.ufukyayla.com
//Teşekkürler; Ferruh MAVİTUNA: http://ferruh.mavituna.com
//Mavi turuncu tonlarda; toplansın dalgalar kumsalda.

var tips_zamanasimi;
var tips_gorunuyor = false;

function tips_goster(e){
	var nesne;
	var x;
	var y;
	var w;
	var h;
	
	if ( e.target != null ) { nesne = e.target }
	else { nesne = e.srcElement }
	
	var tips_metin = ozellik_oku(nesne, "tips");
	var tips_div = $("tips_div");
	
	//Gerektiği yerlerde nesnelerin konum, ebat ve z-index bilgilerini tips olarak gösterir.
	//if ( tips_metin == "-" ) { tips_metin = nesne.id + "<br/>x" + nesne_x(nesne) + " / y" + nesne_y(nesne) + "<br/>w" + nesne_w(nesne) + " / h" + nesne_h(nesne) + "<br/>z" + nesne.style.zIndex; }
	
	if ( tips_metin == "-" ) {
		tips_div.style.display = "none";
		tips_gorunuyor = false;
	}
	else {
		tips_metin = tips_metin.replace(/\[/g, "<");
		tips_metin = tips_metin.replace(/\]/g, ">");
		
		tips_metin = tips_metin.replace(/ /g, "&nbsp;");
		
		//if ( left(tips_metin, 3) == "../" ) { tips_metin = degistir(tips_metin, "../", domain + "/" ) }
		
		tips_div.innerHTML = tips_metin;
		if ( tips_div.style.display == "block" ) { tips_gorunuyor = true }
		tips_div.style.display = "block";
		
		//tips_div.style.left = "0px";
		//tips_div.style.top = "0px";
		
		w = nesne_w(tips_div);
		h = nesne_h(tips_div);
		
		if ( tips_gorunuyor == false ) { tips_div.style.display = "none" }
		
		x = fare_x + 10;
		if ( x > body_w() - (w + 10) ) { x = body_w() - (w + 10) }
		if ( x < 0) { x = 0 }
		
		y = fare_y - ( 10 + h );
		if ( y < 0) { y = 0 }
		
		tips_div.style.left = x + "px";
		tips_div.style.top = y + "px";
		
		if ( tips_gorunuyor == false ) {
			clearTimeout(tips_zamanasimi);
			tips_zamanasimi = setTimeout( "tips_gorun()", 200 );
		}
	}
}

function tips_gorun(){
	var tips_div = $("tips_div");
	tips_div.style.display = "block";
}