function onLoad()
{
	if(window.jsUpdateAP)
		setTimeout("jsUpdateAP()", 1000);
}

function helpOnload()
{
	help_init();
}

function helpCallback(index)
{
	parent.data.location="helpdata.php?index="+(index-1);
}

function help()
{
	openWindow("help.php", "goth_help", 760, 570, ", status, resizable");
}

function viewnpcstats(id)
{
	openWindow("viewstats.php?type=npc&id="+id, "goth_npc_stats", 336, 400, ", scrollbars");
}

function forgotpass()
{
	openWindow("forgotpass.php", "goth_forgotpass", 336, 400, ", scrollbars");
}

function viewplayerstats(id)
{
	openWindow("viewstats.php?type=player&id="+id, "goth_player_stats", 820, 550, ", scrollbars");
}

function viewshop(id)
{
	openWindow("viewshop.php?id="+id, "goth_shop", 336, 400, ", scrollbars");
}

function viewinventory(id, hideavatar)
{
	if(hideavatar==1)
		openWindow("viewinventory.php?PHPSESSID="+id, "goth_inventory", 355, 400, ", scrollbars");
	else
		openWindow("viewinventory.php?PHPSESSID="+id, "goth_inventory", 810, 550, ", scrollbars");
}

function toggleequipstate(id, index)
{
	window.location='viewinventory.php?toggle='+id+'&index='+index;
}

function attacknpc(id)
{
	window.location='index.php?cmd=attacknpc&id='+id;
}

function healing(id)
{
	window.location='index.php?cmd=healing';
}

function viewmessagehistory(id)
{
	openWindow("viewmessagehistory.php?id="+id, "goth_messagehistory", 336, 400, ", scrollbars");
}

function levelup(id)
{
	openWindow("levelup.php?PHPSESSID="+id, "goth_player_stats", 336, 400, ", scrollbars");
}

function learnskill(id)
{
	window.location='index.php?cmd=learnskill&id='+id;
}

function bonusxp(id)
{
	openWindow("linktous.php?id="+id, "goth_linktous", 336, 400, ", scrollbars");
}

function toprated()
{
	openWindow("toprated.html", "goth_toprated", 475, 400, ", scrollbars");
}

function changepassword()
{
	openWindow("changepassword.php", "goth_changepassword", 336, 400, ", scrollbars");
}

function news(id)
{
	openWindow("news.php?id="+id, "goth_news", 336, 400, ", scrollbars");
}

function steal(id)
{
	window.location='index.php?cmd=steal&id='+id;
}

function creaturesteal(id)
{
	window.location='index.php?cmd=creaturesteal&id='+id;
}

function whydonate()
{
	openWindow("whydonate.php", "goth_whydonate", 336, 400, ", scrollbars");
}

function usescroll(id, index)
{
	window.location='viewinventory.php?t=1&useid='+id+'&index='+index+'&q=1';
}

function reaperspecial()
{
	openWindow("reaperspecial.php", "goth_reaperspecial", 336, 400, ", scrollbars");
}

function usestairs(id)
{
	window.location='index.php?cmd=usestairs&id='+id;
}

function raretrader(id)
{
	window.location='index.php?cmd=raretrader&id='+id;
}

function cults(id)
{
	openWindow("cults.php?id="+id, "goth_cults", 630, 400, ", scrollbars");
}

function cults_norefresh(id)
{
	openWindow("http://www.gothador.com/cults.php?id="+id+"&norefresh=1", "goth_cults", 630, 400, ", scrollbars");
}

function cults_changeimage(id)
{
	openWindow("cults_changeimage.php?id="+id+"&type=0", "goth_changeimage", 336, 400, ", scrollbars");
}

function cults_changesymbol(id)
{
	openWindow("cults_changeimage.php?id="+id+"&type=1", "goth_changeimage", 336, 400, ", scrollbars");
}

function cults_confirmkick(id, alias)
{
	if(confirm('Are you sure you wish to kick \''+alias+'\' from your cult?'))
	{
		window.location='cults.php?cmd=kick&id='+id;
	}
}

function cults_changerole(id)
{
	openWindow("cults_changerole.php?id="+id, "goth_changerole", 336, 400, ", scrollbars");
}

function cults_invitepopup(id)
{
	openWindow("cults_invitepopup.php?id="+id, "goth_invitepopup", 336, 400, ", scrollbars");
}

function cults_advancedpopup(id)
{
	openWindow("cults_advancedpopup.php?id="+id, "goth_advancedpopup", 336, 400, ", scrollbars");
}

