//定义变量
var YHC_AlphaDown = 0;
var YHC_AlphaUp = 0;
var TmpDivAlphaUp,TmpDivAlphaDown;
var TheFun = function (){};
var YHC_DivFrameName = "LKF_DivFrame"; //遮罩下拉列表层
var YHC_DivBackGroundName = "LKF_DivBG"; //背景层
var YHC_DivBackGroundColor = "#000"; //背景层颜色
var YHC_DivBackGroundAlpha = "0.47"; //背景层透明度
var YHC_DivShowName = "LKF_DivShow"; //显示层名称
var YHC_DivRemindName = "LKF_DivRemind"; //提示层名称
var YHC_DivRemindFrameName = "LKF_DivRemindFrame"; //遮罩下拉列表层
var YHC_DefaultWidth = 350; //显示层默认宽度
var YHC_DefaultHeight = 160; //显示层默认高度
var YHC_DivShowSpeed = 1.5; //层显示速度
var YHC_DivHideSpeed = 1.1; //层隐藏速度
var BodyOverflow = "";
var RemindImageType = "png";

if(navigator.userAgent.toLowerCase().indexOf("msie 6.0") >= 0)
{
  RemindImageType = "gif";
}
//显示对话框
var YHC_ShowBodyHead = "<div id=" + YHC_DivShowName + " class=YHC_MSGBoxShow>";
YHC_ShowBodyHead = YHC_ShowBodyHead + "<div class=YHC_MSGBoxShowTitle ><input type=button hidefocus=true title='按空格键或Enter键可以关闭此消息框 :)' class=YHC_DivShowCloseButton id=YHC_CloseButton onclick='CloseMSG();' onmouseover=\"this.className='YHC_DivShowCloseButton2'\" onmouseout=\"this.className='YHC_DivShowCloseButton'\" onmousedown=\"this.className='YHC_DivShowCloseButtonDown'\"  /></div>";
YHC_ShowBodyHead = YHC_ShowBodyHead + "<table height='100%' width='100%' cellpadding=0 cellspacing=0><tr><td height=4><img src='/images/MSGBodyTop.gif' /></td></tr><tr>";
YHC_ShowBodyHead = YHC_ShowBodyHead + "<td class=YHC_DivShowBody background='/images/MSGBodyMiddle.gif'>";
var YHC_ShowBodyLast = "</td></tr><tr><td height=4><img src='/images/MSGBodyBottom.gif' /></td></tr><tr><td height=4><img src='/images/MSGBottom.gif' /></td></tr></table></div>";

//显示层
var YHC_ShowDivHead = "<div id=" + YHC_DivShowName + " class=YHC_DivShow>";
YHC_ShowDivHead = YHC_ShowDivHead + "<div class=YHC_DivShowTitle ><input type=button hidefocus=true title='按空格键或Enter键可以关闭此消息框 :)' class=YHC_DivShowCloseButton id=YHC_CloseButton onclick='CloseMSG();' onmouseover=\"this.className='YHC_DivShowCloseButton2'\" onmouseout=\"this.className='YHC_DivShowCloseButton'\" onmousedown=\"this.className='YHC_DivShowCloseButtonDown'\"  /></div>";
YHC_ShowDivHead = YHC_ShowDivHead + "<table width='100%' cellpadding=0 cellspacing=0><tr><td class=YHC_DivShowBody>";
var YHC_ShowDivLast = "</td></tr></table></div>";

