gad_act_w=document.body.offsetWidth;
gad_act_h=document.body.offsetHeight;
gad_max_w=520;
gad_max_h=260;

if (gad_act_h>gad_max_h && gad_act_w>gad_max_w)
{
    google_ad_client = "pub-9123916068851441";
    google_alternate_ad_url = "http://refy.strefa.pl/gad/gad_za.php";
    google_ad_width = 120;
    google_ad_height = 240;
    google_ad_format = "120x240_as";
    google_ad_channel ="2748158008";
    google_ad_type = "text";
    google_color_border = "ffffff";
    google_color_bg = "ffffff";
    google_color_link = "000000";
    google_color_url = "000000";
    google_color_text = "000000";

	floatX=-1000;
	floatY=5;
	layerwidth=120;
	layerheight=600;
	delayspeed=0;


	NS6=false;
	IE4=(document.all);
	if (!IE4) {NS6=(document.getElementById);}
	NS4=(document.layers);

	function adjust() 
	{
		if ((NS4) || (NS6)) 
		{
			if (lastX==-1 || delayspeed==0)
			{
				lastX=window.pageXOffset + floatX;
				lastY=window.pageYOffset + floatY;
			}
			else
			{
				var dx=Math.abs(window.pageXOffset+floatX-lastX);
				var dy=Math.abs(window.pageYOffset+floatY-lastY);
				var d=Math.sqrt(dx*dx+dy*dy);
				var c=Math.round(d/10);
				if (window.pageXOffset+floatX>lastX) {lastX=lastX+delayspeed+c;}
				if (window.pageXOffset+floatX<lastX) {lastX=lastX-delayspeed-c;}
				if (window.pageYOffset+floatY>lastY) {lastY=lastY+delayspeed+c;}
				if (window.pageYOffset+floatY<lastY) {lastY=lastY-delayspeed-c;}
			}
		
			if (NS4)
			{
				document.layers['floatlayer'].pageX = lastX;
				document.layers['floatlayer'].pageY = lastY;
			}
			if (NS6)
			{
				document.getElementById('floatlayer').style.left=lastX;
				document.getElementById('floatlayer').style.top=lastY;
			}
		}
		else if (IE4)
		{
			if (lastX==-1 || delayspeed==0)
			{
				lastX=document.body.scrollLeft + floatX;
				lastY=document.body.scrollTop + floatY;
			}
			else
			{
				var dx=Math.abs(document.body.scrollLeft+floatX-lastX);
				var dy=Math.abs(document.body.scrollTop+floatY-lastY);
				var d=Math.sqrt(dx*dx+dy*dy);
				var c=Math.round(d/10);
				if (document.body.scrollLeft+floatX>lastX) {lastX=lastX+delayspeed+c;}
				if (document.body.scrollLeft+floatX<lastX) {lastX=lastX-delayspeed-c;}
				if (document.body.scrollTop+floatY>lastY) {lastY=lastY+delayspeed+c;}
				if (document.body.scrollTop+floatY<lastY) {lastY=lastY-delayspeed-c;}
			}
			document.all['floatlayer'].style.posLeft = lastX;
			document.all['floatlayer'].style.posTop = lastY;
		} 
		setTimeout('adjust()',10);
	}
	
	function define()
	{
		if ((NS4) || (NS6)) 
		{ 
			//floatX=window.innerWidth-layerwidth-24;
			floatX=0;
			floatY=ifloatY-5;
		}
		if (IE4) 
		{
			//floatX=document.body.offsetWidth-layerwidth-24;
			floatX=0;
			floatY=ifloatY-5;
		}
	}
	
	if (NS4) 
	{
		document.write('<LAYER NAME="floatlayer" LEFT="'+floatX+'" TOP="'+floatY+'">');
	}
	if ((IE4) || (NS6)) 
	{
		document.write('<div id="floatlayer" style="position:absolute; left:'+floatX+'; top:'+floatY+';">');
	}
}