var dirurl="../";function setDir(a){dirurl=a}function submitVote(d,g,f,b){var a;try{a=new XMLHttpRequest()}catch(c){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Your browser does not support AJAX!");return false}}}a.onreadystatechange=function(){if(a.readyState==4){var e=a.responseText;if(e==1){ChangeIcon(f,1,b);alert("You are the author you cannot vote on your own submission.")}else{if(e==2){ChangeIcon(f,1,b);alert("You have already voted on this stk submission.\n* You may revote when 24 hours have elapsed. *")}else{if(e==3){if(d=="u"){ChangeIcon(f,2,b)}else{ChangeIcon(f,3,b)}alert("Thank you, your vote has been submitted")}else{alert("Error: Seems to be a problem casting this vote, please contact Jon ASAP.")}}}}};a.open("GET",dirurl+"includes/ajaxvote.php?votetype="+d+"&id="+g+"",true);a.send(null)}function ChangeIcon(f,c,e){if(e){var d=document.getElementById(f);if(c==1){d.innerHTML='<a href="javascript:void(0);"><img src="'+dirurl+'images/icon-voteup-stop.png" /></a><a href="javascript:void(0);"><img src="'+dirurl+'images/icon-votedown-stop.png" /></a>'}else{if(c==2){d.innerHTML='<a href="javascript:void(0);"><img src="'+dirurl+'images/icon-voteup-success.png" /></a><a href="javascript:void(0);"><img src="'+dirurl+'images/icon-votedown-stop.png" /></a>'}else{if(c==3){d.innerHTML='<a href="javascript:void(0);"><img src="'+dirurl+'images/icon-voteup-stop.png" /></a><a href="javascript:void(0);"><img src="'+dirurl+'images/icon-votedown-success.png" /></a>'}else{alert("Action not in range")}}}}else{var d=document.getElementById(f);var b=document.getElementById("subpagevote");var a;a=parseInt(b.innerHTML);if(c==1){d.innerHTML='<a href="javascript:void(0);"><img src="'+dirurl+'images/icon-voteup-stop2.png" /></a><a href="javascript:void(0);"><img src="'+dirurl+'images/icon-votedown-stop2.png" /></a>'}else{if(c==2){d.innerHTML='<a href="javascript:void(0);"><img src="'+dirurl+'images/icon-voteup-success2.png" /></a><a href="javascript:void(0);"><img src="'+dirurl+'images/icon-votedown-stop2.png" /></a>';a++;b.innerHTML="<strong>"+a+"</strong>"}else{if(c==3){d.innerHTML='<a href="javascript:void(0);"><img src="'+dirurl+'images/icon-voteup-stop2.png" /></a><a href="javascript:void(0);"><img src="'+dirurl+'images/icon-votedown-success2.png" /></a>';a--;b.innerHTML="<strong>"+a+"</strong>"}else{alert("Action not in range")}}}}}function checkHeader(){if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))){document.getElementById("header-banner").innerHTML="<img src=http://droidz.org/images/banner_iphone.png>"}else{var a=new SWFObject("http://droidz.org/header/banner.swf","droidz_banner","807","120","8","");a.addParam("wmode","transparent");a.write("header-banner")}}function validateSearch(){var a=document.getElementById("search_bar");if(isBlank(a.value)||a.value=="Search Stks..."){alert("Please enter a search term");return false}else{if(a.value.length<3){alert("Search term must be greater than three characters");return false}else{return true}}}function confirmDelete(c,b){var a=confirm("Are you sure you want to delete "+b+"?");if(a){window.location="?delid="+c+""}}function validateShare(){var a=document.uploadfile;if(isBlank(a.title.value)||a.title.value.length<3||a.title.value.length>50){alert("Title must be no fewer 3 characters and no greater than 50")}else{if(isBlank(a.droidzfile.value)){alert("You must select a file to upload")}else{showUpload();return true}}return false}function validateDonate(){var a=document.entry;if(isBlank(a.author.value)){alert("Author field has been left blank")}else{if(a.author.value.length<3||a.author.value.length>30){alert("Author field must no fewer than 3 characters and no greater than 30")}else{if(isBlank(a.title.value)){alert("Title field has been left blank")}else{if(a.title.value.length<3||a.title.value.length>30){alert("Title field must no fewer than 3 characters and no greater than 30")}else{if(isBlank(a.file_0.value)){alert("You must select a stk or zip file")}else{if(isBlank(a.file_1.value)){alert("You must select a picture")}else{if(a.cat.value=="1"){alert("You must select a category")}else{if(a.type.value=="1"){alert("You must select a type")}else{if(a.use.value=="1"){alert("You must select a usage rating")}else{if(a.comments.value>300){alert("Your comment must not be greater than 300 characters.")}else{showUpload();return true}}}}}}}}}}return false}function isBlank(a){if(a==""||a==null){return true}else{return false}}function showUpload(){document.getElementById("prog").style.display="";document.getElementById("btn").style.display="none"};