﻿var browserHelper = new function() {
    /*加入到 收藏夹*/
    this.addFavorite = function(url, title) {
        if (document.all) {
            window.external.addFavorite(url, title);
        } else if (window.sidebar) {
            window.sidebar.addPanel(title, url, "");
        }
    }

    /*设为首页*/
    this.setHomePage = function(url) {
        if (document.all) {
            document.body.style.behavior = 'url(#default#homepage)';
            document.body.setHomePage(url);
        } else if (window.sidebar) {
            if (window.netscape) {
                try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                } catch (e) {
                    alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
                }
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage', url);
        }
    }
};


var siteHelper = new function() {

    /*顶部条*/
    this.writeTopBarHtml = function() {
        var html = "";

        html += '<div class="layout_header_r-10">   ';
        html += '    <div class="content">   ';
        html += '        <div class="left">   ';


        /*<script language="javascript" type="text/javascript">
        var currentSiteRootURL = window.location.protocol + "//" + window.location.host + ((window.location.port == "" || window.location.port == "80") ? "" : ":" + window.location.port) + "/"
        var loginURL = passport.siteRootURL + "login.aspx?returnurl=" + encodeURIComponent(window.location.href) + "&passportaccessurl=http3A2F2Fwww.eeku.cn2F_sso2Fpassport-access.aspx";
        var registerURL = passport.siteRootURL + "register.aspx?returnurl=" + encodeURIComponent(window.location.href) + "&passportaccessurl=http3A2F2Fwww.eeku.cn2F_sso2Fpassport-access.aspx";
        var logoutURL = passport.siteRootURL + "logout.aspx?returnurl=" + encodeURIComponent(window.location.href);
        if (passport.isLogin) {
        document.write('您好，' + passport.memberName + '！' + '<a href="' + logoutURL + '" title="退出登录">[退出]</a>');
        } else {
        document.write('您好，欢迎访问衣酷拿货网！' + '<a href="' + loginURL + '" title="登录">[登录]</a><a href="' + registerURL + '" title="请注册">[请注册]</a>');
        }
        </script>*/

        var currentSiteRootURL = window.location.protocol + "//" + window.location.host + ((window.location.port == "" || window.location.port == "80") ? "" : ":" + window.location.port) + "/"
        var loginURL = passport.siteRootURL + "login.aspx?returnurl=" + encodeURIComponent(window.location.href) + "&passportaccessurl=http3A2F2Fwww.eeku.cn2F_sso2Fpassport-access.aspx";
        var registerURL = passport.siteRootURL + "register.aspx?returnurl=" + encodeURIComponent(window.location.href) + "&passportaccessurl=http3A2F2Fwww.eeku.cn2F_sso2Fpassport-access.aspx";
        var logoutURL = passport.siteRootURL + "logout.aspx?returnurl=" + encodeURIComponent(window.location.href);
        if (passport.isLogin) {
            html += '您好，' + passport.memberName + '！' + '<a href="' + logoutURL + '" title="退出登录">[退出]</a>';
        } else {
            html += '您好，欢迎访问衣酷拿货网！' + '<a href="' + loginURL + '" title="登录">[登录]</a><a href="' + registerURL + '" title="请注册">[请注册]</a>';
        }


        html += '            <span class="sep">|</span>   ';
        html += '            <a href="http://my.eeku.cn/" title="我的衣酷">我的衣酷</a>   ';
        html += '            <span class="sep">|</span>   ';
        html += '            <a href="http://www.eeku.cn/browse/product/__time-desc___list_25__/" title="淘衣服">淘衣服</a>   ';
        html += '            <span class="sep">|</span>   ';
        html += '            <a href="http://www.eeku.cn/shop.aspx" title="逛店铺">逛店铺</a>   ';
        html += '            <span class="sep">|</span>   ';
        html += '            <a href="http://my.eeku.cn/shoppingcart/list.aspx" title="购物车">购物车</a>   ';
        html += '        </div>   ';
        html += '        <div class="right">   ';
        html += '            <a href="javascript:browserHelper.addFavorite(\'http://www.eeku.cn/\',\'衣酷拿货网首页\');" title="添加收藏"><span>添加收藏</span></a>   ';
        html += '            <a href="javascript:browserHelper.setHomePage(\'http://www.eeku.cn/\');" title="设为首页"><span>设为首页</span></a>   ';
        html += '            <a href="http://www.eeku.cn/help/" title="帮助中心"><span>帮助中心</span></a>   ';
        html += '            <a href="http://www.eeku.cn/help/support/29/" title="安全"><span>安全</span></a>   ';
        html += '        </div>   ';
        html += '    </div>   ';
        html += '</div>   ';

        document.write(html);
    }

    /*一级页面头部*/
    this.writeHeaderHtml = function() { 
    
    }

    /*二级页面头部*/
    this.writeHeaderHtml2 = function() { 
    
    }

};


