function Focus(control) {
  control.focus();
  control.select();
}

function IsEmailCorrect(email) {
  return email.match(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/)!=null;
}

function IsEmpty(pole) {
  if (pole=='') 
  	return true
	else
	return false
}

function check()
{
if (IsEmpty(document.getElementById('yourname').value)) {
    alert('Please correct Name field.');
    Focus(document.getElementById('yourname'));
    return false;
  }
if (IsEmpty(document.getElementById('companyname').value)) {
    alert('Please correct Company Name field.');
    Focus(document.getElementById('companyname'));
    return false;
  }
if (!IsEmailCorrect(document.getElementById("youremail").value)) {
    alert('Please correct E-mail field');
    Focus(document.getElementById("youremail"));
    return false;
  }
if (IsEmpty(document.getElementById('telephone').value)) {
    alert('Please correct Telephone no. field.');
    Focus(document.getElementById('telephone'));
    return false;
  }
if (IsEmpty(document.getElementById('yourmessage').value)) {
    alert('Please correct Your Message field.');
    Focus(document.getElementById('yourmessage'));
    return false;
  }
return true;
}

function openW(strona,width_,height_,sc){
         new_window = window.open(strona,'strona','width='+width_+',height='+height_+',toolbars=no,resizeble="no",scrollbars='+sc);
}

var i;

function checked(name)
{	
	
	if (document.getElementById(name).style.display=='')
	{
		document.getElementById(name).style.display='none';
		return;
	}
	
	if (document.getElementById(name).style.display=='block')
	{
		document.getElementById(name).style.display='none';			
	}
	else
	{
		document.getElementById(name).style.display='block';			
	}
}


function show(name)
{	
	if (document.getElementById(name).style.display=='block')
	{
		document.getElementById(name).style.display='none';			
	}
	else
	{
		document.getElementById(name).style.display='block';			
	}
}


