﻿var btoa= document.location.href;
var un1=btoa.lastIndexOf("/")+1;　　
var un2=btoa.lastIndexOf(".");
var urla=btoa.substring(un1,un2);
var gSubmitElem=new Array("ShtmlID");
var gChkElem=new Array("ShtmlID");
var gSucc="CLOSE_DIALOG";
var gRequestURL="/Bto/Show.aspx";
var gRequestMethod="POST";
var gSuccDelay=0;
var gReturnURL=".shtml";
var gDebug=1;
var dialogconf=new Array();
dialogconf["bordercolor"]="#60609b";
dialogconf["titlebgcolor"]="#60609b";
dialogconf["bodybgcolor"]="#ffffff";
dialogconf["tabbgcolor"]="#d4d4d4";
if(window.navigator["appName"].substr(0,8)=="Netscape"){
var nav="Moz";
}else{
if(window.navigator["appName"].substr(0,8)=="Microsof"){
var nav="IE";
}
}
var timerId=0;
var Opacity=0;
var initOpacity=0;
var maxOpacity=10;
var dialogBgId="dialogBg";
function $(s){
return document.getElementById(s);
}
function trim(s){
return s.replace(/(^[ |��]*)|([ |��]*$)/g,"");
}
function $a(s){
return document.getElementsByName(s);
}
function chkSubmit(){
for(key in gChkElem){
oObj=$(gChkElem[key]);
if(trim(oObj.value)==""){
dialogShow("InputErr",oObj.getAttribute("erralert"),oObj.id);
return false;
}
}
return true;
}
function dialogBg(){
if(!$(dialogBgId)){
var _4=document.createElement("div");
_4.id=dialogBgId;
document.body.appendChild(_4);
}else{
_4=$(dialogBgId);
}
_4.oncontextmenu=function(){
return false;
};
_4.style.display="none";
_4.style.position="absolute";
_4.style.left=0;
_4.style.top=0;
_4.style.backgroundColor="#333333";
if(nav=="IE"){
_4.style.filter="Alpha(Opacity="+initOpacity+")";
}else{
_4.style.opacity=initOpacity;
}
_4.style.height=document.body.scrollHeight;
_4.style.width=document.body.scrollWidth;
_4=null;
}
function dialogBgShade(){
$(dialogBgId).style.display="block";
timerId=window.setInterval("shade()",50);
}
function shade(){
if(Opacity==maxOpacity){
Opacity=initOpacity;
window.clearInterval(timerId);
return true;
}
Opacity=(Opacity+10)>maxOpacity?maxOpacity:Opacity+3;
var _5=Opacity/100;
var _6=$(dialogBgId);
if(nav=="IE"){
_6.style.filter="Alpha(Opacity="+Opacity+")";
}else{
_6.style.opacity=_5;
}
}
function dialog(_7,_8,_9){
var _a="dialog";
var _b=300;
var _c=200;
var _d="        <table width=\"300\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">        <tr>          <td width=\"297\" style=\"border: 1px solid "+dialogconf["bordercolor"]+";\" valign=\"top\">\t\t  <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-size: 13px;\">              <tr>                <td height=\"10\" style=\"padding: 1px;\" bgcolor=\""+dialogconf["titlebgcolor"]+"\" id=\"dialogTitle\" onMouseOver=\"this.style.cursor='move'\" onMouseDown=\"dialogDrag('"+_a+"',event)\">&nbsp;</td>              </tr>              <tr>                <td align=\"center\" style=\"padding: 4px;\" height=\"100\" bgcolor=\""+dialogconf["bodybgcolor"]+"\"><span id=\"dialogMsg\">&nbsp;</span></td>              </tr>              <tr>                <td height=\"30\" align=\"center\" bgcolor=\""+dialogconf["bodybgcolor"]+"\" id=\"dialogBtn\">&nbsp;</td>              </tr>            </table></td>          <td width=\"3\"  valign=\"top\">\t\t  <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  <tr>    <td height=\"5\"></td>  </tr>  <tr>    <td bgcolor=\""+dialogconf["tabbgcolor"]+"\" height=\"144\"></td>  </tr></table></td>        </tr>      </table>      <table width=\"300\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">        <tr>          <td width=\"4\" height=\"3\"></td>          <td width=\"297\" bgcolor=\""+dialogconf["tabbgcolor"]+"\"></td>        </tr>      </table>";
if($(_a)){
$(_a).parentNode.removeChild($(_a));
}
var _e=document.createElement("div");
_e.id=_a;
_e.innerHTML=_d;
_e.style.position="absolute";
_e.style.left=document.body.scrollLeft+(document.body.offsetWidth-_b)/2;
if(document.body.offsetHeight>_c){
if(nav=="IE"){
_e.style.top=document.body.scrollTop+(document.body.offsetHeight-_c)/2;
}else{
if(nav=="Moz"){
_e.style.top=document.body.scrollTop+(document.body.offsetHeight-document.body.scrollTop-_c)/2;
}
}
}else{
_e.style.top=document.body.scrollTop;
}
_e.style.width=_b;
_e.style.height=_c;
document.body.appendChild(_e);
if(_9){
dialogTitle(_9);
}else{
dialogTitle("<font color=#ffffff>&#31995;&#32479;&#25552;&#31034;&#20449;&#24687;</font>");
}
}
function dialogDrag(_f,_10){
var _11=$(_f);
var _12=_10.clientX;
var _13=_10.clientY;
_11.onmousemove=dialogMove;
_11.onmouseup=dialogStop;
function dialogMove(){
var _14=_10.clientX-_12;
var _15=_10.clientY-_13;
_11.style.left=_14+parseInt(_11.style.left);
_11.style.top=_15+parseInt(_11.style.top);
_12=_10.clientX;
_13=_10.clientY;
}
function dialogStop(){
_11.onmousemove=function(){
return false;
};
_11.onmouseup=function(){
return false;
};
}
}
function dialogShow(_16,_17,_18){
var _19="dialogBtn";
switch(_16){
case "InputErr":
var _1a=$(_19);
if(_1a){
_1a.innerHTML="<input type=\"button\" value=\"&#30830;&#23450;\" onClick=\"inputErrBtnEvent('"+_18+"');\" style=\"width:60px;\">";
}
dialogMsg(_17);
break;
case "Err":
var _1b=$(_19);
if(_1b){
_1b.innerHTML="<input type=\"button\" value=\"&#30830;&#23450;\" onClick=\"dialogClose();\" style=\"width:60px;\">";
}
dialogMsg(_17);
break;
case "Succ":
var _1c=$(_19);
if(_1c){
_succBtn(_19);
}
dialogMsg(_17);
dialogDelayEvent(gSuccDelay,"succBtnEvent()");
break;
case "BtoOpen":
dialogMsg(_17);
dialogDelayEvent(gSuccDelay,"BtoClose()");
break;
case "BtoLogin":
var _1d=$(_19);
if(_1d){
_1d.innerHTML="<input type=\"button\" value=\"&#30830;&#23450;\" onClick=\"dialogClose1();\" style=\"width:60px;\">";
}
dialogMsg(_17);
break;
case "Note":
dialogMsg(_17);
break;
}
}
function _succBtn(_1e,_1f){
var _20=$(_1e);
if(_20){
var _21=_1f;
_20.innerHTML=_21;
return true;
}else{
return false;
}
}
function BtoClose(){
dialogClose();
}
function dialogTitle(_22){
var _23="dialogTitle";
oDiv=$(_23);
oDiv.innerHTML=_22;
}
function dialogMsg(msg){
var _25="dialogMsg";
oDiv=$(_25);
oDiv.innerHTML=msg;
}
function inputErrBtnEvent(obj){
dialogClose();
$(obj).focus();
}
function succBtnEvent(){
switch(gSucc){
case "CLOSE_DIALOG":
dialogClose();
var _27=gSubmitElem;
for(key in _27){
var _28=$(_27[key]);
switch(_28.tagName){
case "INPUT":
switch(_28.type){
case "text":
_28.value="";
break;
default:
break;
}
break;
case "TEXTAREA":
_28.value="";
break;
default:
break;
}
}
break;
case "GO_URL":
window.location.href=gReturnURL+window.location.search;
break;
}
}
function dialogDelayEvent(_29,_2a){
if(_29>0){
var _2b="dialogBtn";
if(!_succBtn(_2b,_29)){
return false;
}
_29--;
setTimeout("dialogDelayEvent("+_29+",'"+_2a+"')",1000);
}else{
eval(_2a);
return true;
}
}
function dialogClose(){
var _2c=new Array("dialog");
for(key in _2c){
if($(_2c[key])){
$(_2c[key]).parentNode.removeChild($(_2c[key]));
}
}
var _2d=$(dialogBgId);
if(_2d){
if(timerId){
window.clearInterval(timerId);
}
Opacity=initOpacity;
if(nav=="IE"){
_2d.style.filter="Alpha(Opacity="+initOpacity+")";
}else{
_2d.style.opacity=initOpacity;
}
_2d.style.display="none";
}
}
function dialogClose1(){
dialogClose()
CssSelect("ConBto","none");
CssSelect("Login","block");
Login.innerHTML="<IFRAME id=headlogin marginWidth=0 marginHeight=0 src=\"/user/showlogin.aspx?Url="+btoa+"\" frameBorder=0 width=460 scrolling=no height=300></IFRAME>";
}
function getData(){
var _30=gSubmitElem;
var _31="";
for(key in _30){
value=encodeURIComponent(getValue(_30[key]));
_31+="&"+_30[key]+"="+value;
}
return _31;
}
function getRadioValue(_32){
var _33=$a(_32);
var _34=_33.length;
var _35=false;
for(var i=0;i<_34;i++){
if(_33[i].checked){
_35=_33[i].value;
break;
}
}
return _35;
}
function getCheckBoxValue(id){
var obj=$(id);
if(obj.checked){
return obj.value;
}
return false;
}
function getSelectValue(id){
var _3a=$(id);
return _3a.options[_3a.selectedIndex].value;
}
function getValue(id){
var obj=$(id);
var _3d=obj.tagName;
switch(_3d){
case "INPUT":
var _3e=obj.type;
switch(_3e){
case "radio":
value=getRadioValue(id);
break;
case "checkbox":
value=getCheckBoxValue(id);
break;
default:
value=obj.value;
break;
}
break;
case "SELECT":
value=getSelectValue(id);
break;
case "TEXTAREA":
value=obj.value;
break;
default:
value=false;
break;
}
return value;
}
function createXMLHttpRequest(){
xmlhttp=false;
try{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E){
xmlhttp=false;
}
}
if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){
xmlhttp=new XMLHttpRequest();
}
return xmlhttp;
}
function CssSelect(id,css){
choose=document.getElementById(id);
choose.style.display=css;
choose=null;
}
function sendRequest(){
dialogBg();
dialogBgShade();
dialog();
Bto1.innerHTML="<input id=ShtmlID type=\"hidden\" value=\""+urla+"\">";
if(!chkSubmit()){
return false;
}
var _41=createXMLHttpRequest();
if(!_41){
dialogShow("Err","&#21019;&#24314;&#88;&#77;&#76;&#72;&#84;&#84;&#80;&#23545;&#35937;&#22833;&#36133;&#65281;");
}
var _42=getData();
var url=gRequestURL?gRequestURL:window.location;
try{
_41.open(gRequestMethod,url,true);
}
catch(e){
dialogShow("Err","&#38169;&#35823;&#65306;"+e);
}
_41.onreadystatechange=dealRequest;
_41.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
if(gDebug&&_41.overrideMimeType){
_41.overrideMimeType("text/xml");
}
_41.send(_42);
function dealRequest(){
if(_41.readyState==1){
dialogShow("Note","&#25968;&#25454;&#21152;&#36733;&#20013;&#46;&#46;&#46;&#46;&#46;&#46;");
}
if(_41.readyState==4){
if(_41.status==200){
try{
var _44=_41.responseText;

if(_44=="ML"){
dialogShow("BtoOpen","&#27491;&#22312;&#39564;&#35777;&#26159;&#21542;&#30331;&#38470;");
CssSelect("ConBto","none");
CssSelect("Login","block");
Login.innerHTML="<IFRAME id=headlogin marginWidth=0 marginHeight=0 src=\"/user/InsertMail.aspx?Url="+btoa+"\" frameBorder=0 width=460 scrolling=no height=300></IFRAME>";
	}
else if(_44=="No"){
dialogShow("BtoLogin","<b>&#23545;&#19981;&#36215;&#65292;&#24744;&#36824;&#27809;&#26377;&#27880;&#20876;&#25110;&#30331;&#24405;</b><br><div style=\"text-align:left; line-height:16px;\">&#27880;&#20876;&#25110;&#30331;&#24405;&#21518;&#21487;&#27983;&#35272;&#20840;&#37096;&#24050;&#32463;&#21457;&#24067;&#22312;&#26412;&#31449;&#30340;&#25968;&#25454;&#20449;&#24687;&#65292;&#20197;&#21450;&#20170;&#21518;&#23558;&#23450;&#26399;&#12289;&#36830;&#32493;&#21457;&#24067;&#30340;&#26356;&#22810;&#25968;&#25454;&#20449;&#24687;&#65292;&#20197;&#21450;&#33719;&#24471;&#20026;&#27880;&#20876;&#20250;&#21592;&#25552;&#20379;&#30340;&#21508;&#39033;&#28145;&#24230;&#25968;&#25454;&#26381;&#21153;&#65292;&#35874;&#35874;&#65281;</div><br>[<a href=/user/reg.shtml>&#27880;&#20876;</a>]&nbsp;&nbsp;[<a onClick=\"dialogClose1();\" style=\"cursor: hand;\">&#30331;&#38470;</a>]");
}else{
dialogShow("BtoOpen","&#27491;&#22312;&#39564;&#35777;&#26159;&#21542;&#30331;&#38470;");
CssSelect("ConBto","block");
coun.innerHTML=_44;
ReviewShow.innerHTML="\&#12304;<a href=\"/Bto/Review.shtml?"+urla+"\"> &#26597;&#30475; </a>&#12305;";
Btoiframe.innerHTML="<IFRAME id=headlogin marginWidth=0  marginHeight=0 src=\"/bto/Reviewadd.html?"+urla+"\" frameBorder=0 width=100% scrolling=no height=25 onload=\"this.height=this.contentWindow.document.body.scrollHeight\"></IFRAME>";
}
}
catch(e){
dialogShow("Err","&#26381;&#21153;&#22120;&#38169;&#35823;&#65281;"+e);
}
}else{
dialogShow("Err","&#38169;&#35823;&#65306;"+_41.status+"server:"+_41.statusText);
}
}
}
}

