/*
* Pure ASP Upload 3
* Copyright (c) 2001-2010 DMXzone
* Version: 3.0.16
*/
function validateForm(e,d,g){var a=true;document.MM_returnValue=false;for(var c=0;c<e.elements.length;c++){field=e.elements[c];if(!field.type||field.type.toLowerCase()!="file"){continue}var f=false;for(var b=3;b<arguments.length;b++){if(field.name&&field.name.toLowerCase()==arguments[b][0].toLowerCase()){validateFile(field,arguments[b][1],arguments[b][2]);f=true}}if(!f){validateFile(field,d,g)}if(!field.uploadOK){a=false;break}}if(a){document.MM_returnValue=true}}function validateFile(b,a,c){var d=b.value.replace(/"/gi,"");b.uploadOK=false;if(d==""&&c){alert(getLang(PU3_ERR_REQUIRED));b.focus();return}else{if(a!=""&&d!=""){checkExtension(b,d,a)}else{b.uploadOK=true}}}function checkExtension(g,c,f){var j=new RegExp("\\.("+f.replace(/,/gi,"|").replace(/\s/gi,"")+")$","i");var b=navigator.userAgent.toLowerCase();if(b.indexOf("opera")!=-1){var a=c.substr(c.lastIndexOf(".")+1);var h=f.split(",");var e=false;for(var d=0;d<h.length;d++){if(h[d].toLowerCase()==a.toLowerCase()){e=true;break}}if(!e){alert(getLang(PU3_ERR_EXTENSION,f));g.focus();g.uploadOK=false;return}}else{if(!j.test(c)){alert(getLang(PU3_ERR_EXTENSION,f));g.focus();g.uploadOK=false;return}}g.uploadOK=true}function getLang(c){var a=c;for(var b=1;b<arguments.length;b++){a=a.replace("%"+b,arguments[b])}return a}function showProgressWindow(f,d,e,c){var a=false;if(c){for(var b=0;b<c.elements.length;b++){field=c.elements[b];if(!field.type||field.type.toLowerCase()!="file"){continue}if(field.value&&field.value!=""){a=true}}}else{a=true}if(document.MM_returnValue&&a){document.progressWindow=new progressPopup("UploadProgress",f,d,e);window.onunload=function(){document.progressWindow.close()}}}progressPopup=function(z,i,r,E){var u=this;var c=false;var a;var H=dd=document;var k=H.all&&H.getElementById;var m=k&&navigator.userAgent.toLowerCase().indexOf("msie 5")!=-1;var F=H.getElementById&&!H.all;var D=navigator.userAgent.toLowerCase();var p=(D.search(/opera/i)!=-1);var l=(D.search(/opera[\/\s][7-9]/i)!=-1);var L=(D.search(/safari/i)!=-1);var g=(D.indexOf("windows")!=-1);var f=(D.indexOf("mac")!=-1);var j=(dmxGetIEVer()>=8);var e=(window.innerWidth?window.innerWidth:(H.documentElement&&typeof H.documentElement.offsetWidth!="undefined"?H.documentElement.offsetWidth:-1));var s=(window.innerHeight?window.innerHeight:(H.documentElement&&typeof H.documentElement.offsetHeight!="undefined"?H.documentElement.offsetHeight:-1));var x=parseInt((s-E)/2),C=parseInt((e-r)/2);if((!k&&!F)||(p)||(k&&f)){return window.open(i,name,"width="+r+",height="+E+",scrollbars=0,top="+x+",left="+C)}x+=(F?pageYOffset:(H.documentElement?H.documentElement.scrollTop:H.body.clientTop));C+=(F?pageXOffset:(H.documentElement?H.documentElement.scrollLeft:H.body.scrollLeft));var J=r+(k&&!l?4:10);nh=E+(k&&!l?(j?44:32):36);var q=H.getElementById(z);if(q){q.object.bringToFront();return q.object}var b;var t;var o;var B;this.dm0=H.createElement("div");this.dm0.name=this.dm0.id=z;this.dm0.object=this;this.dm0.style.display="";this.dm0.style.position="absolute";this.dm0.style.top=x+"px";this.dm0.style.left=C+"px";this.dm0.style.width=(J+3)+"px";this.dm0.style.height=(nh+3)+"px";if(!k){this.dm0.style.background="url(dmx_shadow.png) repeat bottom right"}this.dm0.style.zIndex=(progressPopup.nZIndexLast++);this.bringToFront=function(){var d=H.body;if(this.dm0.style.display=="none"){this.dm0.style.display=""}this.dm0.style.zIndex=(progressPopup.nZIndexLast++);this.di.style.zIndex=(progressPopup.nZIndexLast++)};var A=H.createElement("div");if(k&&g){A.style.background="url(dmx_shadow.png) repeat bottom right";A.style.filter="progid:DXImageTransform.Microsoft.Blur(pixelradius=3,makeshadow=true,shadowopacity=.4)";A.style.width=J-5;A.style.height=nh-5}if(k&&!p){if(m){var y;y='<iframe id="mainiframe'+z+'" style="';y+="border:0px;";y+="width:0px;";y+="height:0px;";y+=' scrolling="no"';y+=' marginwidth="0"';y+=' marginheight="0"';y+=' frameborder="0"';y+="></iframe>";A.innerHTML=y}else{this.dmf=(k?H.createElement('<IFRAME SRC="javascript:false">'):H.createElement("iframe"));this.dmf=H.createElement("iframe");this.dmf.src="javascript:false";this.dmf.id="mainiframe"+z;this.dmf.border=0;this.dmf.frameborder=0;this.dmf.scrolling="no";A.appendChild(this.dmf)}this.dm0.appendChild(A);H.body.appendChild(this.dm0);this.dmf=document.getElementById("mainiframe"+z);dd=this.dmf.contentWindow.document;dd.open("text/html","replace");dd.write('<html><head></head><body id="body'+Math.ceil(Math.random()*10000)+'" style="margin:0; padding: 0; overflow: hidden;" bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 scroll=no></body></html>');dd.close();this.dmf.style.display="";this.dmf.style.position="relative";this.dmf.style.top="0px";this.dmf.style.left="0px";this.dmf.style.width=(J+6)+"px";this.dmf.style.height=(nh+3)+"px"}this.dw=dd.createElement("div");this.dw.object=this;this.dw.style.display="none";this.dw.style.border=(k?"4":"2")+"px outset "+(f?"#C0C0C0":"#166AEE");this.dw.style.display="block";this.dw.style.position="relative";if(!k){this.dw.style.margin="-6px 6px 6px -6px";this.dw.style.MozBorderRadius="10px 10px 0px 0px"}else{this.dw.style.margin="0 0 0 0"}this.dw.style.width=(J-(L?10:(F?6:2))-(l?-2:0)-(k?6:0))+"px";this.dw.style.height=(nh-(L?13:(l?9:(F?6:2))))+"px";this.getEventPosition=function(d){var n={x:0,y:0};var h=a;if(!h||!c){return n}if(!d){d=window.event}if(k&&!d){d=h.dmf.contentWindow.event}if(typeof(d.pageX)=="number"){n.x=d.pageX;n.y=d.pageY}else{n.x=d.clientX;n.y=d.clientY;if(!top.opera){if((!window.document.compatMode)||(window.document.compatMode=="BackCompat")){n.x+=window.document.body.scrollLeft;n.y+=window.document.body.scrollTop}else{n.x+=window.document.documentElement.scrollLeft;n.y+=window.document.documentElement.scrollTop}}}return n};this.getObjectXY=function(d){if(d){return{x:parseInt(d.style.left),y:parseInt(d.style.top)}}else{return{x:0,y:0}}};this.mouseMove=function(d){var h=a;if(!h||!c){return}if(!d){d=window.event}if(k&&!d){d=h.dmf.contentWindow.event}var n=h.getEventPosition(d);h.drag(n.x-o,n.y-B);o=n.x;B=n.y};this.iframemove=function(d){var h=a;if(!h||!c){return}if(!d){d=window.event}if(k&&!d){d=h.dmf.contentWindow.event}var n=h.getEventPosition(d);h.drag(n.x-b,n.y-t);o+=n.x-b;B+=n.y-t};this.drag=function(h,M){var w=this.getObjectXY(a.dm0);var n=w.x-0+h;var d=w.y-0+M;a.dm0.style.left=n+"px";a.dm0.style.top=d+"px"};this.dw.onmousedown=function(d){var h=this.object;if(k&&!d){d=h.dmf.contentWindow.event}h.bringToFront();c=true;a=h;var w=h.getEventPosition(d);b=w.x;t=w.y;var n=h.getObjectXY(a.dm0);if(k&&!p){o=n.x+w.x-(H.documentElement?H.documentElement.scrollLeft:H.body.scrollLeft);B=n.y+w.y-(H.documentElement?H.documentElement.scrollTop:H.body.clientTop)}else{o=w.x;B=w.y}h.dw.onmousemove=h.iframemove;H.onmousemove=h.mouseMove;H.onmouseup=h.dw.onmouseup};this.dw.onmouseup=function(){var d=a;if(!d||!c){return}c=false;a=null;d.dm0.onmousemove=null;H.onmousemove=null;H.onmouseup=null};this.dw.onselectstart=function(){return false};x=dd.createElement("div");x.align=(f?"left":"right");if(k||L){x.style.height="19px"}x.style.backgroundColor=(f?"#E3E3E3":"#0055E5");if(f){x.style.background="url(dmx_bg_osx.png) repeat bottom right"}x.style.padding="2px";if(!k){x.style.paddingRight="4px";x.style.MozBorderRadius="10px 10px 0px 0px"}else{x.style.width=J-(l?10:0)+"px"}this.dtit=dd.createElement("div");this.dtit.style.height="19px";this.dtit.style.width=(J-20)+"px";this.dtit.style.cursor="default";this.dtit.style.textAlign=(g?"left":"center");this.dtit.style.fontFamily="Tahoma";this.dtit.style.fontSize="12px";if(g){this.dtit.style.fontWeight="bold"}this.dtit.style.color=(f?"#000000":"#FFFFFF");this.dtit.style.paddingTop="3px";var v=dd.createElement("img");v.src="./"+(f?"dmx_close_osx.png":"dmx_close.jpg");v.align=(f?"left":"right");v.onclick=function(){u.close()};this.close=function(){if(u.dm0){u.dm0.style.display="none"}else{if(this.dm0){this.dm0.style.display="none"}}};x.appendChild(v);x.appendChild(this.dtit);this.dw.appendChild(x);var K=dd.createElement("div");K.style.backgroundColor="#FFFFFF";this.iloaded=function(d){var n=(d&&d.srcElement?d.srcElement:(this.object?this.object.di:event.srcElement));var M=n.object;var w=(k?document.getElementById("mainiframe"+n.object.dm0.id).contentWindow.document.getElementById("ciframe"):document.getElementById("ciframe"));if(w){try{var N=(k?w.contentWindow.document.title:w.contentDocument.title);if(N&&N.length>0){M.dtit.innerHTML=N}}catch(h){M.dtit.innerHTML=""}}};this.di=(k&&!p?dd.createElement('<IFRAME SRC="'+i+'">'):dd.createElement("iframe"));this.di.object=this;if(k){this.di.attachEvent("onload",this.iloaded)}else{this.di.onload=this.iloaded}this.di.id="ciframe";this.di.marginheight="0";this.di.marginwidth="0";this.di.width=r+(l?0:(k?4:0));this.di.height=E+(l?0:(k?4:0));this.di.scrolling="no";this.di.frameborder="0";K.appendChild(this.di);this.dw.appendChild(K);if(k&&!p){if(m){dd.body.innerHTML="";dd.body.appendChild(this.dw)}else{try{this.dmf.appendChild(this.dw)}catch(G){dd.body.appendChild(this.dw)}}}else{A.appendChild(this.dw);this.dm0.appendChild(A);H.body.appendChild(this.dm0)}var I=this.di;setTimeout(function(){I.src=i},200)};function dmxGetIEVer(){var c=-1;if(navigator.appName=="Microsoft Internet Explorer"){var a=navigator.userAgent;var b=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(b.exec(a)!=null){c=parseFloat(RegExp.$1)}}return c}progressPopup.nZIndexLast=10000;