//提示层(箭头在下)
var YHC_RemindTopDivHead = "<div id=" + YHC_DivRemindName + " onclick='hideRemindDiv()'>";
YHC_RemindTopDivHead += "<table cellpadding=0 cellspacing=0>";
YHC_RemindTopDivHead += "<tr><td><img src='/images/Remind_LT." + RemindImageType + "' width=6 height=6 /></td><td rowspan=4 style='background-repeat:repeat-x' background='/images/Remind_Center.png'><table cellpaddin=0 cellspacing=0><tr><td style='height:35px;padding-left:10px;padding-right:10px;color:#fff'>";
var YHC_RemindTopDivLast = "</td></tr></table><div id=RemindDivBottom style='padding-left:3px;'><img src='/images/Remind_Arrow." + RemindImageType + "' width=15 height=9 /></div></td><td><img src='/images/Remind_RT." + RemindImageType + "' width=6 height=6 /></td></tr>";
YHC_RemindTopDivLast += "<tr><td><img src='/images/Remind_LM.png' /></td><td><img src='/images/Remind_RM.png' /></td></tr>";
YHC_RemindTopDivLast += "<tr><td><img src='/images/Remind_LB." + RemindImageType + "' width=6 height=6 /></td><td><img src='/images/Remind_RB." + RemindImageType + "' width=6 height=6 /></td></tr>";
YHC_RemindTopDivLast += "<tr><td height=9></td><td></td></tr></table></div>";
//提示层(箭头在上)
var YHC_RemindBottomDivHead = "<div id=" + YHC_DivRemindName + " onclick='hideRemindDiv()'>";
YHC_RemindBottomDivHead += "<table cellpadding=0 cellspacing=0><tr><td height=11></td><td rowspan=4 style='background-repeat:repeat-x;background-position:bottom' background='/images/Remind_Center.png'><div id=RemindDivBottom style='padding-left:3px;'><img src='/images/Remind_ArrowUp." + RemindImageType + "' width=15 height=11 /></div><table cellpaddin=0 cellspacing=0><tr><td style='height:35px;padding-left:10px;padding-right:10px;color:#fff'>";
YHC_RemindBottomDivHead += "";
var YHC_RemindBottomDivLast = "</td></tr></table></td><td></td></tr><tr><td><img src='/images/Remind_LT." + RemindImageType + "' width=6 height=6 /></td><td><img src='/images/Remind_RT." + RemindImageType + "' width=6 height=6 /></td></tr>";
YHC_RemindBottomDivLast += "<tr><td><img src='/images/Remind_LM.png' /></td><td><img src='/images/Remind_RM.png' /></td></tr>";
YHC_RemindBottomDivLast += "<tr><td><img src='/images/Remind_LB." + RemindImageType + "' width=6 height=6 /></td><td><img src='/images/Remind_RB." + RemindImageType + "' width=6 height=6 /></td></tr>";
YHC_RemindBottomDivLast += "</table></div>";

//弹窗层
var YHC_SystemMSGHTML1 = "<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td background='/images/SystemMSGThemeTop.gif' height=32><table cellpadding=0 cellspacing=0 border=0 width='100%'><tr><td style='font-weight:bold;font-size:13px;padding-left:15px;color:#fff;'>";
var YHC_SystemMSGHTML2 = "</td><td align=right style='padding-right:7px;'><span style='cursor:pointer;' onclick='CloseSystemMSG(";
var YHC_SystemMSGHTML3 = ")'>×</span></td></tr></table></td></tr><tr><td align=center height=110 background='/images/SystemMSGThemeMiddle.gif' style='padding:5px;'>";
var YHC_SystemMSGHTML4 = "</td></tr><tr><td><img src='/images/SystemMSGThemeBottom.gif' /></td></tr></table>";

