function isEmpty( str){
    strRE = new RegExp( );
    strRE.compile( '^[\s ]*$', 'gi' );
    return strRE.test( str.value );
}

function notValidEmail( str ){
    mailRE = new RegExp( );
    mailRE.compile( '^[\._a-z0-9-]+@[\.a-z0-9-]+[\.]{1}[a-z]{2,4}$', 'gi' );
    return !(mailRE.test( str.value ));
}

function notChecked( box ){
    if( box.checked ){
        return false;
    }
    else{
        return true;
    }
}

//it accepts "form" as parameter
function checkForm( form ){

    //lets check if Name text field is empty. This field has name "name".
    if( isEmpty( form.name ) ){
        alert( 'Name is required field!' );
        return false;
    }

    //now let's check if email is correct. This field name is "email"
    if( notValidEmail( form.email ) ){
        alert( 'Dont forget your Email Address!' );
        return false;
    }

    //now let's check if checkbox is checked. This field name is "subscribe"
    if( notChecked( form.subscribe ) ){
        alert( 'Subscribe box is required field!' );
        return false;
    }

	alert('Form is okay!!!');
    return false;
}