/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.0.0 Alpha 5
|| # ---------------------------------------------------------------- # ||
|| # Copyright ©2000-2009 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
function vB_ImageUpload(E){this.ready=false;this.events={complete:new YAHOO.util.CustomEvent("complete",this),uploaddone:new YAHOO.util.CustomEvent("uploaddone",this)};var B={"do":"manageattach",upload:1,ajax:1,flash:1,poststarttime:vBulletin.attachinfo.poststarttime,posthash:vBulletin.attachinfo.posthash,contenttypeid:vBulletin.attachinfo.contenttypeid,userid:vBulletin.attachinfo.userid,securitytoken:SECURITYTOKEN};for(var C in vBulletin.attachinfo.values){B["values["+C+"]"]=vBulletin.attachinfo.values[C]}var A=window.location.href.split("?");var D=A[0].replace(/[a-z0-9]+\.php$/,"newattachment.php");this.yuiupload=new vB_YUI_Upload(vBulletin.attachinfo.auth_type,D,B,"attachment[]",E);if(this.yuiupload.uploader&&PHP.trim(YAHOO.util.Dom.get("yui_selectfiles").innerHTML)!=""){this.ready=true;this.yuiupload.events.ready.subscribe(this.yuiuploadevent_ready,this);this.extensions={jpg:3024000,jpeg:3024000,gif:3024000,png:3024000};this.yuiupload.events.handleresponse.subscribe(this.yuiuploadevent_handleresponse,this);this.yuiupload.events.uploaddone.subscribe(this.yuiuploadevent_uploaddone,this)}}vB_ImageUpload.prototype.yuiuploadevent_ready=function(B,A,C){C.yuiupload.setvars(C.extensions,vbphrase,vBulletin.attachinfo.attachlimit,vBulletin.attachinfo.max_file_size);YAHOO.util.Event.onAvailable("yui_selectfiles",function(){C.yuiupload.moveflashobj()})};vB_ImageUpload.prototype.yuiuploadevent_uploaddone=function(C,A,D){var B=A[0];var E=A[1];D.events.uploaddone.fire(B,vBulletin.attachinfo.contenttypeid,E)};vB_ImageUpload.prototype.yuiuploadevent_handleresponse=function(B,A,C){C.events.complete.fire()};