/**********************************************************************\
|**  	Image and File Uploader for ProBoards. Created by Simie				
|*  	Do not modify or rehost this file, as it may need to be changed
|**  	for updates. This file is compressed.
\**********************************************************************/
var fileUploaded=false;var Uploads=0;var fileUploader={$:function(id){return document.getElementById(id);},fileUploaded:false,init:function(){sFont=document.getElementsByTagName("font");sTR=document.getElementsByTagName("tr");if(location.href.match(/action=display/i)&&pb_username!="Guest"){for(i=0;i<sFont.length;i++){if(sFont[i].innerHTML.match(/\[uploadedFiles=(.+?)]/i)){var _2=sFont[i].parentNode.parentNode.parentNode;var _3=RegExp.$1.split(";")[0];var _4=RegExp.$1.split(";")[1];_2.id="post"+_3;var DD=document.createElement("script");DD.type="text/javascript";DD.src="http://pb.proscripts.co.uk/uploader/checkPost.php?id="+_3+"&num="+_4;document.body.appendChild(DD);}}}else{if((location.href.match(/action=post/i)||document.title.match(/Post Message/i))&&pb_username!="Guest"){document.postForm.message.value=document.postForm.message.value.replace(/\[uploadedFiles=(.+?)]/i,"");for(i=0;i<sTR.length;i++){if(sTR[i].firstChild&&sTR[i].firstChild.width=="30%"&&sTR[i].firstChild.innerHTML.match(/Add Smilies/i)){theNewRow=document.createElement("tr");var _6=sTR[i].firstChild.cloneNode(true);_6.innerHTML=_6.innerHTML.replace(/Add Smilies/i,"<img src=\"http://pb.proscripts.co.uk/uploader/img/attach.png\" alt=\"\"/>Attach File");theNewRow.appendChild(_6);var _7=sTR[i].firstChild.nextSibling.cloneNode(true);var _8=new Date().getTime().toString().substring(0,10);var _9=location.href.split("?")[0];_7.innerHTML="<font size=\"1\"><form action=\"http://pb.proscripts.co.uk/uploader/uploadFile.php\" method=\"post\" target=\"uploadWindow\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\""+_9+"\" name=\"boardName\" /><input type=\"hidden\" value=\""+_8+"\" name=\"id\"/><input type=\"file\" size=\"20\" value=\"Upload a File\" id=\"fileUploader\" name=\"theFile\" /><input type=\"submit\" value=\"Upload it\" onclick=\"return openWindow();\"/></form>&nbsp; Max Size: 1MB. Accepted files: gif;png;jpg;bmp;zip;rar</font>";theNewRow.appendChild(_7);sTR[i].parentNode.insertBefore(theNewRow,sTR[i].nextSibling);if(window.addEventListener){document.postForm.addEventListener("submit",function(){if(fileUploaded==true){if(document.postForm.message.value.length>0){document.postForm.message.value=document.postForm.message.value+"[uploadedFiles="+_8+";"+Uploads+"]";}}},true);}else{if(window.attachEvent){document.postForm.attachEvent("onsubmit",function(){if(fileUploaded==true){if(document.postForm.message.value.length>0){document.postForm.message.value=document.postForm.message.value+"[uploadedFiles="+_8+";"+Uploads+"]";}}});}}break;}}for(i=0;i<sFont.length;i++){if(sFont[i].innerHTML.match(/\[uploadedFiles=(.+?)]/i)){sFont[i].innerHTML=sFont[i].innerHTML.replace(/\[uploadedFiles=(.+?)]/i,"");}}}else{if(location.href.match(/modifypost/i)&&!document.title.match(/An error/i)){if(document.postForm.message.value.match(/\[uploadedFiles=(.+?)]/i)){var _a="[uploadedFiles="+RegExp.$1+"]";document.postForm.message.value=document.postForm.message.value.replace(/\[uploadedFiles=(.+?)]/i,"");for(i=0;i<sTR.length;i++){if(sTR[i].firstChild.innerHTML=="<font size=\"2\">Disable Smilies:</font>"){var _b=sTR[i].cloneNode(true);_b.firstChild.innerHTML="<font size=\"2\">Keep Attachments:</font>";_b.firstChild.nextSibling.innerHTML="<input id=\"keepAttachments\" name=\"keepAttachments\" value=\"1\" type=\"checkbox\" checked=\"checked\" /> <font size=\"1\">If this box is checked, the attachments in this message will not be removed.</font>";sTR[i].parentNode.insertBefore(_b,sTR[i]);break;}}if(window.addEventListener){document.postForm.addEventListener("submit",function(){if(document.getElementById("keepAttachments").checked==true){document.postForm.message.value=document.postForm.message.value+_a;}},true);}else{if(window.attachEvent){document.postForm.attachEvent("onsubmit",function(){if(document.getElementById("keepAttachments").checked==true){document.postForm.message.value=document.postForm.message.value+_a;}});}}}}else{for(i=0;i<sFont.length;i++){if(sFont[i].innerHTML.match(/\[uploadedFiles=(.+?)]/i)){sFont[i].innerHTML=sFont[i].innerHTML.replace(/\[uploadedFiles=(.+?)]/i,"<br /><br /><br /><br />This post has attachments. <a href=\"/index.cgi?action=login\">Login</a> or <a href=\"/index.cgi?action=register\">Register</a> to view them.");}}}}}}};var runOnce=false;function openWindow(_c){var _d=confirm("By uploading this file, you agree that you are not uploading any files that are against the Proboards.com TOS. This includes:\n\n-Pornographic Materials\n\n-Anything that is unsuitable for people under 18\n\nIf you are caught uploading content against the TOS, then you will be banned from uploading.\nFiles that have gone 20 days without a download will be deleted to make way for new files. Torrents are NOT allowed. ProScripts takes no responsability for lost files.\n\nDo you agree?");if(_d){var _e=window.open("","uploadWindow","directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0,top=100,left=100,width=400,height=400");_e.focus();fileUploaded=true;Uploads++;return true;}else{return false;}}function removeUpload(){Uploads--;}function confirmDownload(_f){var con=confirm("This file has been flagged, but not yet confirmed as dangerous. Download this file at your own risk. ProScripts, Proboards or this forum will take no responsibility for any damage to you or your computer.\n\n\nClick OK to continue downloading, or cancel to go back.");if(con){window.location="http://pb.proscripts.co.uk/uploader/downloadFile.php?file="+_f;}else{return false;}}function flagFile(_11,_12){if(confirm("Are you sure you want to flag this file? Each flagged file is reviewed by a real person.\n\nDo not flag a file unless it violates the TOS.\n\nIf you do not wish to report this file, click cancel.\n\nEVERY REPORT IS REVIEWED. DO NOT CLICK OK UNLESS THIS FILE BREAKS THE TOS.")){var _13=document.createElement("script");_13.type="text/javascript";_13.src="http://pb.proscripts.co.uk/uploader/flagFile.php?file="+_11;document.body.appendChild(_13);document.getElementById(_12).innerHTML="<a href=\"javascript:void(1);\" title=\"This file has been flagged, and is queued for checking.\"><img src=\"http://pb.proscripts.co.uk/uploader/img/flag_orange.png\" border=\"0\" /></a>";}}fileUploader.init();