var hiz = 70, _P, interval, startY;
var imgDiv, ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera, d = document;
var tempObj, IE = ((document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body);
function Resim (_small, _big) {
	this.small = _small?_small:'';
	this.big   = _big?_big:'';
	var IMG = new Image();
	if (this.big !='' && this.big != null)
	 IMG.src = 'UPLOAD/EMLAK/' + this.big;
	this.Export = function (){
		if (this.small==''||this.small==null||this.big==''||this.big==null)return "";
		return "<td class=\"vitrin_bg\" height=\"120\" align=\"center\" valign=\"middle\"><img src='UPLOAD/EMLAK/" + this.small + "' alt='Şenay Emlak' title='Şenay Emlak' style=\"cursor:pointer;\" onmouseover='ResimGoster(this, \"" + this.big + "\");' onmouseout='ResimGizle();'/></td>";
	}
}
function ResimList(){
	this.Items = new Array ();
	this.Add = function (_small, _big){
		if (_small==''||_small==null||_big==''||_big==null) return ;
			this.Items[this.Items.length] = new Resim (_small, _big);
	}
	this.Export = function () {
		var writeText = "<table cellpadding=\"3\" cellspacing=\"0\" width=\"317\" border=\"0\"><tr>";
		for ( _i in this.Items ) {
			if (_i>0&&_i%2==0)writeText += "</tr><tr>";
			writeText += this.Items[ _i ].Export ();
		}
		writeText += "</tr></table>";
		document.write (writeText);
	}
}
function ResimGizle () {
    clearInterval (interval);
	with(imgDiv.style){
		visibilty = 'hidden';
		display = 'none';
	 }
	 window.status = 'Done';
}
function ResimGoster (_obj, _resim) {
	if (!imgDiv)imgDiv = document.getElementById('imgDiv');
	document.getElementById ('img').src = 'UPLOAD/EMLAK/' + _resim;
	window.status = "Resim Gösteriliyor....";
	 with(imgDiv.style){
		top = '0px';
		visibilty = 'visible';
		display = 'block';
	 }
	  _P = getCoor (tempObj = _obj);
	 imgDiv.x = _P.X-tempObj.offsetWidth-10;
	 startY = _P.Y;
	 staticbar();
}
function Coor (_X, _Y){
	this.X = _X;
	this.Y = _Y;
}
function getCoor (obj) {
	if (typeof(obj)=="string")
		obj = document.getElementById(obj);
	if (!obj) return (new Coor(0, 0));
	var Left=obj.offsetLeft, Top=obj.offsetTop;
	try {
		var Parent = obj.offsetParent;
		while (Parent != null){
			Left += Parent.offsetLeft;
			Top  += Parent.offsetTop ;
			Parent = Parent.offsetParent;
		}
	}
	catch(Hata) {return (new Coor(0, 0));}
	return (new Coor(Left, Top ));
}
var RL = new ResimList();
window.stayTopLeft=function(){
	if (interval)
		clearInterval (interval);
	var pY = ns ? pageYOffset : IE.scrollTop;
	imgDiv.y += (pY + startY - imgDiv.y)/8;
	if ( (imgDiv.y + imgDiv.offsetHeight) > (IE.scrollTop + IE.clientHeight))
		imgDiv.y = (IE.scrollTop + IE.clientHeight) - imgDiv.offsetHeight;
	else if (imgDiv.y > _P.Y+imgDiv.offsetHeight)
		imgDiv.y = _P.Y+imgDiv.offsetHeight;
	imgDiv.setPos();
	interval = setTimeout("stayTopLeft()", hiz);
}
function staticbar(){
	if (typeof imgDiv.setPos == "undefined")
		imgDiv.setPos=function(){  with( this.style ) { left=this.x+"px"; top=this.y+"px"; } };
	imgDiv.y = 0;
	stayTopLeft();
}