function validate_SendLink( field_id )
{
	if (!/^[a-zA-Z0-9\-_\.]+?@[a-zA-Z0-9\-_\.]+?\.[a-zA-Z]{2,4}$/.test(document.getElementById(field_id).value))
	{
		document.getElementById("return__" + field_id).style.display="block";
		document.getElementById(field_id).select();
		return false;
	}
	else
	{
		document.getElementById("return__" + field_id).style.display="none";
		return true;
	}
}


function roll( cat_id )
{
	var e = document.getElementById("menu_subCat_ID__" + cat_id);
	var disp = ( e.style.display == "block" ) ? "none" : "block";
	var arrow = ( disp == "block" ) ? "arrow2" : "arrow";
	document.getElementById("menu_topCat_ID__" + cat_id).style.background = "#16549D url('/img/" + arrow + ".gif') center right no-repeat";
	e.style.display = disp;
}


function set_page(id)
{
	var el = document.getElementById(id);
	var y=0;
	for( var node=el; node; node=node.offsetParent)
	{
		y += node.offsetTop;
	}
	window.scrollTo(0, y);
}



function setCookie(cookieName, cookieValue, cookieExp)
{
	document.cookie = cookieName + '=' + escape(cookieValue)+(cookieExp?'; expires='+new Date(+new Date()+cookieExp*864e5).toGMTString():'')+'; path=/'
}
function getCookie(N,x)
{
	if((x=document.cookie)&&(N=(';'+x).match(new RegExp('(;| )'+N+'=[^;]+')))) 
	return unescape(N[0].split(/=/g)[1])
}



iz=0;
function photo(url,w,h)
{
	win=window.open('','win'+iz, 'left=0,top=0,width='+w+',height='+h+',innerheight='+h+',innerwidth='+w+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no')
	win.document.write('<html><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-2"></head>');
	win.document.write('<title>Powiększenie</title><body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
	win.document.write('<div align="center"><a href="#" onclick="javascript:self.close();"><img src="'+url+'" title="Zamknij" border="0"></a></div></body></html>');
	win.focus();
	iz+=1;
}



