function init() {
}

function noSpam(user, domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}
  
function winopen(url,stuff,morestuff) {
	window.open(url,stuff,morestuff) ;
}

function isValidType( oInput, oType ) {
	switch( oType.toLowerCase() ) {
		case 'select':
			return oInput.selectedIndex;
		case 'number':
			if( !oInput.value ) { return false; }
			for( var mXi = 0; mXi < oInput.value.length; mXi++ ) {
				if( oInput.value.charAt( mXi ) != '' + parseInt( oInput.value.charAt( mXi ) ) + '' ) { return false; }
			} return true;
		case 'name':
			return ( oInput.value && !oInput.value.replace( /[a-záàäçéèêñóòôöüæøå]+( ?[-']?[a-záàäçéèêñóòôöüæøå]+)*/i, "" ) );
		case 'email':
			return ( oInput.value && !oInput.value.replace( /[\w\-\+]+(\.[\w\-\+]+)*@([\w\-áàäçéèêñóòôöüæøå]+\.)+[a-z]+/i, "" ) );
	}
}

function checkForm( oForm ) {
	if( !isValidType( oForm.realname, 'name' ) ) {
		window.alert( 'You have not given a valid name.' );
		return false;
	}
	if( !isValidType( oForm.email, 'email' ) ) {
		window.alert( 'You have not given a valid email address.' );
		return false;
	}
	return true;
}
