var sf = 'games'; function toggleDisplay(TDID){ var onoff; if(document.getElementById(TDID).style.display == 'block') {onoff = 'none';} else {onoff = 'block';} return onoff; } function showHide(TDID){ var onoff = toggleDisplay(TDID); document.getElementById(TDID).style.display = onoff; } function checkEnter(e){ var characterCode; if(e && e.which){ e = e; characterCode = e.which; } else{ e = event; characterCode = e.keyCode; } if(characterCode == 13){ doSearch(); } else{ return true } } function replace(string,text,by) { var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } function doSearch(){ searchWord = replace(document.getElementById('search').value,'/',' '); window.location='?search/'+sf+'/'+searchWord.replace(/ /g,'+')+'/:1'; } function resize(w,h){ document.getElementById('mediao').width=w; document.getElementById('mediae').width=w; document.getElementById('mediao').height=h; document.getElementById('mediae').height=h; } function formResolution(id) { document.getElementsByName(id)[0].value = screen.width + "x" + screen.height; }