// JavaScript Document
var moz = (typeof document.implementation != 'undefined') 
        && (typeof document.implementation.createDocument != 'undefined');
var ie = (typeof window.ActiveXObject != 'undefined');
var xmlHttp_;
if (window.XMLHttpRequest) xmlHttp_ = new XMLHttpRequest();
else if (window.ActiveXObject) xmlHttp_ = new ActiveXObject("MSXML2.XMLHTTP");

var baseURL = "/ego";

function getMsgParent() {
    if (window.parent.parent != undefined) {
        return window.parent.parent;
    } else if (window.parent != undefined) {
        return window.parent;        
    } else {
        return self;
    }
}

function isLogined($url, $evalJS) {
    var result = false;
    xmlHttp_.open("POST", $url, false);
    /* 设置处理服务器的JS函数，函数又 xmlHttp.onreadystatechange来确定 */
    xmlHttp_.onreadystatechange = function() {
        if (xmlHttp_.readyState == 4 && xmlHttp_.status == 200) {
            //ajax的json传输的解析。获取解析的数据
            var text = xmlHttp_.responseText;
            if (text) {
                eval("var obj = " + text);
            } else {
                var obj = null;
            }
            if (obj == null) {
                result = true;
                return;
            } else if ($evalJS && obj.javascript) {
                var js = obj.javascript;
                if (undefined != js && "" != js) {
                    eval(js);
                    result = false;
                    return;
                }
            } else {
                var codeValue = obj.code;
                var infoValue = obj.info;
                getMsgParent().showMessage(codeValue, infoValue);
            }
        } else if (xmlHttp_.readyState == 4) {
            getMsgParent().showMessage(null, "请求用户登录状态时，发生服务异常。远程服务器响应码：" + xmlHttp_.status);
            result = false;
            return;
        }
    };
    xmlHttp_.send();
    return result;
}

/**
 * 没有登录的跳转页面
 */
function loginfrist(baseURL){
    top.location.href = baseURL + "/showLogin.do";
}

/**
 * 查看购物车
 */
function showShoppingCar()
{
    if(isLogined(baseURL + "/isLoginAjax.do", true))
    {
        if(window.parent.parent != undefined)
            window.parent.parent.location.href = baseURL + "/viewShopCarInShop.do?type=topShopcarButton&page=newProductList";
        else if(window.parent != undefined)
            window.parent.location.href = baseURL + "/viewShopCarInShop.do?type=topShopcarButton&page=newProductList";
        else
            window.location.href = baseURL + "/viewShopCarInShop.do?type=topShopcarButton&page=newProductList";
    } else {
        return false;
    }
    return true;
}

/**
 *查看我的专区
 */
function showMyZone(){
    if (isLogined(baseURL + "/isLoginAjax.do", true)) {
        if (window.parent.parent != undefined)
            window.parent.parent.location.href = baseURL + "/viewMemberInfo.do?styleClass=viewMemberInfo1"; else if (window.parent != undefined)
            window.parent.location.href = baseURL + "/viewMemberInfo.do?styleClass=viewMemberInfo1"; else
            window.location.href = baseURL + "/viewMemberInfo.do?styleClass=viewMemberInfo1";
    } else {
        return false;
    }
    return true;
}

/**
 * 查看我的订单
 */
function showMyOrder() {
    if (isLogined(baseURL + "/isLoginAjax.do", true)) {
        if (window.parent.parent != undefined)
            window.parent.parent.location.href = baseURL + "/listPortalOrder.do?orderStatusQuery=-1,0,1,2,3,4,5&styleClass=myOrder";
        else if (window.parent != undefined)
            window.parent.location.href = baseURL + "/listPortalOrder.do?orderStatusQuery=-1,0,1,2,3,4,5&styleClass=myOrder";
        else
            window.location.href = baseURL + "/listPortalOrder.do?orderStatusQuery=-1,0,1,2,3,4,5&styleClass=myOrder";
    } else {
        return false;
    }
    return true;
}

function show3DMarket() {
    if (isLogined(baseURL + "/isLoginAjax.do", true)) {
        if (window.parent.parent != undefined)
            window.parent.parent.open(baseURL + "/web/portal/3dSale/main.jsp", "addpromotionDetail", "height=600,width=800,top=140,left=112,status=off");
        else if (window.parent != undefined)
            window.parent.open(baseURL + "/web/portal/3dSale/main.jsp", "addpromotionDetail", "height=600,width=800,top=140,left=112,status=off");
        else
            window.open(baseURL + "/web/portal/3dSale/main.jsp", "addpromotionDetail", "height=600,width=800,top=140,left=112,status=off");
    } else {
        return false;
    }
    return true;
}
function purchase(merchandiseCode, realPath, merchandiseType, merchandiseName, price1, baseURL, buyNum) {
    var options = {
        merchandiseCode: merchandiseCode,
        realPath: realPath,
        merchandiseType: merchandiseType,
        merchandiseName: merchandiseName,
        price1: price1,
        baseURL: baseURL,
        buyNum: buyNum
    };
    return purchase2(options);
}
/**
 * 立即购买事件
 */
function purchase2(options) {
    if (options.merchandiseType == "2") {
        // top.location.href = baseURL + "/showMerdiseDetail.do?isbuy=1&id="+merchandiseCode;
    } else {
        var ok = false;
        if (options.attributeId!=undefined) {
            ok = isLogined(options.baseURL + "/isLoginAjax.do?merchandiseCode="+options.merchandiseCode+"&attributeId="+options.attributeId, true);
        } else {
            ok = isLogined(options.baseURL + "/isLoginAjax.do?merchandiseCode="+options.merchandiseCode, true);
        }
        if (ok) {
            window.open(options.baseURL + "/quickBuyOrder.do?merchandiseCode=" + options.merchandiseCode + "&buyNum=" + options.buyNum + "&bookingDate=" + options.bookingDate + "&bookingTime=" + options.bookingTime + "&attributeId=" + options.attributeId);
        } else {
            return false;
        }
    }
    return true;
}
/**
 * 立即购买事件
 */
function reservationStarTicket(urlName, baseURL, merchandiseCode) {
    var url = baseURL + "/isLoginAjax.do?StarTicketCode="+merchandiseCode+"&cmtsCodeValue=cmtsCode";
    if (isLogined(url, true)) {
        window.open(urlName);
    } else {
        return false;
    }
    return true;
}
/**
 * 满天星订座优惠券
 */
function starSeatCoupon(urlName, baseURL, merchandiseCode) {
    var url = baseURL + "/isLoginAjax.do?SeatCouponCode=" + merchandiseCode + "&SeatCoupon=SeatCoupon";
    if (isLogined(url, true)) {
        window.open(urlName);
    } else {
        return false;
    }
    return true;
}
/**
 * 满天星订座优惠券
 */
