	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('fullname'))) {
    document.getElementById('fullname').focus();
		alert("You forgot to fill in your Name.");

		return false;

    }
    if(document.getElementById('Country').value=="Select Country") {
    document.getElementById('Country').focus();
		alert("Please select your Country of location.");

		return false;

    }


    if(document.getElementById('state').value=="Please Select") {
    document.getElementById('state').focus();
		alert("Please select your State of location.");

		return false;

    }

    if(!isNonEmpty(document.getElementById('phone'))) {
    document.getElementById('phone').focus();
		alert("You forgot to fill the Phone field.");

		return false;

    }
    if(!isNonEmpty(document.getElementById('Budget'))) {
    document.getElementById('Budget').focus();
		alert("Please tell us what your Budget is for this project.");

		return false;

    }
    if(!isNonEmpty(document.getElementById('ProjectDesc'))) {
    document.getElementById('ProjectDesc').focus();
		alert("Please provide a brief Description of your Project.");

		return false;

    }


  if(!isNonEmpty(document.getElementById('email'))) {
    document.getElementById('email').focus();
		alert("You forgot to provide your EMail.");

		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)) {
    document.getElementById('email').focus();
		alert("The Email entered is Incorrect");

		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;

}




