function IsEmpty(aTextField)
	{
	   if ((aTextField.value.length==0) ||
	   (aTextField.value==null)) {
		  return true;
	   }
	   else { return false; }
	}

	function IsEmail (s)
	{
		 var reEmail = /^.+\@.+\..+$/
		 return reEmail.test(s.value)
	}
function proveriFormu(b) {
   if (b=='c') {
if(IsEmpty($('forma').fullname))
	   {
		  alert('Please enter your name!!!')
		  $('forma').fullname.focus();
		  return false;
	   }
if(IsEmpty($('forma').email))
	   {
		  alert('Please enter your e-mail!!!')
		  $('forma').email.focus();
		  return false;
	   }
if (!IsEmail($('forma').email)) {
	 								alert ('E-mail you entered is not recognised');
									return false;
								 }

if(IsEmpty($('forma').question))
	   {
		  alert('You have to enter your message/question!!!')
		  $('forma').question.focus();
		  return false;
	   }
   }
 else if (b=='b') {
     if(IsEmpty($('forma').fullname))
	   {
		  alert('Please enter your name!!!')
		  $('forma').fullname.focus();
		  return false;
	   }
if(IsEmpty($('forma').email))
	   {
		  alert('Please enter your e-mail!!!')
		  $('forma').email.focus();
		  return false;
	   }
if (!IsEmail($('forma').email)) {
	 								alert ('E-mail you entered is not recognised');
									return false;
								 }

if(IsEmpty($('forma').tel))
	   {
		  alert('You have to enter your telephone!!!')
		  $('forma').tel.focus();
		  return false;
	   }


 }

}
function provera(b) {
var prom=$('forma').serialize();
$("send").style.width="75px";
$("send").value = 'Sending...';

new Ajax.Request('work/captcha.php', { parameters: prom, onComplete: function(transport) { if (transport.status == 200) {
	if (transport.responseText=='1') {obrada(prom,b);} else {$("send").style.width="50px";
$("send").value = 'Send';alert("Please Enter The Recaptcha Codes"); Recaptcha.reload();}

}}});
}
function obrada(p,b) {
new Ajax.Request ('work/fabrics.php?type='+b, { parameters: p, onComplete: function(transport) { $('right').innerHTML=transport.responseText;}});
}

