
	function isNonEmpty(obj)

{

    retval = false;

    for (var i = 0; i < obj.value.length; i++) {

        if (obj.value.substring(i, i + 1) != " ") {

            retval = true;

            break;

        }

    }

    return retval;

}

function check(form)
{

    if(!isNonEmpty(document.getElementById('fname'))) {

		alert("You forgot to fill <Name> field.");

		return false;

    }
    if(document.getElementById('Country').value=="Select Country") {

		alert("You forgot to fill <Country> field.");

		return false;

    }
    if(!isNonEmpty(document.getElementById('phone'))) {

		alert("You forgot to fill <Phone> field.");

		return false;

    }
    if(!isNonEmpty(document.getElementById('Budget'))) {

		alert("You forgot to fill <Budget> field.");

		return false;

    }
    if(!isNonEmpty(document.getElementById('ProjectDesc'))) {

		alert("You forgot to fill <Project Description> field.");

		return false;

    }


  if(!isNonEmpty(document.getElementById('email'))) {

		alert("You forgot to fill <E-Mail> field.");

		return false;

    }

    regexp = /^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@(((\[)?(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))(\])?))|((([a-zA-Z0-9\-])+\.)+([a-zA-Z\-])+))$/gi;

    if(isNonEmpty(document.getElementById('email')) && (document.getElementById('email').value.search(regexp)==-1)) {

		alert("Incorrect <E-Mail>.");

		return false;

    }

	form.submit();
    return false;

}



function check3(form)
{

    if(!isNonEmpty(form.all['data[name]'])) {

		alert("You forgot to fill <Full Name> field.");

		return false;

    }
    if(!isNonEmpty(form.all['data[phone]'])) {

		alert("You forgot to fill <Phone> field.");

		return false;

    }

    if(!isNonEmpty(form.all['data[coupon]'])) {

		alert("You forgot to fill <Coupon Code> field.");

		return false;

    }
    

  if(!isNonEmpty(form.all['data[email]'])) {

		alert("You forgot to fill <E-Mail> field.");

		return false;

    }

    regexp = /^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@(((\[)?(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))(\])?))|((([a-zA-Z0-9\-])+\.)+([a-zA-Z\-])+))$/gi;

    if(isNonEmpty(form.all['data[email]']) && (form.all['data[email]'].value.search(regexp)==-1)) {

		alert("Incorrect <E-Mail>.");

		return false;

    }

	form.submit();
    return false;

}


function check1(form)
{

    if(!isNonEmpty(document.getElementById('name'))) {

		alert("You forgot to fill <Full Name> field.");

		return false;

    }
    if(!isNonEmpty(document.getElementById('comments'))) {

		alert("You forgot to fill <Comments> field.");

		return false;

    }


  if(!isNonEmpty(document.getElementById('e_mail'))) {

		alert("You forgot to fill <E-Mail> field.");

		return false;

    }

    regexp = /^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@(((\[)?(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))(\])?))|((([a-zA-Z0-9\-])+\.)+([a-zA-Z\-])+))$/gi;

    if(isNonEmpty(document.getElementById('e_mail')) && (document.getElementById('e_mail').value.search(regexp)==-1)) {

		alert("Incorrect <E-Mail>.");

		return false;

    }

	form.submit();
    return false;

}


function check2(form)
{

    if(!isNonEmpty(form.all['first_name'])) {

		alert("You forgot to fill <First Name> field.");

		return false;

    }
    if(!isNonEmpty(form.all['last_name'])) {

		alert("You forgot to fill <Last Name> field.");

		return false;

    }
    if(!isNonEmpty(form.all['address'])) {

		alert("You forgot to fill <Address> field.");

		return false;

    }

  if(!isNonEmpty(form.all['email'])) {

		alert("You forgot to fill <E-Mail> field.");

		return false;

    }

    regexp = /^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@(((\[)?(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))(\])?))|((([a-zA-Z0-9\-])+\.)+([a-zA-Z\-])+))$/gi;

    if(isNonEmpty(form.all['email']) && (form.all['email'].value.search(regexp)==-1)) {

		alert("Incorrect <E-Mail>.");

		return false;

    }

	form.submit();
    return false;

}




