function numsort(a,b)	{return a-b;}
function trim(str)	{if(typeof(str)!="string") return str; else return str.replace(/^\s+|\s+$/g,"");}
function htmlmask(s)	{f=new Array(/&/g,/</g,/>/g,/'/g,/"/g); t=new Array("&amp;","&lt;","&gt;","&#039;","&quot;"); for(i in f) s=s.replace(f[i],t[i]); return s;}
function PageName()
	{
	page="/"+location.pathname.replace(/\\/g,"/");
	return page.substring(page.lastIndexOf("/")+1,page.lastIndexOf("."));
	}
function ScreenShot(screenshotname)
	{
	screenshotwin=window.open("screenshot.php?"+screenshotname,"screenshotwin","width=420,height=420,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,status=no,dependent=yes");
	if(screenshotwin.closed==false) screenshotwin.focus();
	}
function ShowPSXcode(code)
	{
	str="";
	matchcode="|l|r|o|u|v|k|d|x|l1|l2|r1|r2|st|se|";
	lastcode=false;
	code=code.split("|");
	for(i=0;i<code.length;i++)
		{
		if(matchcode.indexOf("|"+code[i].toLowerCase()+"|")!=-1)	{if(lastcode) {str+=",";} str+="<IMG SRC=\"images/psxcode_"+code[i].toLowerCase()+".gif\" WIDTH=15 HEIGHT=13>"; lastcode=true;}
		else								{str+="<SPAN CLASS=\"psxcode\">"+code[i]+"</SPAN>"; lastcode=false;}
		}
	document.write(str+"&nbsp;&nbsp;");
	}
ImgData=new Array(
	"button_0",
	"button_act",
	"button_adv",
	"button_jum",
	"button_boa",
	"button_edu",
	"button_rac",
	"button_rpg",
	"button_sim",
	"button_spo",
	"button_str",
	"button_3d",
	"button_comp"
	);
ImgDyn=new Array();
for (i=0; i<ImgData.length; i++)
	{
	ImgDyn[ImgData[i]+"_act"]=new Image();	ImgDyn[ImgData[i]+"_act"].src="images/"+ImgData[i]+"_act.gif";
	ImgDyn[ImgData[i]+"_ovr"]=new Image();	ImgDyn[ImgData[i]+"_ovr"].src="images/"+ImgData[i]+"_ovr.gif";
	ImgDyn[ImgData[i]+"_pas"]=new Image();	ImgDyn[ImgData[i]+"_pas"].src="images/"+ImgData[i]+"_pas.gif";
	}
for(i=97;i<=122;i++)
	{
	c=String.fromCharCode(i);
	ImgDyn["button_"+c+"_act"]=new Image();	ImgDyn["button_"+c+"_act"].src="images/button_"+c+"_act.gif";
	ImgDyn["button_"+c+"_ovr"]=new Image();	ImgDyn["button_"+c+"_ovr"].src="images/button_"+c+"_ovr.gif";
	ImgDyn["button_"+c+"_pas"]=new Image();	ImgDyn["button_"+c+"_pas"].src="images/button_"+c+"_pas.gif";
	}
function ImgAct(obj)	{obj.src=ImgDyn[obj.id+"_act"].src;}
function ImgOvr(obj)	{obj.src=ImgDyn[obj.id+"_ovr"].src;}
function ImgPas(obj)	{obj.src=ImgDyn[obj.id+"_pas"].src;}
