var drag=false;
var scrh,scrw;
scrh=screen.height;
scrw=screen.width;

function solve(xc,intsolv)
{

	if(navigator.appName=='Microsoft Internet Explorer')
	{
		xc.style.filter='alpha(Opacity='+intsolv+')';
	}
	else
	{
		xc.style.MozOpacity=intsolv/100;	
	}
	
}

function position(e) { 
     
	 if(drag)
	 {
		 x = event.x+document.body.scrollLeft; 
    	 y = event.y+document.body.scrollTop; 
		 w=document.getElementById('popup').style.width;
		 j=w.split('px');
		 
		 g=j[0]*1;
		 if((x+g)>(scrw-50)){x=scrw-g;}
		 if(x<1){x=1;}
		 document.getElementById('popup').style.left=(x-10)+'px';
		 
		 document.getElementById('popup').style.top=(y-10)+'px';
	}
   } 


function gx(num,limit,dec,id)
{
	var xc=document.getElementById(id);
	num+=10*dec;
	if(num!=limit+(10*dec))
	{
		solve(xc,num);
		gxinterval=setTimeout("gx("+num+","+limit+","+dec+",'popup')");
	}
	else
	{
		clearTimeout(gxinterval);
		if(num<0)
		{
			document.getElementById('flashmenu').style.visibility='visible';
			document.getElementById('staticpic').style.visibility='hidden';
			xc.style.visibility='hidden';
		}
	}
}

function pencereAc(w,h,t,l,b,pic)
{
var im=new Image();
im.src='images/aktiviteler/'+pic;


p=im.width+26;
if(p==26){p=w};
solve(document.getElementById('container'),50);
	
	l=(scrw/2)-(p/2);
	t=(scrh/2)-(h/2);

document.getElementById('flashmenu').style.visibility='hidden';
	document.getElementById('staticpic').style.visibility='visible';

	document.getElementById('popup').style.visibility='visible';
	
	gx(0,100,1,"popup");
	
	if(pic=='bizkimiz.jpg'){ t=100;}
	document.getElementById('popup').style.width=p+"px";
	document.getElementById('popup').style.height="auto";
	document.getElementById('popup').style.top=t;
	document.getElementById('popup').style.left=l;
	
	
	kxc="";
	if(b!='')
	{
		kxc='<p style="color:#ffffff;">'+b+"</p>";	
	}
	
	document.getElementById('popupiccerceve').innerHTML=kxc+'<img src=images/aktiviteler/'+pic+'>';

}
function pencereKapat()
{


gx(100,0,-1,"popup");
solve(document.getElementById('container'),100);


}