function starCommonCoupon(urlName, baseURL, merchandiseCode) {
    var url = baseURL + "/isLoginAjax.do?CommonCouponCode=" + merchandiseCode + "&CommonCoupon=CommonCoupon";
    if (isLogined(url, true)) {
        window.open(urlName);
    } else {
        return false;
    }
    return true;
}
//银旅通电子门票购买
function buyYltTicket(merchandiseCode, realPath, merchandiseType, merchandiseName, price1, baseURL) {
    var url = baseURL + "/isLoginAjax.do?merchandiseCode=" + merchandiseCode;
    if (isLogined(url, true)) {
        var num = 0;
        if (window.parent != undefined) {
            if (window.parent.document.getElementById("stocks1") != undefined)
                num = window.parent.document.getElementById("stocks1").value;
            top.location.href = baseURL + "/quickBuyOrder.do?merchandiseCode=" + merchandiseCode + "&buyNum=" + num;
        } else {
            if (window.document.getElementById("stocks1") != undefined)
                num = window.document.getElementById("stocks1").value;
            top.location.href = baseURL + "/quickBuyOrder.do?merchandiseCode=" + merchandiseCode + "&buyNum=" + num;
        }
    }
}
//广州客运汽车票购买
function buygzky(merchandiseCode,baseURL) {
    var url = baseURL + "/isLoginAjax.do?merchandiseCode=" + merchandiseCode;
    if (isLogined(url, true)) {
        var num = 0;
        if (window.parent != undefined) {
            var  urlName= baseURL + "/gzkyNavigation.do?merchandiseCode="+merchandiseCode+"&gzkyNavigation=" + "gzkyIndex";
            window.open(urlName);
        } else {
            var  urlName= baseURL + "/gzkyNavigation.do?merchandiseCode="+merchandiseCode+"&gzkyNavigation=" + "gzkyIndex";
            window.open(urlName);
        }
    }
}
function addToShopcar(merchandiseCode,merchandiseType,baseURL,page) {
    var option = {
        merchandiseCode:merchandiseCode,
        merchandiseType:merchandiseType,
        baseURL:baseURL,
        page:page
    };
    return addToShopcar2(option);
}
/**
 * 加入购物车事件
 */
function addToShopcar2(options) {
    if (options.merchandiseType == "2") {
        return;
    }
    var num = 1;
    if (window.document.getElementById("stocks1") != undefined)
        num = window.document.getElementById("stocks1").value;
    var ok = false;
    var road = parseInt(Math.random() * 1000000);
    var url = options.baseURL + "/addToShopCarInShop.do?merchandiseCode=" + options.merchandiseCode + "&buyNum=" + num + "&uid=" + (road);
    if (options.attributeId!=undefined) {
        ok = isLogined(options.baseURL + "/isLoginAjax.do?merchandiseCode="+options.merchandiseCode+"&attributeId="+options.attributeId, true);
        url = options.baseURL+"/addToShopCarInShop.do?merchandiseCode="+options.merchandiseCode+"&buyNum="+num+"&attributeId="+options.attributeId+"&uid="+(road);
    } else {
        ok = isLogined(options.baseURL + "/isLoginAjax.do?merchandiseCode="+options.merchandiseCode, true);
    }
    if (ok) {
        xmlHttp_.open("GET", url, false);
        /* 设置处理服务器的JS函数，函数又 xmlHttp.onreadystatechange来确定 */
        xmlHttp_.onreadystatechange = function() {
            if (xmlHttp_.readyState == 4 && xmlHttp_.status == 200) {
                //ajax的XML传输的解析。获取解析的数据
                var text = xmlHttp_.responseText;
                eval("var textToObj=" + text);
                var codeValue = textToObj.code;
                var infoValue = textToObj.info;
                if (text != null && text != "") {
                    if (codeValue == "fail") {
                        getMsgParent().showMessage(codeValue, infoValue);
                        return false;
                    }
                    if (codeValue == "sucess") {
                        var textAll = infoValue.split(",");
                        var typeCount = textAll[0];
                        var numCount = textAll[1];
                        var totalAmount = textAll[2];
                        if (window.parent != undefined) {
                            //	if(merchandiseType == 5)
                            //   		toShoppingCar('');
                            //   	else
                            window.parent.showDiv1(typeCount, numCount, totalAmount, options.page);
                        } else {
                            //	if(merchandiseType == 5)
                            //   		toShoppingCar('');
                            //   	else
                            showDiv1(typeCount, numCount, totalAmount, options.page);
                        }
                    }
                } else {
                    getMsgParent().showMessage(null, "商品加入购物车出错，请稍候再试！");
                }
            } else if (xmlHttp_.readyState == 4) {
                getMsgParent().showMessage(null, "请求添加到购物车时，发生服务异常。远程服务器响应码：" + xmlHttp_.status);
                return false;
            }
            return true;
        };
        xmlHttp_.send();
    }
}


//查看购物车层
/**
 * 失去焦点
 */
var shoudClose = true;
function lostClose() {
    if (shoudClose) {
        document.getElementById('tips').style.display = 'none';
        //document.getElementById('ifDiv1').style.display = 'none';
    }

}

function showDiv1(typeCount,numCount,totalAmount,page) {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById('tips');

    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;
    document.getElementById("tips").focus();
    document.getElementById("typeCount").innerHTML = typeCount;
    document.getElementById("totalAmount_shoppingCar").innerHTML = parseFloat(totalAmount).toFixed(2);
    document.getElementById("page").value = page;
    /*
    var ifShow1 = document.getElementById('ifDiv1');
    ifShow1.height = detailHeight;
    ifShow1.width = detailWidth;
    ifShow1.style.posTop = y;
    ifShow1.style.posLeft = x;
    ifShow1.style.ZIndex = detailShow.style.ZIndex - 1;
    ifShow1.style.display = "";
    */
    document.getElementById("tips").focus();

}

function toShoppingCar(page) {
    if(page == '')
        page = document.getElementById("page").value;
    top.location.href= baseURL +"/viewShopCarInShop.do?page="+page;
}

function keekOnShopping() {
    var page = document.getElementById("page").value;
    if(page == 'showIndex')
        top.location.href= baseURL +"/showIndex.do";
    else if(page == 'newProductList')
        top.location.href= baseURL +"/advanceSearch.do?sortField=onFrameTime|0";
}

function init1(baseURL) {
    document.writeln("<div id=\"tips\" style=\"display:none;POSITION: absolute;Z-Index:100;\" onblur=\"lostClose();\" onmouseover=\"shoudClose=false;\" onmouseout=\"shoudClose=true;\"><input type=\"hidden\" id=\"page\" value=\"\">");
    document.writeln("<div id=\"tips_nav\" onblur=\"lostClose();\"><span>温馨提示</span><a href=\"javascript:shoudClose=true;lostClose();\"></a></div>");
    document.writeln("<div class=\"tImg\" onblur=\"lostClose();\"><img src=\"/ego/image/portal/newImages/addCar.jpg\" /></div>");
    document.writeln("<div class=\"tba\"><p onblur=\"lostClose();\">商品已添加到购物车！<br>购物车共 <span id=\"typeCount\"></span> 种商品    合计：<font style=\"color:#FF3300; font-weight:bold; font-size:13px; font-family:Tahoma;\">&yen;<span id=\"totalAmount_shoppingCar\">0</span></font> 元</p></div> ");
    document.writeln("<p onblur=\"lostClose();\" style=\"margin-top:10px;\"><a href=\"javascript:toShoppingCar(\'\')\"><img src=\"/ego/image/portal/newImages/addCar_button1.gif\" /></a>&nbsp;&nbsp;<a href=\"javascript:shoudClose=true;lostClose();\"><img src=\"/ego/image/portal/newImages/addCar_button2.gif\" /></a></p></div>");
    //document.write("<iframe id=\"ifDiv1\" src=\"javascript:false;\" scrolling=\"no\" frameborder=\"0\" style=\"position:absolute; top:0px; left:0px; display:none;\"><\/iframe>");
}


//立即购买层

/**
 * 失去焦点
 */
