function writeImgTag(code)
{
var cache = document.postreply.message.value;
this.code = code;
document.postreply.message.value = code;
document.postreply.message.focus();
}

function shopAlert(itemname, itemprice, url)
{
	var answer = confirm("Do you really want to buy a " + itemname + " for " + itemprice + " Mistic Cash?");
	if (answer) { window.location = url; }
}
function updateCost()
{
  var costLabel = document.getElementById("MpCost");
  var pointAmmount = Math.abs(document.getElementById("PointAmmount").value);
  if (pointAmmount == null||costLabel == null) {
    alert("An error has occurred, please contact an administrator for assistance.");
  } else {
    var cost = new Number(pointAmmount*.06)
    costLabel.innerHTML = "$"+cost.toFixed(2);
  }
}

function selectAll(form, checked) {
  for(var i=0; i<form.length; i++) {
    form.elements[i].checked = checked;
  }
}

function popUp(URL) 
{
day = new Date();
id = day.getTime();
URL = URL.replace('&','-AND-');
URL = URL.replace('&','-AND-');
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 390,top = 150');");
}

function showHide(divid,linkid)
    {
    obj=document.getElementById(divid);
        
    if(obj.style.display=="none")
        { obj.style.display=""; linkid.innerHTML="Hide"; }
    else
        { obj.style.display="none"; linkid.innerHTML="Show"; } 
    }