//创建层对象
function CreateDiv()
{
  var nowBodyWidth = document.body.scrollLeft + document.body.clientWidth;
  var nowBodyHeight = document.body.scrollTop + document.body.clientHeight;

  //创建遮罩层对象
  var FrameObj = document.createElement("iframe");
  FrameObj.id = YHC_DivFrameName;
  FrameObj.style.position = "absolute";
  FrameObj.frameBorder = "0";
  FrameObj.style.top = "0";
  FrameObj.style.left = "0";
  FrameObj.style.filter = "Alpha(Opacity = 0)";
  FrameObj.style.width = nowBodyWidth;
  FrameObj.style.height = nowBodyHeight;
  FrameObj.style.zIndex = "1000";
  document.body.appendChild(FrameObj);

  //创建背景层对象
  var DivBGObj = document.createElement("div");
  DivBGObj.id = YHC_DivBackGroundName;
  DivBGObj.style.position = "absolute";
  DivBGObj.style.top = "0";
  DivBGObj.style.left = "0";
  DivBGObj.style.backgroundColor = YHC_DivBackGroundColor;
  DivBGObj.style.MozOpacity = YHC_DivBackGroundAlpha;
  DivBGObj.style.width = nowBodyWidth;
  DivBGObj.style.height = nowBodyHeight;;
  DivBGObj.style.zIndex = "1001";
  document.body.appendChild(DivBGObj);

  //创建显示层对象
  var DivObj = document.createElement("div");
  DivObj.id = YHC_DivShowName;
  DivObj.style.position = "absolute";
  DivObj.style.height = YHC_DefaultHeight;
  DivObj.style.width = YHC_DefaultWidth;
  DivObj.style.top = (nowBodyHeight - YHC_DefaultHeight)/2;
  DivObj.style.left = (nowBodyWidth - YHC_DefaultWidth)/2;
  DivObj.style.zIndex = "1002";
  document.body.appendChild(DivObj);

  //创建提示遮罩层对象
  var RemindFrameObj = document.createElement("iframe");
  RemindFrameObj.id = YHC_DivRemindFrameName;
  RemindFrameObj.style.position = "absolute";
  RemindFrameObj.frameBorder = "0";
  RemindFrameObj.style.top = "0";
  RemindFrameObj.style.left = "0";
  RemindFrameObj.style.height = "0";
  RemindFrameObj.style.width = "0";
  RemindFrameObj.style.filter = "Alpha(Opacity = 0)";
  RemindFrameObj.style.zIndex = "997";
  document.body.appendChild(RemindFrameObj);

  //创建提示层对象
  var DivRemind = document.createElement("div");
  DivRemind.id = YHC_DivRemindName;
  DivRemind.style.position = "absolute";
  DivRemind.style.top = 0;
  DivRemind.style.left = 0;
  DivRemind.style.zIndex = "998";
  document.body.appendChild(DivRemind);

  document.getElementById(YHC_DivShowName).innerHTML =  YHC_ShowBodyHead + YHC_ShowBodyLast;

  document.getElementById(YHC_DivFrameName).style.display = "none";
  document.getElementById(YHC_DivBackGroundName).style.display = "none";
  document.getElementById(YHC_DivShowName).style.display = "none";
}

//添加WindowReSize到onload事件
if(document.all)
{
  //IE
  window.attachEvent('onload',JSinit);
  window.attachEvent('onresize',WindowReSize);
} 
else
{
  //火狐
  window.addEventListener('load',JSinit,true);
  window.addEventListener('resize',WindowReSize,false);
}

//初始化
function JSinit()
{
  //加载样式文件
  /*
  if(document.createStyleSheet)
  {
    document.createStyleSheet("/css/main.css");
  }
  else
  {
    var cssObj = document.createElement("link");
    cssObj.href = "/css/main.css";
    cssObj.type = "text/css";
    cssObj.rel = "stylesheet";
    document.getElementsByTagName('head')[0].appendChild(cssObj);
  }
  */

  //隐藏加载状态层
  if(window.top.document.getElementById("DivLoadMain"))
  {
    window.top.document.getElementById("DivLoadMain").style.display = "none";
  }
  //创建消息层
  CreateDiv();

  //表单自动适应窗口
  AutoWidth();
}

//
function StyleForName(StyleName)
{

  for(var i=0;i<document.styleSheets.length;i++)
  { 
    var rules;
    if(document.styleSheets[i].cssRules)
    {
      rules = document.styleSheets[i].cssRules;
    }
    else
    { 
    rules = document.styleSheets[i].rules;
    }
  }
  
  for(var j=0;j<rules.length;j++)
  {
    if(rules[j].selectorText == StyleName)
    {
      return rules[j].style;
    }
  } 
}

//窗口改变调整
function WindowReSize()
{
  //表单自动适应窗口
  AutoWidth();
  //位置重新设置
  NewSize();
}

//位置重新设置
function NewSize()
{
  var nowBodyWidth = document.body.scrollLeft + document.body.clientWidth;
  var nowBodyHeight = document.body.scrollTop + document.body.clientHeight;
  document.getElementById(YHC_DivShowName).style.top = document.body.scrollTop + document.body.clientHeight/2 - YHC_DefaultHeight/2;
  document.getElementById(YHC_DivShowName).style.left = document.body.scrollLeft + document.body.clientWidth/2 - YHC_DefaultWidth/2;
  document.getElementById(YHC_DivShowName).style.height = YHC_DefaultHeight;
  document.getElementById(YHC_DivBackGroundName).style.width = nowBodyWidth;
  document.getElementById(YHC_DivFrameName).style.width = nowBodyWidth;
  if(document.body.scrollHeight < nowBodyHeight)
  {
    document.getElementById(YHC_DivBackGroundName).style.height = nowBodyHeight;
    document.getElementById(YHC_DivFrameName).style.height = nowBodyHeight;
  }
  else
  {
    document.getElementById(YHC_DivBackGroundName).style.height = document.body.scrollHeight;
    document.getElementById(YHC_DivFrameName).style.height = document.body.scrollHeight;
  }
}


