//Yazan; Ufuk YAYLA: http://www.ufukyayla.com

var tarayici_ie = document.all;
var tarayici_ff = document.getElementById && !document.all;

//------------------------------------------------------------------
//Sayfa yüklemesi bitince çalışır
function yuklendi(){
	//resimduzelt(); devrede değil, çünkü banneri de küçültüyor.
	
	tekrarli();
}

//------------------------------------------------------------------
//100 ms. aralıklarla sürekli çalışır
function tekrarli(){
	var nesne = document.getElementById("menu");
	
	if ( tarayici_ie ) {
		try { nesne.style.top = document.body.scrollTop + 10 + "px"; }
		catch ( e ) { nesne.style.top = "10px"; }
	}
	else {
		try { nesne.style.top = window.pageYOffset + 10 + "px"; }
		catch ( e ) { nesne.style.top = "10px"; }
	}
	
	setTimeout("tekrarli()", 100);
}

//------------------------------------------------------------------

function resimduzelt(){
	var resimler, x, h, w, oran;
	
	resimler = document.getElementsByTagName("img");
	
	for( x = 0; x < resimler.length; x++ ) {
		w = resimler[x].width;
		
		if ( w > 420 ) {
			h = resimler[x].height;
			
			oran = h / w;
			w = 420;
			h = w * oran;
			
			resimler[x].width = w;
			resimler[x].height = h;
		}
	}
}

//------------------------------------------------------------------
//Tips gösterir

var tips_x = 0;
var tips_y = 0;

function tips_konum_bul(e){
	if ( !e ) { e = window.event };
	
	if ( e ) {
		if ( e.pageX || e.pageY ) {
			tips_x = e.pageX;
			tips_y = e.pageY;
		}
		else if ( e.clientX || e.clientY ) {
			tips_x = e.clientX + document.body.scrollLeft;
			tips_y = e.clientY + document.body.scrollTop;
		}
	}
	
	if ( tips_x < 0 ) { tips_x = 0 };
	if ( tips_y < 0 ) { tips_y = 0 };
}

function tips_konum(e){
	tips_konum_bul(e);
	
	if ( !e ) { e = window.event };
	
	var nesne;
	
	if ( e.target!= null ) { nesne = e.target }
	else { nesne = e.srcElement }
	
	var metin = tips_metni(nesne);
	var metin_div = document.getElementById("tips_div");
	
	if (metin == "-") {
		metin_div.style.display = 'none';
		}
	else {
		metin = metin.replace(/\[/g, "<");
		metin = metin.replace(/\]/g, ">");
		
		metin_div.style.left = tips_x + 10 + "px";
		metin_div.style.top = tips_y - 30 + "px";
		
		metin_div.innerHTML = metin;
		metin_div.style.display = 'block';
	}
}

function tips_metni(n){
	var i = 0;
	var metin = "-";
	var ozellikler = n.attributes;
	
	for ( i = 0; i < ozellikler.length; i++ ) {
		if ( ozellikler[i].name == "tips" ) {
			metin = ozellikler[i].value;
			break;
		}
	}
	
	return metin;
}

document.write("<div id='tips_div' name='tips_div' class='tips' style='");
	document.write("position: absolute;");
	document.write("display: none;");
	document.write("z-index: 255;");
	
	document.write("padding: 5px;");
	document.write("top: 0px;");
	document.write("left: 0px;");
document.write("'>&nbsp;</div>");

document.onmousemove = tips_konum;