
//////////////////////////////////////////////////////////////
//    
//    Author	: Recep Akkoc == BeyazSeytan == SheyTaNi999
//    Created	: 15.08.2006 - ??.??.????
//    Purpose	: WebWizTurk@BS_stilo.Js 
//    Version   : 1.2
//    
//    Copyright : All Rights Reserved
//
//////////////////////////////////////////////////////////////

	var stiloMenu = {
		tblTop : 0, tblLeft : 0, tblHit : 0, tblWid : 0, GosterTimer : 2000, MD:0, 

		tblSifir:function(){
			stiloMenu.tblTop = 0;
			stiloMenu.tblLeft = 0;
			stiloMenu.tblHit = 0;
			stiloMenu.tblWid = 0;
		},
		
		OkusPokus:function(Nesne1, Nesne2) {
			stiloMenu.tblSifir();
			stiloMenu.tblOku(Nesne1);
			stiloMenu.NseOku(Nesne1);
			stiloMenu.NakilEt(Nesne2,Nesne1);
			stiloMenu.Goster(Nesne2);
				
				//alert(document.body.clientWidth + ' - ' + document.body.scrollLeft);
				//alert('tblTop = ' + stiloMenu.tblTop + '\ntblLeft = ' + stiloMenu.tblLeft + '\ntblHit = ' + stiloMenu.tblHit + '\ntblWid = ' + stiloMenu.tblWid)
		},
		
		Goster:function(Nesne) {
			Nesne.style.visibility = 'visible';
			//Nesne.style.display = '';
		},

		Gizle:function(Nesne) {
			Nesne.style.visibility = 'hidden';
			//Nesne.style.display = 'none';
		},

		tblOku:function(Nesne) {
			if(typeof(Nesne == "object")) {
				try {
					if(!isNaN(Nesne.offsetLeft)) {
						stiloMenu.tblLeft += parseInt(Nesne.offsetLeft);
    					stiloMenu.tblTop += parseInt(Nesne.offsetTop);
    				}
					stiloMenu.tblOku(Nesne.offsetParent);
				}
				catch(e) {}
			}
		},

		NseOku:function(Nesne) {
			stiloMenu.tblHit = Nesne.offsetHeight;
			stiloMenu.tblWid = Nesne.offsetWidth;
		},

		NakilEt:function(Nesne1,Nesne2) {

			if(parseInt(parseInt(document.body.clientHeight) + parseInt(document.body.scrollTop) + 2 ) > parseInt(parseInt(stiloMenu.tblTop) + parseInt(stiloMenu.tblHit))) {
				Nesne1.style.top = stiloMenu.tblTop +  Nesne2.offsetHeight + 'px';  
			}
			else  {
				Nesne1.style.top = stiloMenu.tblTop - stiloMenu.tblHit + 'px';  
			}

			if(parseInt(parseInt(document.body.clientWidth) + parseInt(document.body.scrollLeft) - 2 ) > parseInt(parseInt(stiloMenu.tblLeft) + parseInt(Nesne1.offsetWidth))) {
				Nesne1.style.left = parseInt(stiloMenu.tblLeft) + 'px';
			}
			else {
				Nesne1.style.left = parseInt(parseInt(stiloMenu.tblLeft) + parseInt(Nesne2.offsetWidth) - parseInt(Nesne1.offsetWidth)) + 'px';
			}
		}
	}