
function calckg(pounds){
var kg;

if (pounds > 0){
kg = Math.floor((pounds / 2.2)+1);
kgS = String(kg);
kgS = kgS.substr(0,3);
document.appform._fid_382.value = kgS;
}
}

function calccm(inches){
var cm;

if (inches > 0){
cm = Math.floor((inches * 2.54)+1);
cmS = String(cm);
cmS = cmS.substr(0,3);
document.appform._fid_381.value = cmS;
}
}

function clearIt(theForm)
{
      document.appform.username.value=""
	  document.appform.password.value=""
}

function calcpexd(pexyear){
var pexd = new String();
pexd = document.appform.pexmonth.options[appform.pexmonth.selectedIndex].text   + "/" + document.appform.pexday.options[appform.pexday.selectedIndex].text  +"/" + pexyear;
document.appform._fid_142.value = pexd;
//window.alert(pexd);
}

function calcbd(bdyear){
var bd = new String();
bd = document.appform.bdmonth.options[appform.bdmonth.selectedIndex].text   + "/" + document.appform.bdday.options[appform.bdday.selectedIndex].text  +"/" + bdyear;
document.appform._fid_74.value = bd;
}	

function validateForm(theForm){

if (theForm._fid_290.options[theForm._fid_290.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Role\" field.");
    theForm._fid_290.focus();
    return (false);
  }

if (theForm._fid_360.options[theForm._fid_360.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Gender\" field.");
    theForm._fid_360.focus();
    return (false);
  }


if (theForm._fid_18.value == "")
  {
    alert("Please enter a value for the \"First (Given) Name\" field.");
    theForm._fid_18.focus();
    return (false);
  }

if (theForm._fid_6.value == "")
  {
    alert("Please enter a value for the \"Last (Family) Name\" field.");
    theForm._fid_6.focus();
    return (false);
  }

if (theForm._fid_292.value == "")
  {
    alert("Please enter a value for the \"Badge Name\" field.");
    theForm._fid_292.focus();
    return (false);
  }

if (theForm._fid_10.value == "")
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm._fid_10.focus();
    return (false);
  }

if (theForm._fid_155.options[theForm._fid_155.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Country of Residence\" field.");
    theForm._fid_155.focus();
    return (false);
  }

//if (theForm._fid_140.options[theForm._fid_140.selectedIndex].text == "-")
//  {
//    alert("Please select a value for the \"Country Issuing Passport\" field.");
//    theForm._fid_140.focus();
//    return (false);
//  }

//if (theForm._fid_206.value == "")
//  {
//    alert("Please enter a value for the \"Passport Number\" field.");
//    theForm._fid_206.focus();
//    return (false);
//  }

//if (theForm.pexyear.options[theForm.pexyear.selectedIndex].text == "--")
//  {
//    alert("Please complete the value for the \"Passport Expiration Date\" field.");
//    theForm.pexyear.focus();
//    return (false);
//  }

if (theForm.bdyear.value == "----")
  {
    alert("Please complete the value for the \"Birthdate\" field.");
    theForm.bdyear.focus();
    return (false);
  }

if (theForm._fid_138.options[theForm._fid_138.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Primary Language\" field.");
    theForm._fid_138.focus();
    return (false);
  }

if (theForm._fid_190.options[theForm._fid_190.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Food Requirement\" field.");
    theForm._fid_190.focus();
    return (false);
  }

if (theForm._fid_382.value == "")
  {
    alert("Please select a value for the \"Weight\" field.");
    theForm._fid_382.focus();
    return (false);
  }

if (theForm._fid_381.value == "")
  {
    alert("Please select a value for the \"Height\" field.");
    theForm._fid_381.focus();
    return (false);
  }

if (theForm._fid_193.options[theForm._fid_193.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Clothing Size\" field.");
    theForm._fid_193.focus();
    return (false);
  }

if (theForm._fid_132.options[theForm._fid_132.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Faith or Religious Affiliation\" field.");
    theForm._fid_132.focus();
    return (false);
  }
  
if (theForm._fid_134.value == "")
  {
    alert("Please enter a value for the \"Religious Reference\" field.");
    theForm._fid_134.focus();
    return (false);
  }
  
if (theForm._fid_198.value == "")
  {
    alert("Please enter a value for the \"Emergency Contact\" field.");
    theForm._fid_198.focus();
    return (false);
  }

if (theForm._fid_414.options[theForm._fid_414.selectedIndex].text == "-")
  {
    alert("Please select a value for the \"Select a Sport\" field.");
    theForm._fid_414.focus();
    return (false);
  }
  
if (theForm._fid_133.value == "")
  {
    alert("Please enter a value for the \"Sport Reference\" field.");
    theForm._fid_133.focus();
    return (false);
  }
}


function mask(end,middle,start,subject)
{
	var one ='mai';
	var two='lto:';
	var three='?Subject=';
//start,middle,end,subject;
	var putogether= one+two+start+middle+end+three+subject;
	document.location.href=eval('"'+putogether+'"');
	window.status=putogether;
}

function newlang(pair)
{
	if (pair == "orig") 
	{
//	if (location.search.length > 0)
//    	eval('var ' + location.search.substring(1));
//	location.href = eval(url);
	parent.location.href = "http://www.ipsfestival.org/";
	return;
	}
var putogether = "http://babelfish.altavista.com/babelfish/tr?doit=done&url=" + this.location.href + "&lp=" + pair;
location.href = eval('"'+putogether+'"');
//window.status=putogether;
}