function rechargemana(id)
{
	window.location='index.php?cmd=rechargemana&id='+id;
}


function cults_viewhistory(id)
{
	openWindow("cults_viewhistory.php?id="+id, "goth_viewhistory", 336, 400, ", scrollbars");
}


function cults_invite(id)
{
	window.location='index.php?cmd=cults_invite&id='+id;
}

function cults_acceptinvite(id)
{
	if(confirm('Are you sure you wish to join this cult?'))
	{
		window.location='cults.php?cmd=acceptinvite&inv_id='+id;
	}
}

function cults_declineinvite(id)
{
	if(confirm('Are you sure you wish to decline this invitation?'))
	{
		window.location='cults.php?cmd=declineinvite&inv_id='+id;
	}
}

function cults_leave()
{
	if(confirm('Are you sure you wish to leave/abandon this cult?'))
	{
		window.location='cults.php?cmd=leave';
	}
}

function supportgothador()
{
	window.location='index.php?cmd=supportgothador';
}

function supportsigmastorm()
{
	window.location='index.php?cmd=supportsigmastorm';
}

function showtopratedx(opt)
{
	openWindow("toprated.php?opt="+opt, "goth_toprated"+opt, 336, 400, ", scrollbars");
}

function showtopratedx2(opt)
{
	openWindow("toprated.php?opt="+opt, "goth_toprated"+opt, 450, 400, ", scrollbars");
}

function viewquestbook(id)
{
	openWindow("questbook.php?id="+id, "goth_questbook", 370, 490, "");
}

function doquestaction(id)
{
	window.location='index.php?cmd=doquestaction&id='+id;
}

function bloodsuck_npc(id)
{
	window.location='index.php?cmd=bloodsucknpc&id='+id;
}

function bloodsuck(id)
{
	window.location='index.php?cmd=bloodsuck&id='+id;
}

function mine(id, mult)
{
	window.location='index.php?cmd=mine&id='+id+'&mult='+mult;
}

function forage(id, mult)
{
	window.location='index.php?cmd=forage&id='+id+'&mult='+mult;
}

function smelt(id, mult)
{
	window.location='index.php?cmd=smelt&id='+id+'&mult='+mult;
}

function forge(id)
{
	openWindow("forge.php?id="+id, "goth_forge", 336, 400, ", scrollbars");
}

function pvp(id)
{
	window.location='index.php?cmd=pvp&id='+id;
}

function boostap(id)
{
	openWindow("boostap.php?id="+id, "goth_boostap", 336, 400, ", scrollbars");
}

function community(session)
{
	openWindow("community.php?PHPSESSID="+session, "goth_community", 336, 400, ", scrollbars");
}

function healother(id)
{
	window.location='index.php?cmd=healother&id='+id;
}

function hurt(id)
{
	window.location='index.php?cmd=hurt&id='+id;
}

function hurt_npc(id)
{
	window.location='index.php?cmd=hurtnpc&id='+id;
}

function mix(id)
{
	openWindow("mix.php?id="+id, "goth_mix", 336, 400, ", scrollbars");
}

function magicres()
{
	openWindow("magicres.php", "goth_magicres", 336, 400, ", scrollbars");
}

function assignspell(id, session)
{
	openWindow("quickspell.php?id="+id+"&PHPSESSID="+session, "goth_quickspell", 336, 400, ", scrollbars");
}

function spellbook(session)
{
	openWindow("spellbook.php?PHPSESSID="+session, "goth_questbook", 370, 490, "");
}

function cast(id, session)
{
	openWindow("cast.php?id="+id+"&PHPSESSID="+session, "goth_cast", 336, 400, ", scrollbars");
}

function drop(id,session,index)
{
	window.location='viewinventory.php?cmd=drop&PHPSESSID='+session+'&player_item='+id+'&index='+index;
}

function securetrade(id, session)
{
	openWindow("securetrade.php?tid="+id+"&PHPSESSID="+session, "goth_securetrade", 336, 400, ", scrollbars");
}

function securegoldtrade(id, session)
{
	openWindow("securetrade_gold.php?tid="+id+"&PHPSESSID="+session, "goth_securegoldtrade", 336, 400, ", scrollbars");
}

function locatecreature(session)
{
	openWindow("locatecreature.php?PHPSESSID="+session, "goth_locatecreature", 336, 400, ", scrollbars");
}

function exchange(id, dir)
{
	window.location='index.php?cmd=exchange&id='+id+'&dir='+dir;
}




