verifiedElems=[] function clearDefaultandCSS(el) { if (el.defaultValue==el.value) el.value = "" // If Dynamic Style is supported, clear the style el.className="focused"; } function changeStyle(id, classn){ document.getElementById(id).className=classn; } function validateForm(elems){ //validates a form checking to make sure elems //with ids in elems list have been verified //we want to blur all focused elements first, otherwise //they won't be validated first! var arr = new Array(); arr = document.getElementsByTagName( "input" ); for(var i=0; i < arr.length; i++) { arr[i].blur(); } for(var k in elems){ if(!verifiedElems[elems[k]]){ alertval=document.getElementById(elems[k]).title; if(alertval.split("|")[0]=="(custom)"){ alert(alertval.split("|")[1]); }else{ alert("Please enter a valid "+ alertval) } document.getElementById(elems[k]).focus(); return false; } } return true; } function newCaptcha(){ document.getElementById('charimage').src='/scripts/captcha.php?refresh=true&rand='+Math.random()*9;setTimeout('validateElem(document.registrationForm.captcha,\'captcha\');',1000); } function checkEmail(email) { AtPos = email.indexOf("@") StopPos = email.lastIndexOf(".") if (email == "") { return false; } if (AtPos == -1 || StopPos == -1) { return false; } if (StopPos < AtPos) { return false; } if (StopPos - AtPos == 1) { return false; } return true; } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function validateElemScript(r){ r=trim(r); if(r==""){ elem=document.registrationForm.email; goodElem(elem,""); } if(r==""){ elem=document.registrationForm.email; badElem(elem,"E-mail already has account"); } if(r==""){ elem=document.registrationForm.username; goodElem(elem,""); } if(r==""){ elem=document.registrationForm.username; badElem(elem,"Username already taken"); } if(r==""){ elem=document.registrationForm.captcha; goodElem(elem,""); } if(r==""){ elem=document.registrationForm.captcha; badElem(elem,"Incorrect verification code"); } } passvalid=false; function validateElem(elem,type){ if(type=="email"){ if(checkEmail(elem.value)){ //send it to the server to see if an account exists, otherwise checkElem(elem.value,'email'); }else{ //bad address badElem(elem,"Not a valid e-mail address"); } } if(type=="check"){ if(elem.checked){ //its checked, good! goodElem(elem,''); }else{ //bad address badElem(elem,""); } } if(type=="email-contact"){ if(checkEmail(elem.value)){ //send it to the server to see if an account exists, otherwise goodElem(elem,''); }else{ //bad address badElem(elem,"Not a valid e-mail address"); } } if(type=="text"){ if(elem.value.length>=1 && elem.value.length<=1000){ goodElem(elem,''); }else if(elem.value.length<1){ badElem(elem,''); }else{ //bad text badElem(elem,'No more than 1000 characters'); } } if(type=="username"){ if(isAlphanumeric(elem.value) && elem.value.length>=3 && elem.value.length<=12){ //send it to the server to see if an account exists, otherwise checkElem(elem.value,'username'); }else if(elem.value.length<3){ badElem(elem,"Must be at least 3 characters"); }else if(elem.value.length>12){ badElem(elem,"Must be no more than 12 characters"); }else{ //bad username badElem(elem,"Must be only numbers and letters"); } } if(type=="captcha"){ if(isAlphanumeric(elem.value) && elem.value.length==4){ //send it to the server to see if its correct, otherwise checkElem(elem.value,'captcha'); }else if(elem.value.length!=4){ badElem(elem,"Must be 4 characters"); }else{ //bad captcha badElem(elem,"Invalid characters entered"); } } if(type=="password"){ if(elem.value.length>=5 && elem.value.length<=18){ //send it to the server to see if an account exists, otherwise goodElem(elem,""); passvalid=true; }else if(elem.value.length<5){ badElem(elem,"Must be at least 5 characters"); passvalid=false; }else{ badElem(elem,"Must be no more than 18 characters"); passvalid=false; } validateElem(document.registrationForm.password_confirm,"password_confirm"); } if(type=="password_confirm"){ if(elem.value==document.registrationForm.password.value && passvalid){ //send it to the server to see if an account exists, otherwise goodElem(elem,""); }else if(passvalid){ badElem(elem,"Passwords do not match"); }else{ blankElem(elem); } } } function isAlphanumeric(str){ var alphaExp = /^[0-9a-zA-Z]+$/; if(str.match(alphaExp)){ return true; }else{ return false; } } function highlightSubscribe(action){ if(action){ document.getElementById("subscribe").className="subscribe-box-over"; }else{ document.getElementById("subscribe").className="subscribe-box"; } } function highlightSearch(action){ if(action){ document.getElementById("search").className="search-box-over"; }else{ document.getElementById("search").className="search-box"; } } function highlightLogin(action){ if(action){ document.getElementById("login-button").className="loginButton-down"; }else{ document.getElementById("login-button").className="loginButton"; } } function showNotice(){ if(document.getElementById("datasaved").style.display=="none"){ fadeIn('datasaved',10,200); setTimeout("fadeOut('datasaved',20,1500);",2000); } } function showNoticeId(id){ if(document.getElementById(id).style.display=="none"){ fadeIn(id,10,200); setTimeout("fadeOut('"+id+"',20,1500);",2000); } } /*********************************************** * BEGIN CLASS FOR AJAX ***********************************************/ function makeHttpRequest(url, callback_function, return_xml) { var http_request, response, i; var activex_ids = [ 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP' ]; if (window.XMLHttpRequest) { // Mozilla, Safari, IE7+... http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE6 and older for (i = 0; i < activex_ids.length; i++) { try { http_request = new ActiveXObject(activex_ids[i]); } catch (e) {} } } if (!http_request) { return false; } http_request.onreadystatechange = function() { if (http_request.readyState !== 4) { // not ready yet return; } if (http_request.status !== 200) { // ready, but not OK alert('There was a problem with the request.(Code: ' + http_request.status + ')'); return; } if (return_xml) { response = http_request.responseXML; } else { response = http_request.responseText; } // invoke the callback callback_function(response); }; http_request.open('GET', url, true); http_request.send(null); } /*********************************************** * BEGIN CLASS FOR FADES ***********************************************/ function setOpacity(id, level) { level=level*.80; var element = document.getElementById(id); element.style.display = 'inline'; element.style.zoom = 1; element.style.opacity = level; element.style.MozOpacity = level; element.style.KhtmlOpacity = level; element.style.filter = "alpha(opacity=" + (level * 100) + ");"; } function fadeIn(id, steps, duration){ var fadeInComplete; for (i = 0; i <= 1; i += (1 / steps)) { setTimeout("setOpacity('" + id + "', " + i + ")", i * duration); fadeInComplete = i * duration; } } function fadeOut(id, steps, duration) { var fadeOutComplete; for (i = 0; i <= 1; i += (1 / steps)) { setTimeout("setOpacity('" + id + "', " + (1 - i) + ")", i * duration); fadeOutComplete = i * duration; } //completely hide the displayed message after the fade effect is complete setTimeout("hide('" + id + "')", fadeOutComplete); } function hide(id){ document.getElementById(id).style.display = 'none'; } /*********************************************** * BEGIN CLASS FOR FRIEND ORDERING ***********************************************/ function saveOrder(item) { var group = item.toolManDragGroup var list = group.element.parentNode var id = list.getAttribute("id") if (id == null) return group.register('dragend', function() { savestr=junkdrawer.serializeList(list); savestr=savestr.split("|"); if(newOrder(savestr)){ updateFriendOrder(savestr[0],savestr[1],savestr[2],savestr[3],savestr[4],savestr[5]); clearFriendStyling(); setFriendStyling(savestr[0],savestr[1],savestr[2],savestr[3],savestr[4],savestr[5]); setCurrentOrder(); showNotice(); } }) } function setCurrentOrder(){ var list = document.getElementById("boxes-edit"); curr=junkdrawer.serializeList(list); curr=curr.split("|"); currorder=new Array(); currorder[0]=curr[0]; currorder[1]=curr[1]; currorder[2]=curr[2]; currorder[3]=curr[3]; currorder[4]=curr[4]; currorder[5]=curr[5]; } function newOrder(str){ if(currorder[0]==str[0] && currorder[1]==str[1] && currorder[2]==str[2] && currorder[3]==str[3] && currorder[4]==str[4] && currorder[5]==str[5]) return false; else return true; } function clearFriendStyling(){ arr=document.getElementsByTagName("li"); for(i=0;i-1){ arr[i].className=""; } } } function setFriendStyling(f1,f2,f3,f4,f5,f6){ if(f1) document.getElementById(f1).className="topfriendedit"; if(f2) document.getElementById(f2).className="topfriendedit"; if(f3) document.getElementById(f3).className="topfriendedit"; if(f4) document.getElementById(f4).className="topfriendedit"; if(f5) document.getElementById(f5).className="topfriendedit"; if(f6) document.getElementById(f6).className="topfriendedit"; } /*********************************************** * Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit http://www.dynamicdrive.com/ for this script and 100s more. ***********************************************/ var fadeimages=featuredgame; var fadebgcolor="white" ////NO need to edit beyond here///////////// var fadearray=new Array() //array to cache fadeshow instances var fadeclear=new Array() //array to cache corresponding clearinterval pointers var dom=(document.getElementById) //modern dom browsers var iebrowser=document.all function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){ this.pausecheck=pause this.mouseovercheck=0 this.delay=delay this.degree=10 //initial opacity degree (10%) this.curimageindex=0 this.nextimageindex=1 fadearray[fadearray.length]=this this.slideshowid=fadearray.length-1 this.canvasbase="canvas"+this.slideshowid this.curcanvas=this.canvasbase+"_0" if (typeof displayorder!="undefined") theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :) this.theimages=theimages this.imageborder=parseInt(borderwidth) this.postimages=new Array() //preload images for (p=0;p
') else document.write('
') if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox this.startit() else{ this.curimageindex++ setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay) } } function fadepic(obj){ if (obj.degree<100){ obj.degree+=10 if (obj.tempobj.filters&&obj.tempobj.filters[0]){ if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+ obj.tempobj.filters[0].opacity=obj.degree else //else if IE5.5- obj.tempobj.style.filter="alpha(opacity="+obj.degree+")" } else if (obj.tempobj.style.MozOpacity) obj.tempobj.style.MozOpacity=obj.degree/101 else if (obj.tempobj.style.KhtmlOpacity) obj.tempobj.style.KhtmlOpacity=obj.degree/100 else if (obj.tempobj.style.opacity&&!obj.tempobj.filters) obj.tempobj.style.opacity=obj.degree/101 } else{ clearInterval(fadeclear[obj.slideshowid]) obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1" obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas) obj.populateslide(obj.tempobj, obj.nextimageindex) obj.nextimageindex=(obj.nextimageindex' slideHTML+='' if (this.theimages[picindex][1]!="") //if associated link exists for image slideHTML+='' picobj.innerHTML=slideHTML } fadeshow.prototype.rotateimage=function(){ if (this.pausecheck==1) //if pause onMouseover enabled, cache object var cacheobj=this if (this.mouseovercheck==1) setTimeout(function(){cacheobj.rotateimage()}, 100) else if (iebrowser&&dom||dom){ this.resetit() var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas) crossobj.style.zIndex++ fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50) this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0" } else{ var ns4imgobj=document.images['defaultslide'+this.slideshowid] ns4imgobj.src=this.postimages[this.curimageindex].src } this.curimageindex=(this.curimageindex