//表单自动适应窗口
function AutoWidth()
{
  var Obj_Input = document.getElementsByTagName("input");
  for(var i=0;i<Obj_Input.length;i++)
  {
    if(Obj_Input[i].MyWidth)
    {
      Obj_Input[i].style.width = document.body.clientWidth/Obj_Input[i].MyWidth;
    }
  }
  var Obj_Select = document.getElementsByTagName("select");
  for(var i=0;i<Obj_Select.length;i++)
  {
    if(Obj_Select[i].MyWidth)
    {
      Obj_Select[i].style.width = document.body.clientWidth/Obj_Select[i].MyWidth;
    }
  }
  var Obj_Textarea = document.getElementsByTagName("textarea");
  for(var i=0;i<Obj_Textarea.length;i++)
  {
    if(Obj_Textarea[i].MyWidth)
    {
      Obj_Textarea[i].style.width = document.body.clientWidth/Obj_Textarea[i].MyWidth;
    }
  }
}

//显示对话框
function ShowMSG(TheMSG)
{
  //document.body.style.overflow = "hidden";
  document.getElementById(YHC_DivShowName).style.filter = "alpha(opacity=0)";
  document.getElementById(YHC_DivBackGroundName).style.filter = "alpha(opacity=0)";
  document.getElementById(YHC_DivShowName).innerHTML =  YHC_ShowBodyHead + TheMSG + YHC_ShowBodyLast;
  YHC_DefaultWidth = "350";
  YHC_DefaultHeight = "200";
  NewSize();
  document.getElementById(YHC_DivShowName).style.display = "block";
  document.getElementById(YHC_DivBackGroundName).style.display = "block";
  document.getElementById(YHC_DivFrameName).style.display = "block";
  document.getElementById("YHC_CloseButton").focus();
  YHC_AlphaUp = 0;
  TmpDivAlphaUp = window.clearInterval(TmpDivAlphaUp);
  TmpDivAlphaDown = window.clearInterval(TmpDivAlphaDown);
  TmpDivAlphaUp = setInterval("DivAlphaUp()");
}

//显示层
function ShowDIV(TheMSG)
{
  //document.body.style.overflow = "hidden";
  document.getElementById(YHC_DivShowName).style.filter = "alpha(opacity=0)";
  document.getElementById(YHC_DivBackGroundName).style.filter = "alpha(opacity=0)";
  document.getElementById(YHC_DivShowName).innerHTML = YHC_ShowDivHead + TheMSG + YHC_ShowDivLast;
  YHC_DefaultWidth = "350";
  YHC_DefaultHeight = "200";
  NewSize();
  document.getElementById(YHC_DivShowName).style.display = "block";
  document.getElementById(YHC_DivBackGroundName).style.display = "block";
  document.getElementById(YHC_DivFrameName).style.display = "block";
  document.getElementById("YHC_CloseButton").focus();
  YHC_AlphaUp = 0;
  TmpDivAlphaUp = window.clearInterval(TmpDivAlphaUp);
  TmpDivAlphaDown = window.clearInterval(TmpDivAlphaDown);
  TmpDivAlphaUp = setInterval("DivAlphaUp()");
}

