﻿// JScript 文件

var msgbox_msg;
var msgbox_iconType;
var msgbox_buttonCount;



//创建对话框
function ShowMsgBox(msg,iconType,canSubmitError)
{
    var msgboxDIV = document.getElementById("msgboxDIV");
    var msgDIV = document.getElementById("msgDIV");
    var btnDIV = document.getElementById("btnDIV");
    
    
    msgbox_msg = msg;
    msgbox_iconType = iconType;
    msgDIV.innerHTML = "<P>" + msg + "</P><BR/>";
    
    msgboxDIV.style.visibility = "visible";
   
}

//添加按钮
function AddMsgBtn(btnTitle,onHandle)
{
    var btnDIV = document.getElementById("btnDIV");
    btnDIV.innerHTML += "<button type=\"button\" class=\"btn\" onclick=\"ClearMsgBox();" + onHandle + "\">" + btnTitle + "</button>";
    msgbox_buttonCount++;
}

//清除对话框
function ClearMsgBox()
{
    var msgboxDIV = document.getElementById("msgboxDIV");
    var msgDIV = document.getElementById("msgDIV");
    var infoDIV = document.getElementById("info");

    
    msgboxDIV.style.visibility = "hidden";

    btnDIV.innerHTML = "";
    msgDIV.innerHTML = "";
    msgbox_msg = "";
    msgbox_buttonCount = 0;
    msgbox_iconType = 1;
}


function showOpDIV(isShow)
{
    var opDIV = document.getElementById("SysInfo");
    var noteLayerDIV = document.getElementById("NoteLayer");
    
    if (isShow)
    {
        opDIV.style.visibility = "visible";
        //noteLayerDIV.style.visibility = "visible";
    }
    else
    {
        //隐藏用户提示面板
        opDIV.style.visibility = "hidden";
        noteLayerDIV.style.visibility = "hidden";
    }    
}

function showInfoDIV()
{
    var msgDIV = document.getElementById("title");
    var infoDIV = document.getElementById("info");
    var btnDIV = document.getElementById("btn");
    msgDIV.style.visibility = "visible";
    infoDIV.style.display = "block";
    btnDIV.style.visibility = "hidden";
    if(GetSiteRootPath()=="-1")
    {
      infoDIV.innerHTML= infoDIV.innerHTML+"<div class='tishi'><div>"+
      "<p>汇元宝可使用所有带<img src='http://www.wowkaka.com/images/yinlian.gif' style='margin-bottom:-10px;'>标识的银行借记卡（即储蓄卡），进行刷卡交易！</p>"+
				  "<p class='red'>不支持贷记卡（即信用卡）刷卡交易！</p>"+
					"<p>如果您首次使用汇元宝进行支付，请<a href='http://www.wowkaka.com/bizs/LYBOperator/InstallerGuide.aspx' style='text-decoration:underline;' target='_blank'>点击此处</a>安装汇元宝盒驱动与插件。</p>"+
                "</div></div>";
    }
     else
    {
           infoDIV.innerHTML= infoDIV.innerHTML+"<div class='tishi'><div>"+
      "<p>汇元宝可使用所有带<img src='http://www.wowkaka.com/images/yinlian.gif' style='margin-bottom:-10px;'>标识的银行借记卡（即储蓄卡）</p>"+
					"<p>如果您首次使用汇元宝进行支付，请<a href='http://www.wowkaka.com/bizs/LYBOperator/InstallerGuide.aspx' style='text-decoration:underline;' target='_blank'>点击此处</a>安装汇元宝盒驱动与插件。</p>"+
                "</div></div>";      
     }
}
function GetSiteRootPath()
{
   var ppath = window.location.pathname; 

  
   var root =ppath.lastIndexOf("creditcard");//最后无'/'
   return root;
}