var shoudClose2 = true;
function lostClose2() {
    if (shoudClose2) {
        document.getElementById('DivContainer2').style.display = 'none';
        document.getElementById('ifDiv2').style.display = 'none';
    }

}
function showDiv2(merchandiseCode,realPath, merchandiseName, price,num, baseURL) {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow2 = document.getElementById('DivContainer2');

    detailShow2.style.display = "";
    var detailHeight2 = detailShow2.clientHeight;
    var detailWidth2 = detailShow2.clientWidth;
    var y = (documentElementy - detailHeight2) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth2) / 2 + document.documentElement.scrollLeft;
    detailShow2.style.posTop = y;
    detailShow2.style.posLeft = x;
    
    var ifShow2 = document.getElementById('ifDiv2');
    ifShow2.height = detailHeight2;
    ifShow2.width = detailWidth2;
    ifShow2.style.posTop = y;
    ifShow2.style.posLeft = x;
    ifShow2.style.ZIndex = detailShow2.style.ZIndex - 1;
    ifShow2.style.display = "";
    
    detailShow2.focus();
    var contText = document.getElementById("ContText");
    if (25 < merchandiseName.length) {
        contText.innerHTML = "您选购了<a href='" + realPath + "' class='Link12pxBR' target='_blank' title=\"" + merchandiseName + "\">" + merchandiseName.substring(0, 25) + "...</a>，请输入你想购买的数量：";
    } else {
        contText.innerHTML = "您选购了<a href='" + realPath + "' class='Link12pxBR' target='_blank' title=\"" + merchandiseName + "\">" + merchandiseName + "</a>，请输入你想购买的数量：";
    }
    document.getElementById("baseURL").value = baseURL;
    document.getElementById("merchandiseCode").value = merchandiseCode;
    var priceText = document.getElementById("div2_price");
    priceText.innerHTML = parseFloat(price).toFixed(2);
    var countText = document.getElementById("pay_count");
    var buyNum = document.getElementById("buyNum").value;
    if(num != '' && num != 0)
        buyNum = num;
    countText.innerHTML = (buyNum * price).toFixed(2);
    document.getElementById("buyNum").value = buyNum;
}

//判断数
function checkPrice(price) {
    var number = price.value;
    var re = new RegExp("^[1-9][0-9]*$");
    if (!re.test(number))
    {
        alert("请输入大于0的整数");
        price.value = "1";
        return false;
    }
    else
    {
        document.getElementById("pay_count").innerHTML = (number * document.getElementById("div2_price").innerText).toFixed(2);
        return true;
    }
}

function toPayList() {
    top.location.href = document.getElementById("baseURL").value + "/directPurchase.do?merchandiseCode=" + document.getElementById("merchandiseCode").value + "&buyNum=" + document.getElementById("buyNum").value;
}


function init2(baseURL) {
    document.write('<div id="DivContainer2" style="display:none;POSITION: absolute;Z-Index:1" onblur="lostClose2();"onmouseover="shoudClose2=false;" onmouseout="shoudClose2=true;">'
            + '<div id="Title" onblur="lostClose2();">'
            + '<div id="tishiText" onblur="lostClose2();">&nbsp;<img src="' + baseURL + '/image/portal/images/IcoEdit.gif" width="14" height="14" /> 请输入订购数量：</div><div id="BtnClose"><img src="' + baseURL + '/image/portal/images/icoclose.gif" style="cursor:pointer" onClick="shoudClose2=true;lostClose2()"/></div>'
            + '</div><div id="ContText">您选购了<a href="#" class="Link12pxBR">征途/巨人/征途时间版30元点卡</a>，请输入你想购买的数量：</div>'
            + '<input type="hidden" id="merchandiseCode" value="">'
            + '<input type="hidden" id="baseURL" value="">'
            + '<div id="TabConTainer">'
            + '<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" class="DivTabBor">'
            + '<tr><td height="25" align="center" class="DivTDBor" onblur="lostClose2();">会员价（元）</td><td align="center" class="DivTDBor" onblur="lostClose2();">数量（件）</td><td align="center" class="DivTDBor" onblur="lostClose2();">总价（元）</td></tr>'
            + '<tr><td height="30" align="center" class="DivTDBor" onblur="lostClose2();"><span id="div2_price">33.00</span></td><td align="center" class="DivTDBor" onblur="lostClose2();"><input name="buyNum" type="text" class="divFormSty" id="buyNum" value="1" maxlength="2" onblur="lostClose2();" onChange="return checkPrice(this);"/></td><td align="center" class="DivTDBor" onblur="lostClose2();"><strong class="Font12Red"><span id="pay_count">33.00</span></strong></td></tr></table>'
            + '</div><div id="BtnContainer"><img src="' + baseURL + '/image/portal/images/btnOrder.gif" width="108" height="26" style="cursor:pointer" onClick="toPayList()"/></div></div>')
    document.write('<iframe id="ifDiv2" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');
}


//登录警告层

/**
 * 失去焦点
 */
var shoudClose3 = true;
function lostClose3() {
    if (shoudClose3) {
        document.getElementById('DivContainer3').style.display = 'none';
    }

}

function showDiv3() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow3 = document.getElementById('DivContainer3');
    detailShow3.style.display = "";
    var detailHeight3 = detailShow3.clientHeight;
    var detailWidth3 = detailShow3.clientWidth;
    var y = (documentElementy - detailHeight3) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth3) / 2 + document.documentElement.scrollLeft;
    detailShow3.style.posTop = y;
    detailShow3.style.posLeft = x;
    document.getElementById("DivContainer3").focus();
}
function init3(baseURL) {
    document.write('<div id="DivContainer3" style="display:none;POSITION: absolute;" onblur="lostClose3();"onmouseover="shoudClose3=false;" onmouseout="shoudClose3=true;" >'
            + '<div id="Title2" onblur="lostClose3();">'
            + '<div id="WarnText" onblur="lostClose3();"> &nbsp;&nbsp;登录失败！</div>'
            + '<div id="BtnClose" style="cursor:pointer" onClick="shoudClose3=true;lostClose3()"><img src="' + baseURL + '/image/portal/images/icoclose.gif" /></div>'
            + '</div><table border="0" cellpadding="0" cellspacing="0" >'
            + '<tr>'
            + '<td><div id="IcoImg" onblur="javascript:lostClose3();"><img src="' + baseURL + '/image/portal/images/WarnIco.jpg" /></div></td><td align="center" valign="top"><div id="ContText2" onblur="javascript:lostClose3();">尊敬的用户，您所执行的操作需您成功登录后方可进行，操作失败的原因可能是您暂未登录或登录超时，请<a href="index.htm">重新登录</a>!</div></td>'
            + '</tr>'
            + '</table></div>');
}

//确认层

/**
 * 失去焦点
 */
var shoudClose5 = true;
function lostClose5() {
    if (shoudClose5) {
        document.getElementById('DivContainer5').style.display = 'none';
        document.getElementById('ifDiv').style.display = 'none';
    }

}

function showDiv5(url, msg) {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow5 = document.getElementById('DivContainer5');
    var ifShow = document.getElementById('ifDiv');

    detailShow5.style.display = "";
    var detailHeight5 = detailShow5.clientHeight;
    var detailWidth5 = detailShow5.clientWidth;
    var y = (documentElementy - detailHeight5) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth5) / 2 + document.documentElement.scrollLeft;
    detailShow5.style.posTop = y;
    detailShow5.style.posLeft = x;

    ifShow.height = detailHeight5;
    ifShow.width = detailWidth5;
    ifShow.style.posTop = y;
    ifShow.style.posLeft = x;
    ifShow.style.ZIndex = detailShow5.style.ZIndex - 1;
    ifShow.style.display = "";
    document.getElementById("DivContainer5").focus();
    var contText5 = document.getElementById("ContText5");
    contText5.innerHTML = msg + "<br/><a href='" + url + "' style='font-size: 15px;'>确定</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javaScript:shoudClose5=true;lostClose5()' style='font-size: 15px;'>取消</a>";
}