//显示层(Big)
function ShowDivBig(TheMSG,TheButton)
{
  //BodyOverflow = document.body.style.overflow;
  document.getElementById(YHC_DivShowName).style.width = "350px";
  document.getElementById(YHC_DivShowName).style.height = "200px";
  var DivBody;
  DivBody = "";
  DivBody = DivBody + "<table cellpadding=0 cellspacing=0 width='350' height='200' bgcolor='#ffffff'>\n";
  DivBody = DivBody + "  <tr>\n";
  DivBody = DivBody + "    <td align=right background='/images/MSGTitleBG01.gif' height=30>\n";
  DivBody = DivBody + "      <input type=button hidefocus=true title='按空格键或Enter键可以关闭此消息框 :)'\n";
  DivBody = DivBody + "        style='background-color:#ECF5FF;width:13px;height:13px;margin-right:13px;\n";
  DivBody = DivBody + "        background-image:url(\"/images/MSGCloseButtonFace.gif\");border:0;'\n";
  DivBody = DivBody + "        id=closebutton onclick='CloseMSG();'\n";
  DivBody = DivBody + "        onmouseover='this.style.backgroundImage=\"url(/images/MSGCloseButtonBack.gif)\"'\n";
  DivBody = DivBody + "        onmouseout='this.style.backgroundImage=\"url(/images/MSGCloseButtonFace.gif)\"'\n";
  DivBody = DivBody + "      />\n";
  DivBody = DivBody + "    </td>\n";
  DivBody = DivBody + "  </tr>\n";
  DivBody = DivBody + "  <tr>\n";
  DivBody = DivBody + "    <td align=center style='line-height:250%;font-size:12px;'>\n";
  DivBody = DivBody + "      " + TheMSG
  DivBody = DivBody + "    </td>\n";
  DivBody = DivBody + "  </tr>\n";
  if(TheButton != "")
  {
    DivBody = DivBody + "  <tr>\n";
    DivBody = DivBody + "   <td align=center height=50 style='padding-bottom:10px;'>\n";
    for(var i=0;i<TheButton.length;i++)
    {
      DivBody = DivBody + "      <a href='" + TheButton[i][1] + "' class=button001>" + TheButton[i][0] + "</a>\n";
    }
    DivBody = DivBody + "    </td>\n";
    DivBody = DivBody + "  </tr>\n";
  }
  DivBody = DivBody + "</table>";
  document.getElementById(YHC_DivShowName).innerHTML =  DivBody;
  document.getElementById(YHC_DivShowName).style.filter = "alpha(opacity=0)";
  document.getElementById(YHC_DivShowName).style.MozOpacity = 0;
  document.getElementById(YHC_DivBackGroundName).style.filter = "alpha(opacity=0)";
  document.getElementById(YHC_DivBackGroundName).style.MozOpacity = 0;
  document.getElementById(YHC_DivShowName).style.display = "block";
  NewSize();
  document.getElementById(YHC_DivBackGroundName).style.display = "block";
  document.getElementById(YHC_DivFrameName).style.display = "block";
  document.getElementById("closebutton").focus();
  YHC_AlphaUp = 0;
  TmpDivAlphaUp = window.clearInterval(TmpDivAlphaUp);
  TmpDivAlphaDown = window.clearInterval(TmpDivAlphaDown);
  TmpDivAlphaUp = setInterval("DivAlphaUp()");
}

//显示加载
function ShowLoading()
{
  ShowMSG("Loading...");
  document.getElementById(YHC_DivShowName).innerHTML = "<table style='width:" + YHC_DefaultWidth + "px;height:" + YHC_DefaultHeight + "px;'><tr><td align=center><img src='/images/Doing.gif' /></td></tr></table>";
  document.getElementById(YHC_DivShowName).style.backgroundColor = "";
}

//隐藏层
function CloseMSG()
{
  if(TheFun != null){TheFun();}
  YHC_AlphaDown = YHC_DivBackGroundAlpha*100;
  TmpDivAlphaDown = setInterval("DivAlphaDown()");
  TheFun = function (){};
}

