function xlaAFM_geturl(articleid,articletype) {
  var newurl='<%=appsettings.applicationurl%>?' + articletype + '=' + articleid;
  return newurl;
}

function xlaAFM_addtofavorites(articleid,articletype) {
  window.external.addFavorite( xlaAFM_geturl(articleid,articletype), document.title );
}

function xlaAFM_printarticle() {
  window.print();
}



/********************
 * Comments box
 */
function deletecomment(){
  if (document.getElementById("comment").value.indexOf('[Optional Comment]')==0)  document.getElementById("comment").value='';
}

function setrating(what){
  document.getElementById("rating").value=what;
}

function submitcomment(){
  if (document.getElementById("rating").value=='0'){
    alert('Please rate this article before submitting');
  } else {
    deletecomment();
    document.getElementById("commentsform").submit();
    document.getElementById("commentstable").innerHTML='<p><h4>Thank you for your feedback!</h4><p>We will evaluate it shortly and use it to help us improve our website.</p>';
  }
}



/********************
 * Search results
 */
function gopage(what){
  document.form1.action='afmsearch.aspx?whichpage=' + what;
  document.form1.submit();
}