function init5(baseURL) {
    document.write('<div id="DivContainer5" style="display:none;POSITION: absolute;Z-Index:100;" onblur="lostClose5();"onmouseover="shoudClose5=false;" onmouseout="shoudClose5=true;">'
            + '<div id="Title4" onblur="lostClose5();">'
            + '	<div id="WarnText" onblur="lostClose5();"> &nbsp;&nbsp;删除提示</div>'
            + '	<div id="BtnClose" onblur="lostClose5();"><img src="' + baseURL + '/image/portal/images/icoclose.gif" onclick="shoudClose5=true;lostClose5()" style="cursor:pointer"/></div>'
            + '</div>'
            + '<div id="Context4" onblur="lostClose5();">'
            + '	<div id="IcoImg" onblur="lostClose5();"><img src="' + baseURL + '/image/portal/images/WarnIco4.jpg" width="64" height="64" /></div>'
            + '	<div id="ContText5" onblur="lostClose5();">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javaScript:shoudClose5=true;lostClose5()" style="font-size: 15px;">确定</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javaScript:shoudClose5=true;lostClose5()" style="font-size: 15px;">取消</a></div>'
            + '</div>'
            + '</div>');
    document.write('<iframe id="ifDiv" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');

}


//优惠券下载成功层
/**
 * 失去焦点
 */
var shoudClose6 = true;
function lostClose6() {
    if (shoudClose6) {
        document.getElementById("DivContainer6").style.display = 'none';
        document.getElementById('ifDiv2').style.display = 'none';
    }

}

function showDiv6() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow6 = document.getElementById('DivContainer6');

    detailShow6.style.display = "";
    var detailHeight6 = detailShow6.clientHeight;
    var detailWidth6 = detailShow6.clientWidth;
    var y = (documentElementy - detailHeight6) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth6) / 2 + document.documentElement.scrollLeft;
    detailShow6.style.posTop = y;
    detailShow6.style.posLeft = x;

    var ifShow2 = document.getElementById('ifDiv2');
    ifShow2.height = detailHeight6;
    ifShow2.width = detailWidth6;
    ifShow2.style.posTop = y;
    ifShow2.style.posLeft = x;
    ifShow2.style.ZIndex = detailShow6.style.ZIndex - 1;
    ifShow2.style.display = "";
    document.getElementById("DivContainer6").focus();
}
function init6() {
    document.write('<div id="DivContainer6" style="display:none;POSITION: absolute;Z-INDEX: 1;" onblur="lostClose6();" onmouseover="shoudClose6=false;" onmouseout="shoudClose6=true;">'
            + '<div id="Title4" onblur="lostClose6();">'
            + '<div id="WarnText"> &nbsp;&nbsp;下载成功！</div>'
            + '<div id="BtnClose"><img src="' + baseURL + '/image/portal/images/icoclose.gif" style="cursor:pointer" onclick="shoudClose6=true;lostClose6()"/></div>'
            + '</div>'
            + '<div id="Context4" onblur="lostClose6()">'
            + '<div id="IcoImg" onblur="lostClose6();"><img src="image/portal/images/WarnIco2.jpg" width="64" height="64" /></div>'
            + '<div id="ContText5" onblur="lostClose6();">下载优惠券成功，请注意查收您的彩信！</div></div></div>');
    document.write('<iframe id="ifDiv2" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');
}

//购买限制层
/**
 * 失去焦点
 */
var shoudClose7 = true;
function lostClose7() {
    if (shoudClose7) {
        document.getElementById("DivContainer7").style.display = 'none';
    }

}

function showDiv7() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow7 = document.getElementById('DivContainer7');

    detailShow7.style.display = "";
    var detailHeight7 = detailShow7.clientHeight;
    var detailWidth7 = detailShow7.clientWidth;
    var y = (documentElementy - detailHeight7) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth7) / 2 + document.documentElement.scrollLeft;
    detailShow7.style.posTop = y;
    detailShow7.style.posLeft = x;

    document.getElementById("DivContainer7").focus();
}
function toHelp1() {
    window.open("help1.htm");
    document.getElementById('DivContainer7').style.display = "none";
}

function init7() {
    document.write('<div id="DivContainer7" class="DivContainerPub5" style="display:none;POSITION: absolute;Z-INDEX: 100;" onblur="lostClose7();" onmouseover="shoudClose7=false;" onmouseout="shoudClose7=true;"><div id="Title4" onblur="lostClose7();"><div id="WarnText" onblur="lostClose7();"> &nbsp;&nbsp;购买限制！</div><div id="BtnClose" onblur="lostClose7();"><img src="' + baseURL + '/image/portal/images/icoclose.gif"  onclick="shoudClose7=true;lostClose7();" style="cursor:pointer"/></div></div><div id="Context4" onblur="lostClose7()"><div id="IcoImg" onblur="lostClose7();"><img src="' + baseURL + '/image/portal/images/tips_2.gif" width="70" height="70" onblur="lostClose7();" /></div><div id="ContText4" onblur="lostClose7();">尊敬的用户：该商品目前只限本地用户购买。&nbsp;<br />我需要：&nbsp;<a style="cursor:pointer" class="Link12Blue02" onClick=\"onHelp(\'DivContainer7\');\">帮助</a>&nbsp;&nbsp;<a onClick="shoudClose7=true;lostClose7();" class="Link12Blue02" style="cursor:pointer">关闭页面</a></div></div></div>');
}

//商品缺货层
/**
 * 失去焦点
 */
var shoudClose9 = true;
function lostClose9() {
    if (shoudClose9) {
        document.getElementById("DivContainer9").style.display = 'none';
    }

}

function showDiv9() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow9 = document.getElementById('DivContainer9');

    detailShow9.style.display = "";
    var detailHeight9 = detailShow9.clientHeight;
    var detailWidth9 = detailShow9.clientWidth;
    var y = (documentElementy - detailHeight9) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth9) / 2 + document.documentElement.scrollLeft;
    detailShow9.style.posTop = y;
    detailShow9.style.posLeft = x;

    document.getElementById("DivContainer9").focus();
}
function toHelp12() {
    window.open("help1.htm");
    document.getElementById('DivContainer9').style.display = "none";
}

function init9(baseURL) {
    document.write('<div id="DivContainer9" class="DivContainerPub5" style="display:none;POSITION: absolute;Z-INDEX: 100;" onblur="lostClose9();" onmouseover="shoudClose9=false;" onmouseout="shoudClose9=true;"><div id="Title4" onblur="lostClose9();"><div id="WarnText" onblur="lostClose9();"> &nbsp;&nbsp;商品缺货！</div><div id="BtnClose" onblur="lostClose9();"><img src="' + baseURL + '/image/portal/images/icoclose.gif"  onclick="shoudClose9=true;lostClose9();" style="cursor:pointer"/></div></div><div id="Context4" onblur="lostClose9()"><div id="IcoImg" onblur="lostClose9();"><img src="' + baseURL + '/image/portal/images/tips_2.gif" width="70" height="70" onblur="lostClose9();" /></div><div id="ContText4" onblur="lostClose9();">尊敬的用户：该商品暂时缺货，补充库存中…&nbsp;<br />我需要：&nbsp;<a style="cursor:pointer" class="Link12Blue02" onClick=\"onHelp(\'DivContainer9\');\">帮助</a>&nbsp;&nbsp;<a onClick="shoudClose9=true;lostClose9();" class="Link12Blue02" style="cursor:pointer">关闭页面</a></div></div></div>');
}

//消费限额层（全球通）
/**
 * 失去焦点
 */
var shoudClose4 = true;
function lostClose4() {
    if (shoudClose4) {
        document.getElementById("DivContainer4").style.display = 'none';
    }

}

function showDiv4() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow4 = document.getElementById('DivContainer4');

    detailShow4.style.display = "";
    var detailHeight4 = detailShow4.clientHeight;
    var detailWidth4 = detailShow4.clientWidth;
    var y = (documentElementy - detailHeight4) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth4) / 2 + document.documentElement.scrollLeft;
    detailShow4.style.posTop = y;
    detailShow4.style.posLeft = x;

    document.getElementById("DivContainer4").focus();
}
function toHelp4() {
    window.open("help1.htm");
    document.getElementById('DivContainer4').style.display = "none";
}

