function submitform() {
  var errorMsg = "Unable to send your feedback :\n"; // default error message
  var errorReason = ""; // to hold actual error reasons
	var focusItem = "";   // to hold name of input to focus on

  // check user has a name
  if ( document.forms['feedback'].name.value=="" ) {
    errorReason += "  * You have not entered your name\n";
		focusItem = "name";
  }

  // check that the email is valid
  if (document.forms['feedback'].email.value=="" || InvalidEmail(document.forms['feedback'].email.value)) {
    errorReason += "  * Your email address is not valid\n";
		if ( focusItem == "" ) focusItem = "email";
  }

	// check user has selected a subject
  if ( document.forms['feedback'].type.value=="" ) {
    errorReason += "  * You have not selected a subject\n";
		if ( focusItem == "" ) focusItem = "type";
  }

	// check user has entered a comment
  if ( document.forms['feedback'].comment.value=="" ) {
    errorReason += "  * You have not entered a comment\n";
		if ( focusItem == "" ) focusItem = "comment";
  }

  // if there are any errors display them, otherwise submit the form
  if (!(errorReason=="" )) {
    alert(errorMsg + errorReason);
		eval("document.forms['feedback']." + focusItem + ".focus()");
    return false;
  } else {
    return true;
  }
}

function display(type) {
	document.getElementById('palm_subtype').style.display = (type=='palm') ? 'inline' : 'none';
	document.getElementById('ppc_subtype').style.display = (type=='ppc') ? 'inline' : 'none';
	document.getElementById('wmsp_subtype').style.display = (type=='wmsp') ? 'inline' : 'none';
	document.getElementById('win_subtype').style.display = (type=='win') ? 'inline' : 'none';
	document.getElementById('s60_subtype').style.display = (type=='s60') ? 'inline' : 'none';
	document.getElementById('bb_subtype').style.display = (type=='bb') ? 'inline' : 'none';
	document.getElementById('iphone_subtype').style.display = (type=='iphone') ? 'inline' : 'none';

	if (type=='palm' || type=='ppc' || type=='wmsp' || type=='win' || type=='s60' || type=='bb' ||
	    type=='iphone')
	{
		var tableRowDisplay = (navigator.appVersion.indexOf("MSIE") != -1) ? 'block' : 'table-row';
		document.getElementById('orderidRow').style.display = tableRowDisplay;
		document.getElementById('orderdateRow').style.display = tableRowDisplay;
		document.getElementById('devicetypeRow').style.display = tableRowDisplay;
	}
	else
	{
		document.getElementById('orderidRow').style.display = 'none';
		document.getElementById('orderdateRow').style.display = 'none';
		document.getElementById('devicetypeRow').style.display = 'none';
	}
	
	if (type == 'transferemail')
	{
		document.getElementById('commentLabel').innerHTML = 'Old email addresses:'
	}
	else
	{
		document.getElementById('commentLabel').innerHTML = 'Comment:'
	}
}