function isEmpty(inputStr) {
    var i=0 ;
    var outStr="" ;
    var inStr=inputStr ;

    for ( var i=0; i<inStr.length; i++ ) {
        if (inStr.charAt(i) != ' ') outStr+=inStr.charAt(i) ;
    }
    if (outStr==""|| outStr==null) 
        return true ;
    else
        return false ;  
}

function validateForm() {
	var missingCount = 0;
	var missing = new Array();
	var msg = '';
	var error = '';
	
	if ( isEmpty(document.workshopInformation.workshop.value) ) {
		missing[missingCount] = 'workshop\n';
		missingCount = missingCount + 1;
	}
	
	if ( isEmpty(document.workshopInformation.name.value)) {
		missing[missingCount] = 'name\n';
		missingCount = missingCount + 1;
	}
	
	if ( isEmpty(document.workshopInformation.email.value) ) {
		missing[missingCount] = "email\n";
		missingCount = missingCount + 1;
	}
	
	if ( isEmpty(document.workshopInformation.phone.value) ) {
		missing[missingCount] = 'phone\n';
		missingCount = missingCount + 1;
	}
	
	if ( isEmpty(document.workshopInformation.company.value) ) {
		missing[missingCount] = 'company\n';
		missingCount = missingCount + 1;
	}
	
	
	
	if (missing.length >= 1 || error != '') {
		if (missing.length >= 1) {
			msg = 'The following fields must be completed:\n';
		}

		for(var i=0; i < missing.length; i++) {
			msg = msg + missing[i];
		}
		
		if (error != '') {
			if( msg != '' ) {
				msg	= msg + '\n';
				
			}
			msg = msg + 'Please fix the following erros:\n';
			msg = msg + error;
		}

		alert(msg);
		return( false );
	} else {
		return( true );
		
	}
}