function init4(baseURL) {
    document.writeln("<div id=\"DivContainer4\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostClose4();\" onmouseover=\"shoudClose4=false;\" onmouseout=\"shoudClose4=true;\">");
    document.writeln("  <div id=\"Title2\" onblur=\"lostClose4();\">");
    document.writeln("    <div id=\"WarnText\"> &nbsp;&nbsp;消费限额！<\/div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image\/portal\/images\/icoclose.gif\" style=\"cursor:pointer\" onClick=\"shoudClose4=true;lostClose4()\"\/><\/div>");
    document.writeln("  <\/div>");
    document.writeln("<div class=\"conTestPub\" onclick=\"lostClose4()\">");
    document.writeln("  <div id=\"IcoImg2\" onblur=\"lostClose4();\"><img src=\"" + baseURL + "/image\/portal\/images\/tips_2.gif\" width=\"70\" height=\"70\" \/><\/div>");
    document.writeln("  <div id=\"ContText3\" onblur=\"lostClose4();\">尊敬的用户：您所登录的手机号码属全球通品牌，在本商城上每月消费的基础额度是50元，发送 HFED150 到 106586633 就可以把额度提升到150元； 发送 CXYE 到 106586633 查询当前话费支付账户余额！祝您购物愉快！");
    document.writeln(" &nbsp;<br \/>");
    document.writeln(" 我需要：&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"onHelp(\'DivContainer4\');\">帮助<\/a>&nbsp;&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"shoudClose4=true;lostClose4()\">关闭页面<\/a><\/div>");
    document.writeln("<\/div>");
    document.writeln("<\/div>");
    document.writeln("");
}


/**
 * 未登录提示层和消费限额层（智能网）
 */
var shoudCloseD = true;
function lostCloseD(id) {
    if (shoudCloseD) {
        document.getElementById(id).style.display = 'none';
        document.getElementById('ifDiv10').style.display = 'none';
    }

}

function showD() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById('DivContainer8');

    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;
	
    var ifShow10 = document.getElementById('ifDiv10');
    ifShow10.height = detailHeight;
    ifShow10.width = detailWidth;
    ifShow10.style.posTop = y;
    ifShow10.style.posLeft = x;
    ifShow10.style.ZIndex = detailShow.style.ZIndex - 1;
    ifShow10.style.display = "";
    document.getElementById("DivContainer8").focus();
}
function showD1() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById('div_container');

    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;
    document.getElementById("div_container").focus();
}
function onHelp(id) {
    window.open(baseURL+"/web/portal/common/bottom/help.jsp");
    document.getElementById(id).style.display = "none";
    document.getElementById('ifDiv10').style.display = 'none';
}
function onHelpVIP(id) {
    window.open(baseURL+"/memberVip.do");
    document.getElementById(id).style.display = "none";
    document.getElementById('ifDiv10').style.display = 'none';
}


