function hide_email(print_name,email_name,email_address) { document.write('<a href=\"mailto:' + email_name + '@' + email_address + '\">' + print_name + '</a>');
}
function checkall(){
  for(i=0;i<document.foo.length;i++){
    if(document.foo.elements[i].type=="checkbox"){
      if(document.foo.elements[i].name!="radioOff"){
      document.foo.elements[i].checked = true;
	  }
    }
  }
}
function uncheckall(){
  for(i=0;i<document.foo.length;i++){
    if(document.foo.elements[i].type=="checkbox"){
      document.foo.elements[i].checked = false;
    }
  }
}
function formVal(){
  chk  = document.foo.support.checked;
  phint  = document.foo.phint.value;
  rews = new RegExp("^ +","g")
  phint = phint.replace(rews, "");
  if(!chk){ 
    alert("Please make sure to agree to our conditions.")
    return false;
  }
  else{
   if(phint.length == 0|| phint == null || phint ==""){
     alert("Please supply a password hint.");
     return false;
   }
   else{
     return true;
   }
   return true;
  }
}// end fn formVal
var tblname
function addRowToTable(tblname){
  var tbl = document.getElementById(''+tblname+'');
  var lastRow = tbl.rows.length;
  var iteration = lastRow-1;
  var row = tbl.insertRow(lastRow-1);
  if(lastRow<7){
    var cellRight = row.insertCell(0); 
	
    for(i=0;i<9;i++){
      var el = document.createElement('input');
      var brk = document.createElement('br');
      var pg = document.createElement('p');
      el.setAttribute('type', 'text');
      if(i==0){ 
	    el.setAttribute('size', '4');	
        el.setAttribute('name', 'pyear_' + iteration);
		tn=document.createTextNode('Year ')
	  }
      else if(i==1){ 
	    el.setAttribute('size', '36');	
	    el.setAttribute('name', 'author_' + iteration);
		tn=document.createTextNode(' Author(s) ')
	  }
      else if(i==2){ 
	    el.setAttribute('size', '36');
	    el.setAttribute('name', 'title_' + iteration);
				tn=document.createTextNode('Title (article or book) ')
	  }
      else if(i==3){ 
	    el.setAttribute('size', '36');	
	    el.setAttribute('name', 'publication_' + iteration);
				tn=document.createTextNode(' Publication ')
	  }
      else if(i==4){ 
	    el.setAttribute('size', '36');	
	    el.setAttribute('name', 'publisher_' + iteration);
				tn=document.createTextNode(' Publisher ')
	  }		    
	  else if(i==5){ 
	    el.setAttribute('size', '16');	
	    el.setAttribute('name', 'location_' + iteration);
				tn=document.createTextNode(' Location ')
	  }
      else if(i==6){ 
	    el.setAttribute('size', '1');	
	    el.setAttribute('name', 'volume_' + iteration);
				tn=document.createTextNode(' Volume ')
	  }
      else if(i==7){ 
	    el.setAttribute('size', '1');	
	    el.setAttribute('name', 'issue_' + iteration);
				tn=document.createTextNode(' Issue ')
	  }
      else if(i==8){ 
	    el.setAttribute('size', '4');	
	    el.setAttribute('name', 'pp_' + iteration);
		tn=document.createTextNode(' Pp ')
	  }
      cellRight.appendChild(tn);
	  cellRight.appendChild(el);
	  if(i==1||i==2||i==3||i==4||i==5){	  cellRight.appendChild(brk);}
      if(i==8){	  cellRight.appendChild(pg);}
    }// end for
	     

  }//end if
  else{
    alert("You've already added your 5 publications.");
    return false;
  }
}// end fn adrow2tbl