function StartResize() { Resize(243); }


function Resize(wys)
{
	if (document.body && document.getElementById("intro"))
	{
		var wys = Math.abs(wys);
		ratio = 0.1;
		dx2 = 0;
		dy2 = 0;
		wysokosc = document.getElementById("intro").style.height.substr(0,3);
		wysokosc_img = document.getElementById("img").style.height.substr(0,3);
//		alert(wysokosc_img);
/*		var pom = getPageSize();
		szerokosc = pom[0]
		wysokosc = pom[1]

	
		dx = MyWidth - szerokosc;
		if (dx !=0)
		{
			if (Math.abs(dx)>10)
				dx2 = 1.0* dx*ratio;
			else 
				dx2 = dx/Math.abs(dx);
		}
*/
//		alert(wys);
		dy = wys - wysokosc;
//		alert(dy);
		if (dy !=0)
		{
			if (Math.abs(dy)>10)
				dy2 = 1.0* dy*ratio;
			else 
				dy2 = dy/Math.abs(dy);
		}
		
//		alert(dy);
//		alert(dy2);
//		alert((wysokosc+dy2));
		wysokosc = 1*wysokosc+dy2;
		wysokosc_img = 1*wysokosc_img+dy2;
		document.getElementById("intro").style.height = wysokosc+"px";
		document.getElementById("img").style.height = wysokosc_img+"px";
//		774
//		document.getElementById("flash01").height = wysokosc_img+"px";
//		document.getElementById("flash01").width = 774+"px";
		
//		alert(document.getElementById("flash01").height);

		window.status = wysokosc_img;
		
//		window.resizeBy(dx2,dy2);
//		window.moveBy(-dx2/2,-dy2/2);
//		window.focus();
		//if (confirm(dx2 + " " + dy2)) return 0;
//		alert(wys+1);
//		wys = wys*1;
		if (Math.abs(dy)>0 )
		{
			window.setTimeout("Resize("+wys+")",10);
		}
		else
		{
			//alert(MyWidth + " " + MyHeight + " " + document.body.offsetHeight);
//			document.getElementById("intro").style.background = "none";
			
		}
	}	
}
//window.onload=Resize;

function getPageSize()
{
    var windowWidth, windowHeight;
    if (self.innerHeight) {    // all except Explorer
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }    
    arrayPageSize = new Array(windowWidth,windowHeight) 
    return arrayPageSize;
}

function powieksz(el, fname, s, w)
{
	wys = w + 5;
	szer = s + 25;

	  if(window.screen){
		aw=screen.availWidth;
		ah=screen.availHeight;
	  }else{
		aw=640;
		ah=450;
	  }

	  if (szer>810) szer = 810;
	  if (wys>610) wys = 610;

	str = "foto.php?dir="+escape(el)+"&ph="+escape(fname);
	var win = window.open(str,"zoom","width="+szer+", height="+wys+", left="+(aw-szer)/2+", top="+ (ah-wys)/2+", titlebar=no, status=no, toolbar=no, menubar=no, location=no, resizable=yes, scrollbars=yes, fullscreen=no");
	win.focus();
}



function isEmail(s) {
	return s != "" 	&& s.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/);	
}

function mySend()
{
	if (!isEmail(MF.adres.value))
	{
		alert("Podaj poprawnie adres e-mail...");
		MF.adres.focus();
		return;
	}
	return true;
}

function Dodaj()
{
	if (mySend())
	{
		MF.op.value = "add";
		MF.submit();
		return;
	}
}

function Usun()
{
	if (mySend())
	{
		MF.op.value = "del";
		MF.submit();
		return;
	}
}