/*用户控件Header里用到的方法*/
var ucHeader = new function() {
    this.submitSearchForm = function(keywordTips) {
        var searchType = document.getElementById("uc_Header_searchType").value;
        var keyword = document.getElementById("uc_Header_searchKeyowrd").value;
        if (keyword == keywordTips || keyword.length < 2) {
            alert("关键字长度不能小于2！");
            return;
        }
        if (searchType == "衣服") {
            window.location.href = "http://www.nahuo.com/Product/List.aspx?productListType=search&txtProductKeyword=" + encodeURIComponent(keyword);
        } else if (searchType == "店铺") {
            window.location.href = "http://www.nahuo.com/Shop/List.aspx?listType=search&txtKeyword=" + encodeURIComponent(keyword);
        } else if (searchType == "资讯") {
            window.location.href = "http://www.nahuo.com/News/List.aspx?keyword=" + encodeURIComponent(keyword);
        } else if (searchType == "晒货") {
            window.location.href = "http://www.nahuo.com/ShaiHuo/List.aspx?keywords=" + encodeURIComponent(keyword);
        }
    }
};




jQuery(document).ready(function(){

    
        /*<div style="display:block; position:absolute;">
        <img src="http://common.nahuo.com/img/page/bg_for_tips-right-html_001.jpg" alt="" style=" border:none;" usemap="#Map">
        <map id="Map2" name="Map">
            <area shape="rect" onmousemove="jQuery.displayTip('pifashichang-tips')" onmouseout="jQuery.hideTip('pifashichang-tips')" alt="全国批发市场信息，这里是最全的" coords="150,10,270,80" href="http://www.nahuo.com/PiFaShiChang/" />
            <area shape="rect" onmousemove="jQuery.displayTip('news-tips')" onmouseout="jQuery.hideTip('news-tips')" alt="网罗天下服装信息" coords="50,60,150,130" href="http://www.nahuo.com/News/" />
            <area shape="rect" onmousemove="jQuery.displayTip('shaihuo-tips')" onmouseout="jQuery.hideTip('shaihuo-tips')" alt="新款图片秀，晒货赢订单" coords="270,10,370,80" href="http://www.nahuo.com/ShaiHuo/" />
            <area shape="rect" onmousemove="jQuery.displayTip('pinhuo-tips')" onmouseout="jQuery.hideTip('pinhuo-tips')" alt="一件也能拿货法宝" coords="380,60,490,130" href="http://www.nahuo.com/PinHuo/" />
            <area shape="rect" onmousemove="jQuery.displayTip('pifaquan-tips')" onmouseout="jQuery.hideTip('pifaquan-tips')" alt="专题讨论，更显专业" coords="380,150,500,210" href="http://www.nahuo.com/PiFaQuan/" />
            <area shape="rect" onmousemove="jQuery.displayTip('xiangce-tips')" onmouseout="jQuery.hideTip('xiangce-tips')" alt="专为服装批发设计的相册" coords="260,200,390,270" href="http://photo.nahuo.com/" />
            <area shape="rect" onmousemove="jQuery.displayTip('luntan-tips')" onmouseout="jQuery.hideTip('luntan-tips')" alt="买卖双方零距离沟通" coords="160,210,250,260" href="http://www.nahuo.com/BBS/" />
            <area shape="rect" onmousemove="jQuery.displayTip('wangdian-tips')" onmouseout="jQuery.hideTip('wangdian-tips')" alt="网上做批发更容易" coords="50,150,160,225" href="http://www.nahuo.com/Shop/" />
        </map>
        <span class="pifashichang-tips">全国批发市场信息，这里是最全的</span>
        <span class="news-tips">网罗天下服装信息</span>
        <span class="shaihuo-tips">新款图片秀，晒货赢订单</span>
        <span class="pinhuo-tips">一件也能拿货法宝</span>
        <span class="pifaquan-tips">专题讨论，更显专业</span>
        <span class="xiangce-tips">专为服装批发设计的相册</span>
        <span class="luntan-tips">买卖双方零距离沟通</span>
        <span class="wangdian-tips">网上做批发更容易</span>*/
    
    var page_TipsRightHTML = "";

    page_TipsRightHTML+="<div class=\"zddt\">";
    page_TipsRightHTML+="   <img src=\"http://common.nahuo.com/img/page/bg_for_tips-right-html_001.jpg\" alt=\"站点地图\" usemap=\"#Map\">";
    page_TipsRightHTML+="   <map id=\"Map2\" name=\"Map\">";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('pifashichang-tips')\" onmouseout=\"jQuery.hideTip('pifashichang-tips')\" alt=\"全国批发市场信息，这里是最全的\" coords=\"150,10,270,80\" href=\"http://www.nahuo.com/PiFaShiChang/\" />";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('news-tips')\" onmouseout=\"jQuery.hideTip('news-tips')\" alt=\"网罗天下服装信息\" coords=\"50,60,150,130\" href=\"http://www.nahuo.com/News/\" />";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('shaihuo-tips')\" onmouseout=\"jQuery.hideTip('shaihuo-tips')\" alt=\"新款图片秀，晒货赢订单\" coords=\"270,10,370,80\" href=\"http://www.nahuo.com/ShaiHuo/\" />";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('pinhuo-tips')\" onmouseout=\"jQuery.hideTip('pinhuo-tips')\" alt=\"一件也能拿货法宝\" coords=\"380,60,490,130\" href=\"http://www.nahuo.com/PinHuo/\" />";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('pifaquan-tips')\" onmouseout=\"jQuery.hideTip('pifaquan-tips')\" alt=\"专题讨论，更显专业\" coords=\"380,150,500,210\" href=\"http://www.nahuo.com/PiFaQuan/\" />";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('xiangce-tips')\" onmouseout=\"jQuery.hideTip('xiangce-tips')\" alt=\"专为服装批发设计的相册\" coords=\"260,200,390,270\" href=\"http://photo.nahuo.com/\" />";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('luntan-tips')\" onmouseout=\"jQuery.hideTip('luntan-tips')\" alt=\"买卖双方零距离沟通\" coords=\"160,210,250,260\" href=\"http://www.nahuo.com/BBS/\" />";
    page_TipsRightHTML+="       <area shape=\"rect\" onmousemove=\"jQuery.displayTip('wangdian-tips')\" onmouseout=\"jQuery.hideTip('wangdian-tips')\" alt=\"网上做批发更容易\" coords=\"50,150,160,225\" href=\"http://www.nahuo.com/Shop/\" />";
    page_TipsRightHTML+="   </map>";
    page_TipsRightHTML+="</div>";
    //<!--资讯-->
    page_TipsRightHTML+="<span class=\"news-tips\">网罗天下服装信息</span>";
    //<!--批发市场-->
    page_TipsRightHTML+="<span class=\"pifashichang-tips\">全国批发市场信息，这里是最全的</span>";
    //<!--晒货-->
    page_TipsRightHTML+="<span class=\"shaihuo-tips\">新款图片秀，晒货赢订单</span>";
    //<!--拼货-->
    page_TipsRightHTML+="<span class=\"pinhuo-tips\">一件也能拿货法宝</span>";
    //<!--批发圈-->
    page_TipsRightHTML+="<span class=\"pifaquan-tips\">专题讨论，更显专业</span>";
    //<!--批发相册-->
    page_TipsRightHTML+="<span class=\"xiangce-tips\">专为服装批发设计的相册</span>";
    //<!--论坛-->
    page_TipsRightHTML+="<span class=\"luntan-tips\">买卖双方零距离沟通</span>";
    //<!--批发网点-->
    page_TipsRightHTML+="<span class=\"wangdian-tips\">网上做批发更容易</span>";

    jQuery(".layout_main-content .tips-right-html_001").html(page_TipsRightHTML);
    
        jQuery.displayTip = function(className) {
            $("." + className).css("display", "block");
            }

        jQuery.hideTip = function(className) {
            $("." + className).css("display", "none");
            }
});

