<!--
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 notValidOrg( str ){
    orgRE = new RegExp( )
    orgRE.compile( '^[\.0-9]{10}$', 'gi' );
    return !(orgRE.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 D-namn text field is empty. This field has name "name".
    if( isEmpty( form.Domän ) ){
        alert( 'You must enter a domain name, without www & .se' );
        return false;
    }

    //lets check if Namntyp text field is empty. This field has name "name".
    if( isEmpty( form.Namn ) ){
        alert( 'You must enter your name or company name' );
        return false;
    }
	
    //lets check if Adress text field is empty. This field has name "name".
    if( isEmpty( form.Adress ) ){
        alert( 'You must enter your address' );
        return false;
    }

    //lets check if Postnummer text field is empty. This field has name "name".
    if( isEmpty( form.Postnummer ) ){
        alert( 'You must enter a post code' );
        return false;
    }

    //lets check if Postort text field is empty. This field has name "name".
    if( isEmpty( form.Postort ) ){
        alert( 'You must enter a city' );
        return false;
    }

    //lets check if Personnummer text field is empty. This field has name "name".
    if( isEmpty( form.Personnummer ) ){
        alert( 'You must enter an identification number' );
        return false;
    }

    //lets check if Telefon text field is empty. This field has name "name".
    if( isEmpty( form.Telefon ) ){
        alert( 'You must enter a phone number' );
        return false;
    }

    //now let's check if E-post is correct. This field name is "email"
    if( notValidEmail( form.Email ) ){
        alert( 'You must enter a valid email address' );
        return false;
    }

    //now let's check if Villkor is checked. This field name is "subscribe"
    if( notChecked( form.Villkor ) ){
        alert( 'You  must accept our terms and conditions' );
        return false;
    }

    return true;
} 
//-->