function pop() {
	var s = ss.split('/');
	s = s[s.length-1].split('_');
	s = s[s.length-1].split('.')[0];
	popUp('/games/popup_screen.php?s='+ssname+';'+s+';'+num_ss,640,400,true,false,'resizable=yes');
}

function login() {
	alert('You must be a logged in to use this function. Please register in the forum.');
}

function subdir(s) {
	var h = '0abcdefghijklmnopqrstuvwxyz';
	var n = h.indexOf(s.toLowerCase().substr(0,1));
	if (n < 0) n = 0;
	return h.substr(n,1) + '/';
}

function swapCover(covers,w,h,ident) {
	coverLocation = "view_cover.php?gameID=" + gameid + "&ID=" + ident;
	document.images.imgCover.src = gfxpath + "/covers/thumbs/" + subdir(covers) +covers + "_thumb.jpg";
	document.images.imgCover.width = w;
	document.images.imgCover.height = h;
}

function checkForm(form) {
	if (form.name.value.length < 3) {
		 alert ("You must type atleast 3 characters!");
		form.name.focus();
		return false;
	}
	return true;
}

var countVote = 0;
function submitIt() {
	countVote++;
	if (countVote > 1) {
		alert('One vote is enough, alright?');
	} else {
		document.vote.submit();
	}
}

function sid(id) {
	document.getElementById("musicDiv").innerHTML = '\
<table bgcolor="#75a1ec" cellpadding=4 cellspacing=0 border=0 width=514 style="border-top-color: black; border-top-style: solid; border-top-width: 1px;">\
 <tr><td><table bgcolor="#4137cd" cellpadding=4 cellspacing=0 border=0 width="100%">\
  <tr>\
   <td width="360">\
    <applet name="jsidplay" code="com.dreamfabric.jsidplay.JSIDPlay" archive="/music/jsidplay/jsidplay.jar" WIDTH="360" HEIGHT="16" MAYSCRIPT>\
    <param name="background-color" value="4137cd"><param name="foreground-color" value="75a1ec">\
    <param name=codebase value="/music/jsidplay/">\
    <param name="playsid" value="../download.php?sid='+id+'">\
    <param name="scroll-size" value="45">\
   <\/applet><br><\/td>\
   <td align=right class="sid">\
    <img src="/music/gfx/previous_song.gif" onclick="javascript:document.jsidplay.previousSong();">\
    <img src="/music/gfx/play.gif" onclick="javascript:document.jsidplay.play();">\
    <img src="/music/gfx/pause.gif" onclick="javascript:document.jsidplay.pause();">\
    <img src="/music/gfx/next_song.gif" onclick="javascript:document.jsidplay.nextSong();">\
   <\/td>\
  <\/tr>\
 <\/table><\/td><\/tr>\
<\/table>';
}

function pic() {
 var pics=document.getElementsByTagName('img');
 for (i=0;i<pics.length;i++){
  if (pics[i].className=='pic'){
   pics[i].onclick=function(){ss = this.src; document.getElementById('screen').style.backgroundImage = "url(" + ss +")";}
   pics[i].ondblclick=function(){pop();}
   pics[i].onmouseover=function(){document.getElementById('screenimg').setAttribute('src',this.src)}
   pics[i].onmouseout=function(){document.getElementById('screenimg').setAttribute('src','/gfx/0.gif')}
   pics[i].title="Click for full size. Double Click for x2 size.";
  }
 }
}

