function del_confirm(itm, qs, tbl) {//v1
  if (confirm("Are you sure you want to delete " + itm + " from " + tbl)) window.location.href = window.location.pathname+"?"+qs;
}

function textareaLimiter(field, maxlimit) {
  if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
}

//find the checked radio button and return the checked value.
function getSelectedRadio(radiogroup) {
  if (radiogroup.length) {
    for (i=0; i<radiogroup.length; i++) {
      if (radiogroup[i].checked) return radiogroup[i].value;
    }
  } else if (radiogroup.value) {
      return radiogroup.value;
  }
  return 0;
}

function getStrArrayVal(str, i) {
  var arr = str.split('~');
  return arr[i];
}

function setContainerHeight(offset, container) {
  if (window.innerHeight) document.getElementById(container).style.height = (window.innerHeight - offset) + 'px';
  else if (document.documentElement.clientHeight) document.getElementById(container).style.height = (document.documentElement.clientHeight - offset) + 'px';
}

//Escapes apostrophes.
function fixQuotes(strText) {
  strText = strText.replace("'", "\\'")
  return(strText);
}

/*function sendToAFriend()
{
  MM_openBrWindow('/pages/SendToAFriend.aspx?ref='+window.location.href,'SendToAFriend','scrollbars=yes,width=667,height=318');
}
*/
function sendToAFriend()
{
  var Url;	
  //var PageId = '';
  //var PageName = '';
  Url = window.location.href.split("/");
   /*for(var i=0;i<Url.length;i++) {
    alert("Item at " + i + " = " + Url[i]);
  }
  */
 // PageId = Url[4];
  //PageName = Url[5];
  MM_openBrWindow('/pages/SendToAFriend.aspx?r=' + Url[0] + '&dom=' + Url[2] + '&pid='+ Url[4] + '&pn=' + Url[5] ,'SendToAFriend','scrollbars=yes,width=667,height=468');
  Url = null;
  PageId = null;
  PageName = null;
}
