
var animate = function(ev,prd,stp,spd)
{
	var obj = {
		a: { event:ev, step:typeof stp!="undefined"?stp:1, iterator:0, interval:null, speed:typeof spd!="undefined"?spd:30, period:typeof prd!="undefined"?prd:10, errorLog:[] },
		init: function()
		{
			with(obj)
			{
				a.interval = setInterval(doo.run,a.speed);
				doo.event("load");
			}
		},
		doo: {
			event: function(key)
			{
				with(obj)
				{
					if(typeof a.event[key]=="function")
					try { a.event[key](a); }
					catch (e)
					{
						a.errorLog.push("External error:"+e);
					}
				}
			},
			run: function()
			{
				with(obj)
				{
					doo.event("run");
					a.iterator+=a.step;
					if(a.iterator<a.period)return;
					doo.kill();
				}
			},
			kill: function()
			{
				with(obj)
				{
					clearInterval(a.interval);
					doo.event("complete");
				}
			}
		}
	}
	return obj;
}


var sizer = function(e,s,dir)
{
	var obj = {
		a: { elm:e, height:typeof s.height!="undefined"?[e.offsetHeight,s.height,1,1]:[0,0,0,0], width:typeof s.width!="undefined"?[e.offsetWidth,s.width,1,1]:[0,0,0,0], margin:typeof s.margin=={}?s.margin:{ height:0, width:0 }, direction:dir==-1?-1:1, period:0 },
		init: function()
		{
		
			with(obj)
			{
				a.height[0] -= a.margin.height;
				a.width[0] -= a.margin.width;
				var p = [Math.abs(a.height[0]-a.height[1]),Math.abs(a.width[0]-a.width[1])];
				a.period =p[0]<p[1]?p[1]:p[0];
				
				a.elm.sizer = new animate({ run:doo.fx, complete:doo.complete },a.period,8,15);
				a.elm.sizer.init();
			}
		},
		doo: {
			fx: function(fact)
			{
				with(obj)
				{
					
					if(a.height[0]<a.height[1] && a.height[3])
					{
						a.elm.style.height = (a.height[0]+fact.iterator)+"px"
						if(a.height[0]+fact.iterator>=a.height[1])
						{
							a.elm.style.height = a.height[1]+"px";
							a.height[3]=0;
						}
						
					}
					else if(a.height[3])
						a.elm.style.height = (a.height[0]-fact.iterator)+"px";

					if(a.width[0]<a.width[1] && a.width[3])
					{
						a.elm.style.width = (a.width[0]+fact.iterator)+"px"
						if(a.width[0]+fact.iterator>=a.width[1])
						{
							a.elm.style.width = a.width[1]+"px";
							a.width[3]=0;
						}
						
					}
					else if(a.width[3])
						a.elm.style.width = (a.width[0]-fact.iterator)+"px";
					
				}
			},
			complete: function()
			{
				with(obj)
				{
					if(a.width[2]==1)a.elm.style.width = a.width[1]+"px";
					if(a.height[2]==1)a.elm.style.height = a.height[1]+"px";
					
					var elm_off = document.getElementById("internetSubesi_off");
					elm_off.style.display = a.height[0]>a.height[1]?"block":"none";
				}
			}
		}
	};
	return obj;
}



var _open = function()
{
	
	elm_off.style.display = "none";
	
	if(window.location != 'http://' + window.location.hostname + '/site_haritasi/index.jsp'){
		
	var key = 'a_'+Math.round(Math.random()*100); elm[key] = new sizer(elm,{ height:158 }); elm[key].init(); elm.style.backgroundImage = 'url(../_i/int_sube_on.jpg)';
			
		}else{
			var key = 'a_'+Math.round(Math.random()*100); elm[key] = new sizer(elm,{ height:158 }); elm[key].init(); elm.style.backgroundImage = 'url(../_i/int_sube_on_2.gif)';
			
			}
	
	
	
	
	closedx = 0;
}

var close = function(fact)
{
	var parent=fact[navigator.appName=="Microsoft Internet Explorer"?"srcElement":"target"];
	if(closedx || (parent.getAttribute && parent.getAttribute("rel")=="donthide"))return 0;
	var key = 'a_'+Math.round(Math.random()*100); elm[key] = new sizer(elm,{ height:70 }); elm[key].init();
	closedx = 1;
}
var closedx = 1;

