function setTR(){
 if(navigator.appName=="Netscape"){
  document.getElementById('top_ret').style.left = 3;
  document.getElementById('top_ret').style.width = 140;
  document.getElementById('top_ret').style.height = 16;
 }
 document.getElementById('top_ret').style.top = document.body.clientHeight - 60 + document.body.scrollTop;
 x = document.getElementById('top_ret').style.top;
 x = x.replace(/px/g,'');
 if(x < 380){ x = 380; }
 document.getElementById('top_ret').style.top = x;
}

function doAllActions(){
 //Reset Item Number
 designPackage = document.forms[0].elements['item_name'].selectedIndex; itemNum = designPackage + 2; document.forms[0].elements['item_number'].value = itemNum;
 //Do Amount
 currency = document.forms[0].elements['currency_code'].value;
 if(designPackage==0){ toPay="10.00"; if(currency=="EUR"){ toPay = "14.50"; } if(currency=="CAD"){ toPay = "23.10"; } if(currency=="USD"){ toPay = "15.70"; } if(currency=="JPY"){ toPay = "1,86"; } }
 if(designPackage==1){ toPay="15.00"; if(currency=="EUR"){ toPay = "21.80"; } if(currency=="CAD"){ toPay = "34.60"; } if(currency=="USD"){ toPay = "23.50"; } if(currency=="JPY"){ toPay = "2,795"; } }
 if(designPackage==2){ toPay="20.00"; if(currency=="EUR"){ toPay = "29.10"; } if(currency=="CAD"){ toPay = "46.10"; } if(currency=="USD"){ toPay = "31.30"; } if(currency=="JPY"){ toPay = "3,726"; } }
 if(designPackage==3){ toPay="30.00"; if(currency=="EUR"){ toPay = "43.60"; } if(currency=="CAD"){ toPay = "69.20"; } if(currency=="USD"){ toPay = "47.00"; } if(currency=="JPY"){ toPay = "5,589"; } }
 document.forms[0].elements['amount'].value=toPay;
}

function css6(){
 win3 = window.open('/css/zindex.html','win3','height=150,width=250');
}

function loadAdmin(){
 adminWin = window.open('/cgi-bin/trcpanel.pl','adminWin','height=350,width=600,scrolling=no');
 adminWin.moveTo((screen.width-600)/2,(screen.height-350)/2);
}

function wotsthis(id){
 if(id == 0){ alert('Please make sure you memorise this password. You will need it to see if your account has been set up and collect your initial POP password (if applicable). Keep it in a safe place.\nTo see if your account has been set up, click on \'Free E-Mail\' on the left and then select \'Check Status\', enter your e-mail address and password.'); }
 if(id == 1){ alert('Simply re-enter your password so that you are sure you know it. If you forget it, you may not be able to collect your initial log in details without e-mailling Support'); }
}

function checkPwds(){
 pw_one = document.forms[1].elements['pword'].value;
 pw_two = document.forms[1].elements['pword2'].value;
 if(pw_one != pw_two){
  alert('Your two password fields do not match up. Please go back and re-enter them.\nFor your convenience these fields will be blanked automatically.');
  document.forms[1].elements['pword'].value = "";
  document.forms[1].elements['pword2'].value = "";
  document.forms[1].elements['pword'].focus();
 }
}

function checkAvail(){
 if(document.forms[1].elements['trc_address'].value != ""){
  alert('A small window will shortly load to check the availability of \'' + document.forms[1].elements['trc_address'].value + '\'.\nIf it is not, please select another option from the drop-down list.');
 }
 else{
  alert('Error: No E-Mail address created.');
 }
}

function mkAddy(){
 f_name = document.forms[1].elements['first_name'].value;
 l_name = document.forms[1].elements['last_name'].value;
 at = document.forms[1].elements['em_end'].value;
 if(f_name != "" && l_name != ""){
  part_one = f_name.substring(0,1);
  new_email = part_one + '.' + l_name + at;
  new_email = new_email.toLowerCase();

  // create initial.last_name address
  document.forms[1].elements['trc_address'].options[0].value = new_email;
  document.forms[1].elements['trc_address'].options[0].text = new_email;

  // create last_name.initial address
  new_email = l_name + '.' + part_one + at;
  new_email = new_email.toLowerCase();
  document.forms[1].elements['trc_address'].options.addnew(1);
  document.forms[1].elements['trc_address'].options[1].value = new_email;
  document.forms[1].elements['trc_address'].options[1].text = new_email;
 }
}

function brFixes(){
 if(navigator.appName == "Opera"){
  if(document.getElementById('srv')){
   document.getElementById('srv').style.width = "143";
  }
  if(document.getElementById('inf')){
   document.getElementById('inf').style.width = "143";
  }
  if(document.getElementById('htt')){
   document.getElementById('htt').style.width = "143";
  }
  if(document.getElementById('jsc')){
   document.getElementById('jsc').style.width = "143";
  }
  if(document.getElementById('tut')){
   document.getElementById('tut').style.width = "143";
  }
  if(document.getElementById('ass')){
   document.getElementById('ass').style.width = "143";
  }
  if(document.getElementById('dnl')){
   document.getElementById('dnl').style.width = "143";
  }
  if(document.getElementById('css')){
   document.getElementById('css').style.width = "143";
  }
 }
}