//未登录提示层
function init10(baseURL) {
    document.writeln("<div id=\"DivContainer8\" class=\"DivContainerPub3\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostCloseD(\'DivContainer8\');\" onmouseover=\"shoudCloseD=false;\" onmouseout=\"shoudCloseD=true;\">");
    document.writeln("  <div id=\"Title2\" onblur=\"lostCloseD(\'DivContainer8\');\">");
    document.writeln("    <div id=\"WarnText\"> &nbsp;&nbsp;请登录！<\/div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image\/portal\/images\/icoclose.gif\" style=\"cursor:pointer\" onClick=\"shoudCloseD=true;lostCloseD(\'DivContainer8\')\"\/><\/div>");
    document.writeln("  <\/div>");
    document.writeln("<div onblur=\"lostcloseD(\'DivContainer8\');\" class=\"conTestPub\">");
    document.writeln("  <div id=\"IcoImg1\" onblur=\"lostCloseD(\'DivContainer8\');\"><img src=\"" + baseURL + "/image\/portal\/images\/tips_2.gif\" width=\"70\" height=\"70\" \/><\/div>");
    document.writeln("  <div id=\"ContText02\" onblur=\"lostCloseD(\'DivContainer8\');\">尊敬的用户：您尚未登录！请在首页登录框输入您的手机号码（此操作免费），马上享受更多优惠！");
    document.writeln(" &nbsp;<br \/>");
    document.writeln(" 我需要：&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"onHelp(\'DivContainer8\');\">帮助<\/a>&nbsp;&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"shoudCloseD=true;lostCloseD(\'DivContainer8\')\">关闭页面<\/a><\/div>");
    document.writeln("<\/div>");
    document.writeln("<\/div>");
    document.write('<iframe id="ifDiv10" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');

}

///公用信息提示
function showMessage(code,mes) {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById('DivContainerMes');

    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;
    document.getElementById("DivContainerMes").focus();
    document.getElementById("mesDiv").innerHTML = mes;
    if(code != '' && code == '不是VIP会员')
    {
        document.getElementById("help").innerHTML = "<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"onHelpVIP(\'DivContainerMes\');\">如何购买VIP会员服务？<\/a>";
    }    
}

//公用信息提示层
function initMessage() {
    document.writeln("<div id=\"DivContainerMes\" class=\"DivContainerPub3\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostCloseD(\'DivContainerMes\');\" onmouseover=\"shoudCloseD=false;\" onmouseout=\"shoudCloseD=true;\">");
    document.writeln("  <div id=\"Title2\" onblur=\"lostCloseD(\'DivContainerMes\');\">");
    document.writeln("    <div id=\"WarnText\"> &nbsp;&nbsp;提示信息<\/div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image\/portal\/images\/icoclose.gif\" style=\"cursor:pointer\" onClick=\"shoudCloseD=true;lostCloseD(\'DivContainerMes\')\"\/><\/div>");
    document.writeln("  <\/div>");
    document.writeln("<div onblur=\"lostcloseD(\'DivContainerMes\');\" class=\"conTestPub\">");
    document.writeln("  <div id=\"IcoImg1\" onblur=\"lostCloseD(\'DivContainerMes\');\"><img src=\"" + baseURL + "/image\/portal\/images\/tips_2.gif\" width=\"70\" height=\"70\" \/><\/div>");
    document.writeln("  <div id=\"ContText02\" onblur=\"lostCloseD(\'DivContainerMes\');\"><span id='mesDiv'></span>");
    document.writeln(" &nbsp;<br \/>");
    document.writeln(" 我需要：&nbsp;<span id=\"help\"><a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"onHelp(\'DivContainerMes\');\">帮助<\/a></span>&nbsp;&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"shoudCloseD=true;lostCloseD(\'DivContainerMes\')\">关闭页面<\/a><\/div>");
    document.writeln("<\/div>");
    document.writeln("<\/div>");
    document.write('<iframe id="ifDiv10" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');

}
////////////////



//消费限额层（智能网）
function init11(baseURL) {

    document.writeln("<div id=\"div_container\" class=\"DivContainerPub3\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostCloseD(\'div_container\');\" onmouseover=\"shoudCloseD=false;\" onmouseout=\"shoudCloseD=true;\">");
    document.writeln("  <div id=\"Title2\" onblur=\"lostCloseD(\'div_container\');\">");
    document.writeln("    <div id=\"WarnText\"> &nbsp;&nbsp;消费限额！<\/div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image\/portal\/images\/icoclose.gif\" style=\"cursor:pointer\" onClick=\"shoudCloseD=true;lostCloseD(\'div_container\')\"\/><\/div>");
    document.writeln("  <\/div>");
    document.writeln("<div onblur=\"lostcloseD(\'div_container\');\" class=\"conTestPub\">");
    document.writeln("  <div id=\"IcoImg1\" onblur=\"lostCloseD(\'div_container\');\"><img src=\"" + baseURL + "/image\/portal\/images\/tips_2.gif\" width=\"70\" height=\"70\" \/><\/div>");
    document.writeln("  <div id=\"ContText02\" onblur=\"lostCloseD(\'div_container\');\">尊敬的用户：您所登录的手机号码属智能网品牌，在本商城上的单笔消费限额为20元，每月消费额度为50元；请购买专属您的号码品牌商品！祝您购物愉快！");
    document.writeln(" &nbsp;<br \/>");
    document.writeln(" 我需要：&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"onHelp(\'div_container\');\">帮助<\/a>&nbsp;&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"shoudCloseD=true;lostCloseD(\'div_container\')\">关闭页面<\/a><\/div>");
    document.writeln("<\/div>");
    document.writeln("<\/div>");
}

/**
 * 失去焦点
 */
var shoudClose12 = true;
function lostClose12() {
    if (shoudClose12) {
        document.getElementById("DivContainer12").style.display = 'none';
        document.getElementById("ifDiv12").style.display = 'none';
    }

}

function showDiv12() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById('DivContainer12');

    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;

    var ifShow12 = document.getElementById('ifDiv12');
    ifShow12.height = detailHeight;
    ifShow12.width = detailWidth;
    ifShow12.style.posTop = y;
    ifShow12.style.posLeft = x;
    ifShow12.style.ZIndex = detailShow.style.ZIndex - 1;
    ifShow12.style.display = "";
    document.getElementById("DivContainer12").focus();
}
function toHelp12() {
    window.open("Help1.htm");
    document.getElementById("DivContainer12").style.display = "none";
}

function init12() {
    document.writeln("<div id=\"DivContainer12\" class=\"DivContainerPub3\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostClose12();\" onmouseover=\"shoudClose12=false;\" onmouseout=\"shoudClose12=true;\">");
    document.writeln("  <div id=\"Title2\" onblur=\"lostClose12();\">");
    document.writeln("    <div id=\"WarnText\"> &nbsp;&nbsp;配送限制！<\/div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"image\/portal\/images\/icoclose.gif\" style=\"cursor:pointer\" onClick=\"shoudClose12=true;lostClose12()\"\/><\/div>");
    document.writeln("  <\/div>");
    document.writeln("<div onblur=\"lostclose12();\" class=\"conTestPub\">");
    document.writeln("  <div id=\"IcoImg\" onblur=\"lostClose12();\"><img src=\"image\/portal\/images\/tips_2.gif\" width=\"70\" height=\"70\" \/><\/div>");
    document.writeln("  <div id=\"ContText2\" onblur=\"lostClose12();\">尊敬的用户：此商品的配送范围目前只限XX，请选择本地的收获人地址。");
    document.writeln(" &nbsp;<br \/>");
    document.writeln(" 我需要：&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\"  onClick=\"onHelp(\'DivContainer12\');\">帮助<\/a>&nbsp;&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"shoudClose12=true;lostClose12()\">关闭页面<\/a><\/div>");
    document.writeln("<\/div>");
    document.writeln("<\/div>");
    document.write('<iframe id="ifDiv12" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');
}

//礼包购买限制层
var shoudClose13 = true;
function lostClose13() {
    if (shoudClose13) {
        document.getElementById("DivContainer13").style.display = 'none';
    }

}

function showDiv13() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById('DivContainer13');

    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;

    document.getElementById("DivContainer13").focus();
}
function toHelp13() {
    window.open("Help1.htm");
    document.getElementById("DivContainer13").style.display = "none";
}

function init13(baseURL) {
    document.writeln("<div id=\"DivContainer13\" class=\"DivContainerPub3\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostClose13();\" onmouseover=\"shoudClose13=false;\" onmouseout=\"shoudClose13=true;\">");
    document.writeln("<div id=\"Title2\" onblur=\"lostClose13();\">");
    document.writeln("    <div id=\"WarnText\" onblur=\"lostClose13();\"> &nbsp;&nbsp;购买限制！<\/div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image\/portal\/images\/icoclose.gif\" onclick=\"shoudClose13=true;lostClose13();\" style=\"cursor:pointer\" \/><\/div>");
    document.writeln("  <\/div>");
    document.writeln("<div onblur=\"lostclose13();\" class=\"conTestPub\">");
    document.writeln("  <div id=\"IcoImg\" onblur=\"lostClose13();\"><img src=\"" + baseURL + "/image\/portal\/images\/WarnIco.jpg\" width=\"64\" height=\"64\" onblur=\"lostClose13();\" \/><\/div>");
    document.writeln("  <div id=\"ContText2\" onblur=\"lostClose13();\">尊敬的用户：该礼包最多只能选择<span class=\"Font12Red\"><b>5<\/b><\/span>件商品，您已选择了<span class=\"Font12Red\"><b>5<\/b><\/span>件，不能选择更多了。<br \/>");
    document.writeln("如您需要更多商品，可以调整已选择商品的种类或者另外单独购买。<\/div>");
    document.writeln("<\/div>");
    document.writeln("<\/div>");
}

//优惠券输入验证码层
var shoudClose14 = true;
function lostClose14() {
    if (shoudClose14) {
        document.getElementById("DivContainer14").style.display = "none";
        document.getElementById("ifDiv14").style.display = "none";
    }
}
function showDiv14() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow14 = document.getElementById("DivContainer14");
    detailShow14.style.display = "";
    var detailHeight14 = detailShow14.clientHeight;
    var detailWidth14 = detailShow14.clientWidth;
    var y = (documentElementy - detailHeight14) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth14) / 2 + document.documentElement.scrollLeft;
    detailShow14.style.posTop = y;
    detailShow14.style.posLeft = x;
    var ifShow14 = document.getElementById("ifDiv14");
    ifShow14.height = detailHeight14;
    ifShow14.width = detailWidth14;
    ifShow14.style.posTop = y;
    ifShow14.style.posLeft = x;
    ifShow14.style.ZIndex = detailShow14.style.ZIndex - 1;
    ifShow14.style.display = "";
    document.getElementById("DivContainer14").focus();
}
function init14() {
    document.writeln("<div id=\"DivContainer14\" class=\"DivContainerPub\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostClose14();\" onmouseover=\"shoudClose14=false;\" onmouseout=\"shoudClose14=true;\">");
    document.writeln("  <div id=\"Title\" onblur=\"lostClose14();\">");
    document.writeln("    <div id=\"tishiText\" onblur=\"lostClose14();\"> &nbsp;\u8bf7\u8f93\u5165\u968f\u673a\u9a8c\u8bc1\u7801\uff1a</div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image/portal/images/icoclose.gif\"  onclick=\"shoudClose14=true;lostClose14();\" style=\"cursor:pointer\" /></div>");
    document.writeln("  </div>");
    document.writeln("  <div id=\"ContText\" onblur=\"lostClose14();\">\u9a8c\u8bc1\u7801\uff1a&nbsp;&nbsp;&nbsp;");
    document.writeln("    <input onblur=\"lostClose14();\" style=\"height:13px;width:150px\" type=\"text\" name=\"textfield2\" id=\"textfield2\" />");
    document.writeln(" <img src=\"image/portal/images/couponCode.bmp\"/></div>");
    document.writeln("  <div id=\"BtnContainer\" onblur=\"lostClose14();\"><img src=\"image/portal/images/btnput.gif\" width=\"84\" height=\"26\" onclick=\"shoudClose14=true;lostClose14();showDiv6()\" style=\"cursor:pointer\" />&nbsp;</div>");
    document.writeln("</div>");
    document.write("<iframe id=\"ifDiv14\" src=\"javascript:false;\" scrolling=\"no\" frameborder=\"0\" style=\"position:absolute; top:0px; left:0px; display:none;\"></iframe>");
}
/**************************
 * 优惠券下载失败提示层
 *
 **************************/
var shoudClose15 = true;
function lostClose15() {
    if (shoudClose15) {
        document.getElementById("DivContainer15").style.display = "none";
        document.getElementById("ifDiv15").style.display = "none";
    }
}
function showDiv15() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow15 = document.getElementById("DivContainer15");
    detailShow15.style.display = "";
    var detailHeight15 = detailShow15.clientHeight;
    var detailWidth15 = detailShow15.clientWidth;
    var y = (documentElementy - detailHeight15) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth15) / 2 + document.documentElement.scrollLeft;
    detailShow15.style.posTop = y;
    detailShow15.style.posLeft = x;
    var ifShow15 = document.getElementById("ifDiv15");
    ifShow15.height = detailHeight15;
    ifShow15.width = detailWidth15;
    ifShow15.style.posTop = y;
    ifShow15.style.posLeft = x;
    ifShow15.style.ZIndex = detailShow15.style.ZIndex - 1;
    ifShow15.style.display = "";
    document.getElementById("DivContainer15").focus();
}
function toHelp15() {
    window.open("Help1.htm");
    document.getElementById("DivContainer15").style.display = "none";
}
function init15() {
    document.write("<div id=\"DivContainer15\" class=\"DivContainerPub5\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostClose15();\" onmouseover=\"shoudClose15=false;\" onmouseout=\"shoudClose15=true;\">"
            + "<div id=\"Title4\" onblur=\"lostClose15();\">"
            + "<div id=\"WarnText\">&nbsp;&nbsp;\u4e0b\u8f7d\u5931\u8d25\uff01</div>"
            + "<div id=\"BtnClose\"><img src=\"" + baseURL + "/image/portal/images/icoclose.gif\" style=\"cursor:pointer\" onclick=\"shoudClose15=true;lostClose15()\"/></div>"
            + "</div>"
            + "<div id=\"Context4\" onblur=\"lostclose15()\">"
            + "<div id=\"IcoImg\" onblur=\"lostClose15();\"><img src=\"" + baseURL + "/image/portal/images/WarnIco.jpg\" width=\"64\" height=\"64\" /></div>"
            + "<div id=\"ContText4\" onblur=\"lostClose15();\"><span id=\"voucherdownloaderrorinfo\"></span>&nbsp;&nbsp;&nbsp;" + "<br/>\u6211\u9700\u8981\uff1a&nbsp;<a href=\"javaScript:shoudClose15=true;lostClose15();\">关闭</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javaScript:toHelp15()\">\u5e2e\u52a9</a></div></div></div>");
    document.write("<iframe id=\"ifDiv15\" src=\"javascript:false;\" scrolling=\"no\" frameborder=\"0\" style=\"position:absolute; top:0px; left:0px; display:none;\"></iframe>");
}
/**************************
 * 优惠券下载数量提示层
 *
 **************************/
var shoudClose16 = true;
function lostClose16() {
    if (shoudClose16) {
        document.getElementById("DivContainer16").style.display = "none";
        document.getElementById("ifDiv16").style.display = "none";
    }
}
function showDiv16() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById("DivContainer16");
    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;
    var ifShow16 = document.getElementById("ifDiv16");
    ifShow16.height = detailHeight;
    ifShow16.width = detailWidth;
    ifShow16.style.posTop = y;
    ifShow16.style.posLeft = x;
    ifShow16.style.ZIndex = detailShow.style.ZIndex - 1;
    ifShow16.style.display = "";
    document.getElementById("DivContainer16").focus();
}
function toHelp16() {
    window.open("Help1.htm");
    document.getElementById("DivContainer16").style.display = "none";
}
function init16() {
    document.writeln("<div id=\"DivContainer16\" class=\"DivContainerPub3\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostClose16();\" onmouseover=\"shoudClose16=false;\" onmouseout=\"shoudClose16=true;\">");
    document.writeln("  <div id=\"Title2\" onblur=\"lostClose16();\">");
    document.writeln("    <div id=\"WarnText\"> &nbsp;&nbsp;\u4e0b\u8f7d\u6570\u91cf\u9650\u5236\uff01</div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image/portal/images/icoclose.gif\" style=\"cursor:pointer\" onClick=\"shoudClose16=true;lostClose16()\"/></div>");
    document.writeln("  </div>");
    document.writeln("<div onblur=\"lostclose13();\" class=\"conTestPub\">");
    document.writeln("  <div id=\"IcoImg\" onblur=\"lostClose16();\"><img src=\"" + baseURL + "/image/portal/images/tips_2.gif\" width=\"70\" height=\"70\" /></div>");
    document.writeln("  <div id=\"ContText2\" onblur=\"lostClose16();\">\u5c0a\u656c\u7684\u7528\u6237\uff1a\u4f60\u4e0b\u8f7d\u4f18\u60e0\u5238\u7684\u6570\u91cf\u5df2\u7ecf\u8d85\u8fc7\u4e86\u6700\u5927\u4e0b\u8f7d\u6570\u9650\u5236\uff0c\u4e0d\u80fd\u518d\u7ee7\u7eed\u4e0b\u8f7d\uff01");
    document.writeln(" &nbsp;<br />");
    document.writeln(" \u6211\u9700\u8981\uff1a&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"toHelp16();\">\u5e2e\u52a9</a>&nbsp;&nbsp;<a style=\"cursor:pointer\" class=\"Link12Blue02\" onClick=\"shoudClose16=true;lostClose16()\">\u5173\u95ed\u9875\u9762</a></div>");
    document.writeln("</div>");
    document.writeln("</div>");
    document.write("<iframe id=\"ifDiv16\" src=\"javascript:false;\" scrolling=\"no\" frameborder=\"0\" style=\"position:absolute; top:0px; left:0px; display:none;\"></iframe>");
}

