function mywrite(flash)
{
	document.write(flash)
}


function $(name)
{
	obj =  document.getElementById(name);
	return obj;
}


function myMail(f)
{
	if (!CheckEMail(f.email.value))
	{
		alert("Prosze podać poprawnie adres e-mail...");
		f.email.focus();
		return false;
	}

	return true;
}


function checkKontakt(f)
{
	if (!f.nazwisko.value)
	{
		alert("Prosze podać imię i nazwisko...");
		f.nazwisko.focus();
		return false;
	}

	
	if (!f.email.value && !f.telefon.value)
	{
		alert("Prosze podać adres e-mail lub telefon kontaktowy...");
		f.email.focus();
		return false;
	}
	
	if (f.email.value && !CheckEMail(f.email.value))
	{
		alert("Prosze podać poprawnie adres e-mail...");
		f.email.focus();
		return false;
	}
	
/*
	if (!f.temat.value)
	{
		alert("Prosze podać temat wiadomości...");
		f.temat.focus();
		return false;
	}
*/

	if (!f.ftresc.value)
	{
		alert("Prosze podać treść wiadomości...");
		f.ftresc.focus();
		return false;
	}

	return true;
}






function powieksz(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?img="+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 doResize()
{
/*
	 // wielkosc okna przegladarki
	 if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	  }
*/
	if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
      myWidth = document.documentElement.clientWidth;
    }
	else if (self.innerWidth) {
      myWidth = self.innerWidth;
    }  else if (document.body) {
      myWidth = document.body.clientWidth;
    }


//	alert(myWidth);
	if (myWidth<986) myWidth=986;
	if (myWidth<1280)
	{
		$('bg1').style.width=myWidth+"px";
		$('bg2').style.marginLeft="-"+Math.round((1280-myWidth)/2+13)+"px";
	}
	else
	{
		$('bg1').style.width="1280px";
		$('bg2').style.marginLeft = "-13px";
	}
}

	window.onresize = doResize;

