function Donate(){
Money = GrabRPGSetting('Money',RPGData, 0)
Content = "
Donar Dinero a otro miembro"
Content += ""
BuildRPGDisplay("RPG Donate Money", Content);
}
function searchMem(){
document.getElementById('searchBut').disabled = true
document.getElementById('searchBut').value = 'Searching...'
window.frames['frameSearch'].location.href = url + '?act=Members&name_box=contains&name=' + document.getElementById('memsearch').value
}
function doWhat(){
if(window.frames['frameSearch'].location.href.match("Members")){
showSearchResults()
} else if(window.frames['frameSearch'].location.href.match("showuser")){
verifyDonation()
} else if(window.frames['frameSearch'].location.href.match("Msg&CODE=01")){
DonationSent()
}
}
function showSearchResults(){
if(window.frames['frameSearch'].location.href.match("Members")){
Page = window.frames['frameSearch'].document
UserFound = []
Div = Page.getElementsByTagName('div')
for(d=0;d 0){
UserChoose = ""
for(u=0;u"+UserFound[u][1]+""
}
UserChoose = ""
document.getElementById('searchShow').cells[0].innerHTML = "Selecciona a quien quieres donar: " + UserChoose
document.getElementById('searchShow').cells[1].innerHTML = "Ingresa la cantidad a donar: "
document.getElementById('compileButton').innerHTML = ""
document.getElementById('donateTXT').innerHTML = "Donate"
} else {
alert("Tu busqueda produjo 0 resultados")
document.getElementById('searchBut').disabled = false
document.getElementById('searchBut').value = 'Find Member'
}
}
}
function doDonate(){
Amount = parseInt(document.getElementById('to_donate').value)
Too = document.getElementById('user_choose').options[document.getElementById('user_choose').options.selectedIndex].value
if(Amount == "" || Amount < 1 || isNaN(Amount)){
alert("Invalid Donation Amount Input")
return false
}
if(Amount > Money){
alert("Estas intentando donar mas de lo que tienes!")
} else {
document.getElementById('donateButton').disabled = true
document.getElementById('donateButton').value = 'Verifying Donation...'
window.frames['frameSearch'].location.href = Too
}
}
function verifyDonation(){
Page = window.frames['frameSearch'].document.body
if(Page.innerHTML.match("Lo sentimos pero no pudimos encontrar a ese usuario")){
alert("Donation Failed, Please Re-Try")
document.getElementById('donateButton').disabled = false
document.getElementById('donateButton').value = 'Donate'
} else {
User = document.getElementById('user_choose').options[document.getElementById('user_choose').options.selectedIndex].innerHTML
PMSend = "http://s14.invisionfree.com/Hitokiri/index.php?act=Msg&CODE=04&MODE=01&entered_name="+User+"&msg_title=Donación de dinero!&Post=[Donation:"+Amount+"]"
window.frames['frameSearch'].location.href = PMSend
}
}
function DonationSent(){
alert("Donación realizada satisfactoriamente")
RPGData = SwapRPGSetting('Money', RPGData, (Money - Amount))
ReBuildData(RPGData)
}
function RecieveDonation(){
Span = document.getElementsByTagName('span')
url=location.href.split('/')[4];
url=location.href.replace(url,'')
if(url.charAt(url.length-1)!= '/'){
url = url + '/'
}
for(s=0;s "+MoneyName+"! "
}
}
}
}
document.loaded = 0
function doWhatEh(){
url=location.href.split('/')[4];
url=location.href.replace(url,'')
if(url.charAt(url.length-1)!= '/'){
url = url + '/'
}
if(document.loaded != 0){
alert("Fondos recibidos satisfactoriamente")
if(location.href.match(/act=Msg&CODE=(\d+)&VID=in&MSID=(\d+)/)){
MsgID = RegExp.$2
}
location.href = url+'index.php?CODE=05&act=Msg&MSID='+MsgID+'&VID=in'
}
document.loaded++
}
function getFunds(){
NewMoney = parseInt(GrabRPGSetting('Money',window.frames['donateFrame'].RPGData,0)) + parseInt(document.getElementById('theMoney').innerHTML)
newData = window.frames['donateFrame'].SwapRPGSetting('Money',window.frames['donateFrame'].RPGData,NewMoney)
window.frames['donateFrame'].ReBuildData(newData)
}
if(location.href.match(/act=Msg&CODE=(\d+)&VID=in&MSID=(\d+)/)){
RecieveDonation()
} else {
Donate()
}