function readMore(id,divId,textDiv)
{
	var obj = document.getElementById(id);
	var div = document.getElementById(divId);
	var text = document.getElementById(textDiv);
	
	var test = obj.src.indexOf("read.gif",0);	
	
	if (test != -1)
	{
		obj.src = 'images/icons/read_off.gif';
		text.innerHTML = 'Ukryj szczegółowe informacje';
		div.style.display = "block";
	}
	else
	{
		obj.src = 'images/icons/read.gif';
		text.innerHTML = 'Zobacz szczegółowe informacje';
		div.style.display = "none";		
	}
}

function email_validate(src) 
{
  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  return regex.test(src);
}

function sendForm()
{
	var form = document.forms[0];
	if (form.elements[0].value == '') return alert('Podaj swoje imię i nazwisko przed wysłaniem!');
	if (email_validate(form.elements[1].value) == false) return alert('Niepoprawny zapis adresu e-mail!');
	if (form.elements[2].value.length < 10) return alert('Twoja wiadomość musi zawierać co najmniej 10 znaków!');
	document.forms[0].submit();
}

function getXY(e) 
{
   x = (window.Event) ? e.pageX : window.event.clientX;
   y = (window.Event) ? e.pageY : window.event.clientY;
   
   if (window.navigator.userAgent.indexOf( 'MSIE' ) + 1)
   {
	   	if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
	   	{
    	    x += document.body.scrollLeft;
        	y += document.body.scrollTop;
		} 
		else if
		( 
			document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    	    x += document.documentElement.scrollLeft;
	        y += document.documentElement.scrollTop;
    	}
    	document.getElementById('n3').style.width = "300px";
   }
	document.getElementById("info_window").style.left = x + 20 + "px";
	document.getElementById("info_window").style.top = y + 20 + "px";
}

function showText(text,div)
{
	document.getElementById(div).style.display = 'block';
	document.getElementById(div).style.posiotion = 'abolute';
	document.getElementById(div).innerHTML = text;
	document.onmousemove = getXY;
}

function hideText(div) { document.getElementById(div).style.display = 'none'; }

function fullscreen()
{
	var obj = document.getElementById('fullscreen');
	obj.value = '1';
}
