var SKIN_PATH="/changesnet/Tpl/new/Public/";
var isIE=(document.all&&window.ActiveXObject&&!window.opera)?true:false;
var isChrome=navigator.userAgent.indexOf("Chrome")!=-1;
var isGecko=navigator.userAgent.indexOf("WebKit")!=-1;
var dgX=dgY=0;
var dgDiv;
function inputText(){document.getElementById("preview").innerHTML+='<div><input type="text" name="text[]" value="输入项名" />&nbsp;&nbsp;<input type="text" style="width:260px;" readonly/><span style="cursor:pointer" onclick="remove(this)">[删除]</span></div>';
}function inputUpload(){document.getElementById("preview").innerHTML+='<div><input type="text" name="upload[]" value="输入认证文件名：" />&nbsp;&nbsp;<input type="text" style="width:260px;" readonly/><img src="{$Think.config.PUBLIC_PATH}/images/upload.png" /><img src="{$Think.config.PUBLIC_PATH}/images/serfdj02.png" /><img src="{$Think.config.PUBLIC_PATH}/images/delete.png" /><span onclick="remove(this)" style="cursor:pointer">[删除]</span></div>';
}function remove(a){var b=a.parentNode;
b.parentNode.removeChild(b);
}function mkDialog3(u,c,t,w,s,p,px,py){var w=w?w:300;
var u=u?u:"";
var c=c?c:(u?'<iframe src="'+u+'" width="'+(w-25)+'" height="0" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no"></iframe>':"");
var t=t?t:"系统提示";
var s=s?s:0;
var p=p?p:0;
var px=px?px:0;
var py=py?py:0;
var body=document.documentElement||document.body;
if(isGecko){body=document.body;
}var cw=body.clientWidth;
var ch=body.clientHeight;
var bsw=body.scrollWidth;
var bsh=body.scrollHeight;
var bw=parseInt((bsw<cw)?cw:bsw);
var bh=parseInt((bsh<ch)?ch:bsh);
if(!s){var Dmid=document.createElement("div");
with(Dmid.style){zIndex=998;
position="absolute";
width="100%";
height=bh+"px";
overflow="hidden";
top=0;
left=0;
border="0px";
backgroundColor="#EEEEEE";
if(isIE){filter=" Alpha(Opacity=50)";
}else{opacity=50/100;
}}Dmid.id="Dmid";
document.body.appendChild(Dmid);
}var sl=px?px:body.scrollLeft+parseInt((cw-w)/2);
var st=py?py:body.scrollTop+parseInt(ch/2)-100;
var Dtop=document.createElement("div");
with(Dtop.style){zIndex=999;
position="absolute";
width=w+"px";
left=sl+"px";
top=st+"px";
if(isIE){filter=" Alpha(Opacity=0)";
}else{opacity=0;
}}Dtop.id="Dtop";
document.body.appendChild(Dtop);
document.getElementById("Dtop").innerHTML='<div class="dbody"><div class="dhead" ondblclick="cDialog();" onmousedown="dragstart(\'Dtop\', event);"  onmouseup="dragstop(event);" onselectstart="return false;"><span onclick="cDialog();">'+sound("tip")+"&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;"+t+'</div><div class="dbox">'+c+"</div></div>";
sDialog("Dtop",100,"+");
}function cDialog(){sDialog("Dtop",100,"-");
}function sDialog(c,a,b){if(b=="+"){if(isIE){document.getElementById(c).style.filter="Alpha(Opacity="+a+")";
}else{document.getElementById(c).style.opacity=a/100;
}if(a==100){Eh();
return;
}if(a+25<100){window.setTimeout(function(){sDialog(c,a+25,b);
},1);
}else{sDialog(c,100,b);
}}else{try{document.getElementById(c).style.display="none";
document.body.removeChild(document.getElementById("Dtop"));
document.getElementById("Dmid").style.display="none";
document.body.removeChild(document.getElementById("Dmid"));
Es();
}catch(d){}}}function mkDialog(u,c,t,w,s,p,px,py){var w=w?w:300;
var u=u?u:"";
var c=c?c:(u?'<iframe src="'+u+'" width="'+(w-25)+'" height="0" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no"></iframe>':"");
var t=t?t:"系统提示";
var s=s?s:0;
var p=p?p:0;
var px=px?px:0;
var py=py?py:0;
var body=document.documentElement||document.body;
var cw=body.clientWidth;
var ch=body.clientHeight;
var bsw=body.scrollWidth;
var bsh=body.scrollHeight;
var bw=parseInt((bsw<cw)?cw:bsw);
var bh=parseInt((bsh<ch)?ch:bsh);
var sttop=document.body.scrollTop|document.documentElement.scrollTop;
if(!s){var Dmid=document.createElement("div");
with(Dmid.style){zIndex=998;
position="absolute";
width="100%";
height=bh+"px";
overflow="hidden";
top=0;
left=0;
border="0px";
backgroundColor="#EEEEEE";
if(isIE){filter=" Alpha(Opacity=50)";
}else{opacity=50/100;
}}Dmid.id="Dmid";
document.body.appendChild(Dmid);
}var sl=px?px:body.scrollLeft+parseInt((cw-w)/2);
var st=py?py:sttop+parseInt(ch/2)-100;
var Dtop=document.createElement("div");
with(Dtop.style){zIndex=999;
position="absolute";
width=w+"px";
left=sl+"px";
top=st+"px";
if(isIE){filter=" Alpha(Opacity=0)";
}else{opacity=0;
}}Dtop.id="Dtop";
document.body.appendChild(Dtop);
document.getElementById("Dtop").innerHTML='<div class="dbody"><div class="dhead" ondblclick="cDialog();" onmousedown="dragstart(\'Dtop\', event);"  onmouseup="dragstop(event);" onselectstart="return false;"><span onclick="cDialog();">× </span>&nbsp;'+t+'</div><div class="dbox">'+c+"</div></div>";
sDialog("Dtop",100,"+");
}function cDialog(){sDialog("Dtop",100,"-");
}function sDialog(c,a,b){if(b=="+"){if(isIE){document.getElementById(c).style.filter="Alpha(Opacity="+a+")";
}else{document.getElementById(c).style.opacity=a/100;
}if(a==100){Eh();
return;
}if(a+25<100){window.setTimeout(function(){sDialog(c,a+25,b);
},1);
}else{sDialog(c,100,b);
}}else{try{document.getElementById(c).style.display="none";
document.body.removeChild(document.getElementById("Dtop"));
document.getElementById("Dmid").style.display="none";
document.body.removeChild(document.getElementById("Dmid"));
Es();
}catch(d){}}}function Dalert(e,a,d,b){if(!e){return;
}var d=d?d:0;
var a=a?a:350;
var b=b?b:0;
e=e+'<br style="margin-top:5px;"/><input type="button" class="btn" value=" OK " onclick="cDialog();"/>';
mkDialog("",e,"",a,d);
if(b){window.setTimeout(function(){cDialog();
},b);
}}function Dconfirm(g,b,a,e){if(!g){return;
}var e=e?e:0;
var a=a?a:350;
var f=b?"window.location = '"+b+"'":"cDialog()";
g=g+'<br style="margin-top:5px;"/><input type="button" class="btn" value=" OK " onclick="'+f+'"/>&nbsp;&nbsp;<input type="button" class="btn" value=" 取消 " onclick="cDialog();"/>';
mkDialog("",g,"",a,e);
}function Diframe(d,b,f,a,e){var f=f?f:0;
var b=b?b:350;
var a=a?true:false;
var g='<iframe src="'+d+'" width="'+(b-25)+'" height=0" id="diframe" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no"></iframe><br/><input type="button" class="btn" value=" OK " onclick="cDialog();"/>';
if(a){g='<div id="dload" style="line-height:22px;">Loading...</div>'+g;
}mkDialog("",g,e,b,f);
}function Dtip(d,a,b){if(!d){return;
}var a=a?a:350;
var b=b?b:2000;
mkDialog("",d,"",a);
window.setTimeout(function(){cDialog();
},b);
}function Dfile(h,d,g,b,f){var f=f?f:"";
var j='<iframe name="UploadFile" style="display: none" src=""></iframe>';
j+='<form method="post" target="UploadFile" enctype="multipart/form-data" action="'+g+"\" onsubmit=\"return isImg('upfile','"+f+'\');"><input type="hidden" name="auth_code" value="'+b+'"><input type="hidden" name="from" value="file"/><input type="hidden" name="old" value="'+h+'"/><input type="hidden" name="fid" value="'+d+'"/><table cellpadding="2"><tr><td><input id="upfile" type="file" size="20" name="upfile" onchange="if(isImg(\'upfile\',\''+f+"')){this.form.submit();document.getElementById('Dsubmit').disabled=true;document.getElementById('Dsubmit').value='上传中';}\"/>"+(f?"<br>允许"+f:"")+'</td></tr><tr><td><input type="submit" class="btn" value="上传" id="Dsubmit"/>&nbsp;&nbsp;<input type="button" class="btn" value="取消" onclick="cDialog();"/></td></tr></table></form>';
mkDialog("",j,"上传文件",250);
}function Dthumb(m,f,d,b,k,n,e,l,g){var n=n?"":"none";
var l=l?"":"none";
var e=e?e:"thumb";
var j='<iframe name="UploadThumb" style="display: none" src=""></iframe>';
j+='<form method="post" target="UploadThumb" enctype="multipart/form-data" action="'+b+'" onsubmit="return isImg(\'upthumb\');"><input type="hidden" name="auth_code" value="'+k+'"><input type="hidden" name="from" value="thumb"/><input type="hidden" name="old" value="'+d+'"/><input type="hidden" name="fid" value="'+e+'"/><table cellpadding="3"><tr><td><input id="upthumb" type="file" size="20" name="upthumb" onchange="if(isImg(\'upthumb\')){this.form.submit();document.getElementById(\'Dsubmit\').disabled=true;document.getElementById(\'Dsubmit\').value=\'上传中\';}"/></td></tr><tr style="display:'+n+'"><td>宽度 <input type="text" size="3" name="width" value="'+m+'"/> px &nbsp;&nbsp;&nbsp;高度 <input type="text" size="3" name="height" value="'+f+'"/> px </td></tr><tr><td  style="display:'+l+";height:"+g+'px"> </td></tr><tr><td><input type="submit" value="上传" id="Dsubmit"/>&nbsp;&nbsp;<input type="button" value="取消" onclick="cDialog();"/></td></tr></table></form>';
mkDialog("",j,"上传图片",250);
}function Dalbum(j,m,e,d,n,i,b,l){var n=n?"none":"";
var k='<iframe name="UploadAlbum" style="display:none" src=""></iframe>';
k+='<form method="post" target="UploadAlbum" enctype="multipart/form-data" action="'+b+'" onsubmit="return isImg(\'upalbum\');"><input type="hidden" name="fid" value="'+j+'"/><input type="hidden" name="auth_code" value="'+l+'"><input type="hidden" name="groupid" value="'+i+'"/><input type="hidden" name="from" value="album"/><input type="hidden" name="old" value="'+d+'"/><table cellpadding="3"><tr><td><input id="upalbum" type="file" size="20" name="upalbum" onchange="if(isImg(\'upalbum\')){this.form.submit();document.getElementById(\'Dsubmit\').disabled=true;document.getElementById(\'Dsubmit\').value=\'上传中\';}"/></td></tr><tr style="display:'+n+'"><td>宽度 <input type="text" size="3" name="width" value="'+m+'"/> px &nbsp;&nbsp;&nbsp;高度 <input type="text" size="3" name="height" value="'+e+'"/> px </td></tr><tr><td><input type="submit" value="上传" id="Dsubmit"/>&nbsp;&nbsp;<input type="button" value="取消" onclick="cDialog();"/></td></tr></table></form>';
mkDialog("",k,"上传图片",250);
}function Dphoto(i,d,g,k,j,b,e){var e=e?"none":"";
var l='<iframe name="UploadPhoto" style="display:none" src=""></iframe>';
l+='<form method="post" target="UploadPhoto" enctype="multipart/form-data" action="'+j+'" onsubmit="return isImg(\'upalbum\');"><input type="hidden" name="fid" value="'+i+'"/><input type="hidden" name="auth_code" value="'+b+'"><input type="hidden" name="from" value="photo"/><input type="hidden" name="old" value="'+k+'"/><table cellpadding="3"><tr><td><input id="upalbum" type="file" size="20" name="upalbum" onchange="if(isImg(\'upalbum\')){this.form.submit();document.getElementById(\'Dsubmit\').disabled=true;document.getElementById(\'Dsubmit\').value=\'上传中\';}"/></td></tr><tr style="display:'+e+'"><td>宽度 <input type="text" size="3" name="width" value="'+d+'"/> px &nbsp;&nbsp;&nbsp;高度 <input type="text" size="3" name="height" value="'+g+'"/> px </td></tr><tr><td><input type="submit" class="btn" value="上传" id="Dsubmit"/>&nbsp;&nbsp;<input type="button" class="btn" value="取消" onclick="cDialog();"/></td></tr></table></form>';
mkDialog("",l,"上传图片",250);
}function getAlbum(a,b){document.getElementById("thumb"+b).value=a;
document.getElementById("showthumb"+b).src=a;
}function delAlbum(a,b){document.getElementById("thumb"+a).value="";
document.getElementById("showthumb"+a).src=SKIN_PATH+"images/"+b+"pic.gif";
}function Eh(d){var d=d?d:"select";
if(isIE){var e=navigator.appVersion.split("MSIE");
var a=parseFloat(e[1]);
if(a>=7||a<5){return;
}var c=document.body.getElementsByTagName(d);
for(var b=0;
b<c.length;
b++){c[b].style.visibility="hidden";
}}}function Es(d){var d=d?d:"select";
if(isIE){var e=navigator.appVersion.split("MSIE");
var a=parseFloat(e[1]);
if(a>=7||a<5){return;
}var c=document.body.getElementsByTagName(d);
for(var b=0;
b<c.length;
b++){c[b].style.visibility="visible";
}}}function isImg(f,g){var c=document.getElementById(f).value;
if(c==""){confirm("请选择文件");
return false;
}var d=ext(c);
d=d.toLowerCase();
var b=typeof g=="undefined"?"jpg|gif|png|jpeg|bmp":g;
if(b.length>2&&b.indexOf(d)==-1){confirm("限制为:"+b);
return false;
}return true;
}function ext(a){return a.substring(a.lastIndexOf(".")+1,a.length);
}function _preview(b,a){var a=a?true:false;
if(b){if(a){var c=b.lastIndexOf(".thumb.");
if(c!=-1){b=b.substring(0,c);
}}mkDialog("",'<img src="'+b+"\" onload=\"document.getElementById('Dtop').style.width=(this.width+20)+'px';if(this.width>600){document.getElementById('Dtop').style.left=15+'px';}\"/>","预览图片");
}else{Dtip("没有图片");
}}function dragstart(a,b){dgDiv=document.getElementById(a);
if(!b){b=window.event;
}dgX=b.clientX-parseInt(dgDiv.style.left);
dgY=b.clientY-parseInt(dgDiv.style.top);
document.onmousemove=dragmove;
}function dragmove(a){if(!a){a=window.event;
}dgDiv.style.left=(a.clientX-dgX)+"px";
dgDiv.style.top=(a.clientY-dgY)+"px";
}function dragstop(){dgX=dgY=0;
document.onmousemove=null;
}function _delete(b,a){if(b.value){$.post("/Member/ftpFileDelete",{old:b.value,f:a},function(c){b.value="";
Dtip("删除成功");
},"json");
}else{Dtip("没有图片");
}}