//层渐显
function DivAlphaUp()
{
  TmpDivAlphaDown = window.clearInterval(TmpDivAlphaDown);
  if(YHC_AlphaUp > (99 - YHC_DivBackGroundAlpha * 100))
  {
    document.getElementById(YHC_DivBackGroundName).style.filter = "alpha(opacity=" + (YHC_AlphaUp-(99 - YHC_DivBackGroundAlpha * 100)) + ")";
    document.getElementById(YHC_DivBackGroundName).style.MozOpacity = (YHC_AlphaUp-(99 - YHC_DivBackGroundAlpha * 100))/100;
  }
  document.getElementById(YHC_DivShowName).style.filter = "alpha(opacity=" + YHC_AlphaUp + ")";
  document.getElementById(YHC_DivShowName).style.MozOpacity = YHC_AlphaUp/100;
  YHC_AlphaUp = YHC_AlphaUp + Math.ceil((100 - YHC_AlphaUp)/YHC_DivShowSpeed);
  if(YHC_AlphaUp >= 100)
  {
    document.getElementById(YHC_DivBackGroundName).style.filter = "alpha(opacity=" + YHC_DivBackGroundAlpha*100 + ")";
    document.getElementById(YHC_DivBackGroundName).style.MozOpacity = YHC_DivBackGroundAlpha;
    document.getElementById(YHC_DivShowName).style.filter = "alpha(opacity=100)";
    document.getElementById(YHC_DivShowName).style.MozOpacity = "1";
    TmpDivAlphaUp = window.clearInterval(TmpDivAlphaUp);
  }
  else
  {
    TmpDivAlphaUp = setInterval("DivAlphaUp()");
  }
}
//层渐隐
function DivAlphaDown()
{
  TmpDivAlphaUp = window.clearInterval(TmpDivAlphaUp);
  document.getElementById(YHC_DivBackGroundName).style.filter = "alpha(opacity=" + YHC_AlphaDown + ")";
  document.getElementById(YHC_DivBackGroundName).style.MozOpacity = YHC_AlphaDown/100;
  document.getElementById(YHC_DivShowName).style.filter = "alpha(opacity=" + YHC_AlphaDown + ")";
  document.getElementById(YHC_DivShowName).style.MozOpacity = YHC_AlphaDown/100;
  YHC_AlphaDown = YHC_AlphaDown - Math.ceil(YHC_AlphaDown/YHC_DivHideSpeed);
  if(YHC_AlphaDown <= 0)
  {
    //document.body.style.overflow = BodyOverflow;
    TmpDivAlphaDown = window.clearInterval(TmpDivAlphaDown);
    document.getElementById(YHC_DivShowName).style.display = "none";
    document.getElementById(YHC_DivBackGroundName).style.display = "none";
    document.getElementById(YHC_DivFrameName).style.display = "none";
  }
  else
  {
    TmpDivAlphaDown = setInterval("DivAlphaDown()");
  }
}

//提示层显示
function RemindMSG(theOBJ,theMSG,theAlign,theShowTime)
{
  var theTop = theOBJ.offsetTop;
  var theLeft = theOBJ.offsetLeft;
  var height = theOBJ.offsetHeight;
  var OBJWidth = theOBJ.offsetWidth;
  var newLeft = 0;
  while(theOBJ = theOBJ.offsetParent)
  {
    if(theOBJ.tagName=="DIV")
    {
      theTop += theOBJ.offsetTop - theOBJ.scrollTop;
    }
    else
    {
      theTop += theOBJ.offsetTop;
    }
    theLeft += theOBJ.offsetLeft;
  }
  newLeft = theLeft;
  document.getElementById(YHC_DivRemindName).innerHTML = YHC_RemindTopDivHead + theMSG + YHC_RemindTopDivLast;
  document.getElementById(YHC_DivRemindName).style.wordBreak = 'keep-all';
  if(document.getElementById(YHC_DivRemindName).offsetHeight != 0)
  {
    theTop -= document.getElementById(YHC_DivRemindName).offsetHeight - 1;
  }
  if(document.body.clientWidth < (newLeft + document.getElementById(YHC_DivRemindName).offsetWidth))
  {
    document.getElementById("RemindDivBottom").style.textAlign = 'right';
    document.getElementById("RemindDivBottom").style.paddingRight = document.body.clientWidth - theLeft - OBJWidth/2 - 12;
    newLeft = document.body.clientWidth - document.getElementById(YHC_DivRemindName).offsetWidth;
  }
  if(newLeft < 0)
  {
    newLeft = 0;
    document.getElementById("RemindDivBottom").style.textAlign = 'left';
    document.getElementById("RemindDivBottom").style.paddingLeft = (theLeft + OBJWidth/2 - 12) < 0 ? 0 : theLeft + OBJWidth/2 - 12;
  }
  if(document.body.scrollTop >= theTop)
  {
    document.getElementById(YHC_DivRemindName).innerHTML = YHC_RemindBottomDivHead + theMSG + YHC_RemindBottomDivLast;
    theTop = theTop + height + document.getElementById(YHC_DivRemindName).offsetHeight - 4;
  }
  if(theAlign == 'center')
  {
    document.getElementById("RemindDivBottom").style.textAlign = 'center';
    newLeft = newLeft - document.getElementById(YHC_DivRemindName).offsetWidth/2 + OBJWidth/2;
  }
  document.getElementById(YHC_DivRemindFrameName).style.width = document.getElementById(YHC_DivRemindName).offsetWidth;
  document.getElementById(YHC_DivRemindFrameName).style.height = document.getElementById(YHC_DivRemindName).offsetHeight;
  document.getElementById(YHC_DivRemindFrameName).style.top = theTop;
  document.getElementById(YHC_DivRemindFrameName).style.left = newLeft;
  document.getElementById(YHC_DivRemindFrameName).style.display = "block";
  document.getElementById(YHC_DivRemindName).style.top = theTop;
  document.getElementById(YHC_DivRemindName).style.left = newLeft;
  document.getElementById(YHC_DivRemindName).style.visibility = "visible";
  
  if(theShowTime > 0)
  {
    setTimeout("hideRemindDiv()",theShowTime * 1000);
  }
}
//提示层隐藏
function hideRemindDiv()
{
  document.getElementById(YHC_DivRemindName).style.visibility = "hidden";
  document.getElementById(YHC_DivRemindFrameName).style.display = "none";
}