//订单取消确认层

var shoudClose17 = true;
function lostClose17() {
    if (shoudClose17) {
        document.getElementById('DivContainer17').style.display = 'none';
        document.getElementById('ifDiv17').style.display = 'none';
    }

}

function showDiv17() {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow17 = document.getElementById('DivContainer17');
    var ifShow = document.getElementById('ifDiv17');

    detailShow17.style.display = "";
    var detailHeight17 = detailShow17.clientHeight;
    var detailWidth17 = detailShow17.clientWidth;
    var y = (documentElementy - detailHeight17) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth17) / 2 + document.documentElement.scrollLeft;
    detailShow17.style.posTop = y;
    detailShow17.style.posLeft = x;

    ifShow.height = detailHeight17;
    ifShow.width = detailWidth17;
    ifShow.style.posTop = y;
    ifShow.style.posLeft = x;
    ifShow.style.ZIndex = detailShow17.style.ZIndex - 1;
    ifShow.style.display = "";
    document.getElementById("DivContainer17").focus();
}

function getOrderDiscountInfo(merchantId,divId){
    var xmlHttp_ = new ActiveXObject("Msxml2.XMLHTTP");
    var random = parseInt(Math.random()*1000000);
    var url = baseURL + "/getMerchantDiscountAjax.do?uid="+(random)+"&merchantId="+merchantId;
    xmlHttp_.open("GET",url,false);
    xmlHttp_.onreadystatechange=function() {
        if (xmlHttp_.readyState==4 && xmlHttp_.status==200) {
            var returnText = xmlHttp_.responseText;
            if(returnText !=null && returnText != ""){
                var discountArray = returnText.split("and");
                var discountInfo="";
                var discountString = "";//显示的内容字符串
                var no = 0;//序号
                var divObject = document.getElementById("discountListDiv");
                for(var i =0;i< discountArray.length-1;i++){
                    no = i+1;
                    discountInfo = discountArray[i];
                    var infoArray = discountInfo.split(",");
                    discountString = discountString + "<li class='li01'>"+no+".参与打折的商品每满"+parseFloat(infoArray[0]).toFixed(2)+"元（含"+parseFloat(infoArray[0]).toFixed(2)+"元），打"+infoArray[1]+"折</li>";
                    if(i == discountArray.length -2){
                        no = no+1;
                        discountString = discountString+"<li class='li01'>"+no+".不同订单不可累计</li>";
                    }
                }
                divObject.innerHTML = discountString;
                showDiv(divId);
            }else{
                alert("尊敬的用户，内部系统错误，请稍候再试!");
            }
        }
        return true;
    }
    xmlHttp_.send();
}

