function isEmpty(val){
                if(!val.value){
                                return false;
                }
                return true;
}

function isValidEmail(val) {
                val = val.value;
                return (val.indexOf(".") > 0) && (val.indexOf("@") > 0);
 
}


function validateform(){
                var name = document.getElementById('name');
                var email = document.getElementById('email');            
                var error = 'Please insert your ';
                
                if(!isEmpty(name)){
                                name.focus();
                                window.alert(error+'Name');
                                return false;
                }
                if(!isValidEmail(email)){
                                email.focus();
                                window.alert(error+'Email Address');
                                return false;
                }
                
                return true;
}
