<!--
//*************************************************************************************************
// File:         util.js
//
// Description:  myretirementday.com javascript utility functions
//
// Created:      R.Lockwood  Jan '08
//*************************************************************************************************


//*************************************************************************************************
// Name:        imgref
//
// Description: create reference for toggling of navigation images
//
// Inputs:
//      ref     nav reference (e.g.; home, calc, plan, blog, res, about)
//      active  active/highlight flag (0, 1)
//      page    current page (e.g.: calculator.jsp)
//
// Created:     R.Lockwood  Jan '08
//*************************************************************************************************

function email(gameid,user){
ajaxpagefetcher.load(gameid,"/chess/email.php?gameid="+gameid+"&uid="+user,true)
}
function modify(gameid){
ajaxpagefetcher.load(gameid,"/chess/modifypgn.php?gameid="+gameid,true)
}
function deletegame(gameid){
var confirmed= window.confirm('Are you sure you wish to delete this game?')
if (confirmed){
var url = "/chess/editgame.php?gameid="+gameid+"&de="+confirmed
window.location=url
}
}
function send(gameid,uid){
var mess = document.def.mess.value
mess= encodeURIComponent(mess)
var to = document.def.to.value
to= encodeURIComponent(to)
var reto = document.def.reto.value
reto= encodeURIComponent(reto)
var tosel = document.def.tosel.value
tosel= encodeURIComponent(tosel)
ajaxpagefetcher.load(gameid, '/chess/email.php?tosel='+tosel+'&mess='+mess+'&add='+to+'&reto='+reto+'&uid='+uid+'&gameid='+gameid,true)
}
function addemail(){
var ex = document.def.to.value
var ne = "{"+document.def.tosel.value+"}"
if (ne){
if (ex){document.def.to.value=ex+' , '+ne
}else{
document.def.to.value = ne
}}
}

-->