//公用层调用方法，通过id调用
var shouldClose=true;
function closeDiv(id){
    if(shouldClose){
        document.getElementById(id).style.display='none';
        document.getElementById('ifid').style.display='none';
    }
}
function showDiv(id){
    var bodyx=document.documentElement.offsetWidth;
    var bodyy=document.documentElement.offsetHeight;
    var detailShow=document.getElementById(id);
    detailShow.style.display="";
    var detailHeight=detailShow.offsetHeight;
    var detailWidth=detailShow.offsetWidth;
    var y=(bodyy-detailHeight)/2+document.documentElement.scrollTop;
    var x=(bodyx-detailWidth)/2+document.documentElement.scrollLeft;
    detailShow.style.posTop=y;
    detailShow.style.posLeft=x;
	
    var ifShow=document.getElementById('ifid');
    ifShow.height=detailHeight;
    ifShow.width=detailWidth;
    ifShow.style.posTop=y;
    ifShow.style.posLeft=x;
    ifShow.style.ZIndex=detailShow.style.ZIndex-1;
    ifShow.style.display="";
    document.getElementById(id).focus();
}
function initIframe(){
    document.writeln("<iframe id=\"ifid\" src=\"javascript:false;\" scrolling=\"no\" frameborder=\"0\" style=\"position:absolute; top:0px; left:0px; display:none;\"><\/iframe>");
}
initIframe();

function init17() {
    document.write('<div id="DivContainer17" class="DivContainerPub5" style="display:none;POSITION: absolute;Z-INDEX: 100;" onblur="lostClose17();" onmouseover="shoudClose17=false;" onmouseout="shoudClose17=true;"><div id="Title4" onblur="lostClose17();"><div id="WarnText" onblur="lostClose17();"> &nbsp;&nbsp;订单取消提示！</div><div id="BtnClose" onblur="lostClose17();"><img src="' + baseURL + '/image/portal/images/icoclose.gif"  onclick="shoudClose17=true;lostClose17();" style="cursor:pointer"/></div></div><div id="Context4" onblur="lostClose17()"><div id="IcoImg" onblur="lostClose17();"><img src="' + baseURL + '/image/portal/images/tips_2.gif" width="70" height="70" onblur="lostClose17();" /></div><div id="ContText4" onblur="lostClose17();">尊敬的用户：您确定取消该订单吗？&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="cursor:pointer" class="Link12Blue02" onclick="shoudClose17=true;lostClose17();">确定</a>&nbsp;&nbsp;<a onClick="shoudClose17=true;lostClose17();" class="Link12Blue02" style="cursor:pointer">取消</a></div></div></div>');
    document.write('<iframe id="ifDiv17" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');

}

function fixElementSize($element) {
    var iframe = document.getElementById($element);
    try {
        var bHeight = iframe.contentWindow.document.documentElement.scrollHeight;
        var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
        var bWidth = iframe.contentWindow.document.documentElement.scrollWidth;
        var dWidth = iframe.contentWindow.document.documentElement.scrollWidth;
        var height = Math.max(bHeight, dHeight);
        var width = Math.max(bWidth, dWidth);
        iframe.height = height;
        iframe.width = width;
    } catch (ex) {
    }
}

///积分不足信息提示
function showIntegralMessage(code,mes) {
    var documentElementx = document.documentElement.clientWidth;
    var documentElementy = document.documentElement.clientHeight;
    var detailShow = document.getElementById('DivContainerIntegralMes');

    detailShow.style.display = "";
    var detailHeight = detailShow.clientHeight;
    var detailWidth = detailShow.clientWidth;
    var y = (documentElementy - detailHeight) / 2 + document.documentElement.scrollTop;
    var x = (documentElementx - detailWidth) / 2 + document.documentElement.scrollLeft;
    detailShow.style.posTop = y;
    detailShow.style.posLeft = x;
    document.getElementById("DivContainerIntegralMes").focus();
    document.getElementById("mesDivIntegral").innerHTML = "<p>尊敬的用户：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您的商城积分不足够完成本次订单支付，您可以先进行商城积分兑换，再重新提交订单支付；或选择使用网银支付。</p>";
    //document.getElementById("continuePay").onclick="continuePay();";
}

function openLink(link,w,h){
    if (link!=""){
        var url= link;// + ".jsp";
        var winW=w;
        var winH=h;
        var winX=(window.screen.width-winW)/2;
        var winY=(window.screen.height-winH)/2;
        var openArticle=window.open(url,'','left='+winX+',top='+winY+',width='+winW+',height='+winH+',toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');
        openArticle.focus();
    }
}
//积分兑换
function integral(){
	if (isLogined(baseURL + "/isLoginAjax.do", true)) {
    		openLink(baseURL+'/web/portal/warn/index.html',950,600);
    }                   		
	else
	{
		return false;
	}  
}
function continuePay() {
	var form = document.getElementById("form1");
	form.submit();
	document.getElementById("button3").disabled="disabled";
	shoudCloseD=true;
	lostCloseD("DivContainerIntegralMes");
}

//积分不足信息提示层
function initIntegralMessage() {
    document.writeln("<div id=\"DivContainerIntegralMes\" class=\"DivContainerPub3\" style=\"display:none;POSITION: absolute;Z-INDEX: 1;\" onblur=\"lostCloseD(\'DivContainerIntegralMes\');\" onmouseover=\"shoudCloseD=false;\" onmouseout=\"shoudCloseD=true;\">");
    document.writeln("  <div id=\"Title2\" onblur=\"lostCloseD(\'DivContainerIntegralMes\');\">");
    document.writeln("    <div id=\"WarnText\"> &nbsp;&nbsp;提示信息<\/div>");
    document.writeln("    <div id=\"BtnClose\"><img src=\"" + baseURL + "/image\/portal\/images\/icoclose.gif\" style=\"cursor:pointer\" onClick=\"shoudCloseD=true;lostCloseD(\'DivContainerIntegralMes\')\"\/><\/div>");
    document.writeln("  <\/div>");
    document.writeln("<div onblur=\"lostcloseD(\'DivContainerIntegralMes\');\" class=\"conTestPub\">");
    document.writeln("  <div id=\"IcoImg1\" onblur=\"lostCloseD(\'DivContainerIntegralMes\');\"><img src=\"" + baseURL + "/image\/portal\/images\/tips_2.gif\" width=\"70\" height=\"70\" \/><\/div>");
    document.writeln("  <div id=\"ContText02\" onblur=\"lostCloseD(\'DivContainerIntegralMes\');\"><span id='mesDivIntegral'></span>");
    document.writeln(" &nbsp;");
    document.writeln(" <p class=\"p2\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=\"" + baseURL + "/image\/portal\/images\/tips_button1.gif\" style=\"cursor:pointer;\" onclick=\"openLink('" + baseURL + "/integralTransaction.do?method=integralSwap',950,600);\"/>　<img id=\"continuePay\" src=\"" + baseURL + "/image\/portal\/images\/tips_button2.gif\" style=\"cursor:pointer;\" onclick=\"continuePay();\"/>　<img src=\"" + baseURL + "/image\/portal\/images\/tips_button3.gif\" style=\"cursor:pointer\" onclick=\"shoudCloseD=true;lostCloseD(\'DivContainerIntegralMes\')\"\/></p><br/><\/div>");
    document.writeln("<\/div>");
    document.writeln("<\/div>");
    document.write('<iframe id="ifDiv10" src="javascript:false;" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;"></iframe>');

}

initMessage();
initIntegralMessage();