//检查电话号码
function checkTel(Obj)
{
  if(Obj.value=="" || Obj.value.length == 0)
  {
    hideRemindDiv();
  }
  else if(Obj.value.replace(/0\d{9,11}/,"") != "" && Obj.value.replace(/\d{3,4}-\d{7,8}/,"") != "" && Obj.value.replace(/[^0]\d{6,7}/,"") != "" && Obj.value.replace(/\d{3}-\d{3}-\d{4}/,"") != "" && Obj.value.replace(/\d{3,4}-\d{7,8}-\d{1,4}/,"") != "" && Obj.value.replace(/\d{7,8}-\d{1,4}/,"") != "")
  {
    Obj.style.color = '#ff0000';
    RemindMSG(Obj,'电话号码不正确！正确格式：<br />01012345678<br />010-12345678<br />12345678');
  }
  else
  {
    Obj.style.color = '#000000';
    RemindMSG(Obj,'长度：'+Obj.value.length);
  }
}
//检查手机号码
function checkMobile(Obj)
{
  if(Obj.value=="" || Obj.value.length == 0)
  {
    hideRemindDiv();
  }
  else if(Obj.value.replace(/\d{11}/,"") != "")
  {
    Obj.style.color = '#ff0000';
    RemindMSG(Obj,'手机号码不正确！');
  }
  else
  {
    Obj.style.color = '#000000';
    RemindMSG(Obj,'长度：'+Obj.value.length);
  }
}
var TestN = 0;
function ShowSystemMSG(theTitle,theMSG)
{
  TestN++;
  //创建弹窗层对象
  var DivBGObj = document.createElement("div");
  DivBGObj.id = "SystemMSGDiv" + TestN;
  DivBGObj.style.position = "absolute";
  DivBGObj.style.top = document.body.clientHeight - 152;
  DivBGObj.style.left = document.body.clientWidth - 202;
  DivBGObj.style.width = 200;
  DivBGObj.style.height = 150;
  DivBGObj.style.zIndex = "1001";
  document.body.appendChild(DivBGObj);
  DivBGObj.innerHTML = YHC_SystemMSGHTML1 + theTitle + TestN + YHC_SystemMSGHTML2 + TestN + YHC_SystemMSGHTML3 + theMSG + YHC_SystemMSGHTML4;
  DivBGObj.style.display = "block";
}

function CloseSystemMSG(theID)
{
  document.getElementById("SystemMSGDiv" + theID).parentNode.removeChild(document.getElementById("SystemMSGDiv" + theID));
}

window.onscroll = function ()
{
  for(var i=0;i<=TestN;i++)
  {
    if(document.getElementById("SystemMSGDiv" + i))
    {
      document.getElementById("SystemMSGDiv" + i).style.top = document.body.clientHeight + document.body.scrollTop - 152;
    }
  }
};

function Select_ArrowOnclick(SelectObject,SelectInputText)
{
  if(SelectObject.style.display == "none" || SelectObject.style.display == "")
  {
    SelectObject.style.display = "block";
    SelectObject.focus();
  }
  else
  {
    SelectObject.style.display = "none";
  }
}

function Select_ItemOnclick(SelectInputText,SelectInput,SelectItem,SelectObject)
{
  SelectInputText.value = SelectItem.innerHTML;
  SelectInput.value = SelectItem.value;
  SelectObject.style.display = "none";
}

//字节单位计算
String.prototype.lenB = function(){return this.replace(/[^\x00-\xff]/g, "**").length;};

//弹出窗口
function openWindow(url)
{
  var tmpAObj = document.createElement("a");
  tmpAObj.target = "_blank";
  tmpAObj.href = url;
  document.body.appendChild(tmpAObj);
  tmpAObj.click();
  document.body.removeChild(tmpAObj);
}
