var ops=0;
var root = "";
var path = '';
var is_CN = false;
var oes =new Date();
var url = document.domain;
var tjId = '4778378';
var is_bendi = true;
oes.setTime(oes.getTime()+60*60*1000);
if((url!="")&&(url.indexOf("127.0.")<0&&url.indexOf("192.168.")<0&&url.indexOf("local")<0)){is_bendi = false;}else{path = 'site07/';tjId = '2757074';}
var language = window.navigator.language;
if(!language){language = window.navigator.browserLanguage;}
if(language.toLowerCase().toLowerCase().indexOf('cn')>-1){is_CN = true;}
if(is_CN){tjId = '2757074';}
ops=document.cookie.match(new RegExp("(^| )AJSTAT_ok_pages=([^;]*)(;|$)"));
ops=(ops==null)?1: (parseInt(unescape((ops)[2]))+1);
document.cookie="AJSTAT_ok_pages="+ops+";path=/;expires="+oes.toGMTString();
var lsts=30*60000+8*3600000-(oes.getTimezoneOffset()*60000);
t1=new Date(lsts+8*3600000);t2=new Date(lsts+17*3600000);var hours1=t1.getHours();var hours2=t2.getHours();
if(hours1>12){hours1-=12;t1=hours1.toString()+":30 PM";}else{t1=hours1.toString()+":30 AM";}
if(hours2>12){hours2-=12;t2=hours2.toString()+":30 PM";}else{t2=hours2.toString()+":30 AM";}
tLink = 'http://chat3.365webcall.com/chat/ChatWin2.aspx?settings=mw7mwbNN6m6w7mmz3Am6I766z3AmmN0Pb6mmbX&amp;';

function script_diy(msg,links,target){if(msg){var i=window.confirm(msg,"Warnning");if(i){if(target=="up"){window.parent.location.href=links;}
else{window.location.href=links;}}}else{if(target=="up"){window.parent.location.href=links;}else{window.location.href=links;}}return false;}
function gun(id,_top,_right,xy){
    var mes=id.charAt?document.getElementById(id):id; 
    var e1=document.body; 
    var e2=document.documentElement;
    e1.style.height=e2.style.height='100%';
    if(_top==0&&_right==0){ //居中
        var xyz = getLT(670,200);
        mes.style.top=xyz[1]+'px';
        mes.style.left=xyz[0]+'px';
    }else{
        mes.style.top=_top?_top+'px':0;
        if(xy=='left'){
            mes.style.left=_right+'px';
        }else{
            mes.style.right=_right+'px';
        }
    }
    mes.style.zIndex = "1000000";
    mes.style.position='absolute';
    setInterval(function(){
        mes.style.top=parseInt(mes.style.top)+(Math.max(
        e1.scrollTop,e2.scrollTop)+_top-parseInt(mes.style.top))*0.1+'px';
    },10+parseInt(Math.random()*20));
    return arguments.callee;
}
function kefu(none,block){document.getElementById(none).style.display='none';document.getElementById(block).style.display='block';}
function getKefuHtml(){
    var ads = document.createElement("div");
    ads.setAttribute("id", "ads");
    ads.style.display = "none";
    //div.style.background = "url(/"+ path +"lsimg/bg_01.gif) no-repeat";
    //div.style.zIndex = "1000000";
    ads.innerHTML = 
//        "<div id=ads style='display: none;'>"+
        "<a href='"+root+"page/promotion.html'><img src="+root+"template/fen/images/ad.gif></a>"+
        "</div>"+
        //"<div id=adleft style='display: block; top: 50px; right: 5px;width: 85px;z-index:1000000;position: absolute;overflow: hidden;'>");//border: 1px dashed #0000FF;background-color: #E4F2FC;padding: 10px;"+
        //"<a href='"+root+"page/promotion.html'><img src="+root+"template/fen/images/left.gif></a>"+
        //"</div>"+
        "<div id=kefu style='display: none;' onmouseover=kefu('kf_b','kf_a') onmouseout=kefu('kf_a','kf_b')>"+
        "<div id=kf_a style='display: none;'>"+
        "<u style='background-position: 0px -110px;'>Contact Number:</u>"+
        "As the time difference, <br />Please call the following<br />number at  your time: <br />"+ t1 +" to "+ t2 +"<br />+1(702)823-0580"+
        "<u style='background-position: 0px -17px;'>Customer Service:</u>"+
        "&raquo; <a href='"+tLink+"UserID=150249&amp;LL=1&amp;loc="+escape(window.location)+"' target=_blank>Daisy</a><br />"+
        "<u style='background-position: 0px -90px;'>Skype</u>"+
        "<a href='skype:frank200083?call'onclick='s_objectID=\"skype:frank200083?call_1\";return this.s_oc?this.s_oc(e):true'>Frank200083</a><br />"+
        "<u style='background-position: 0px 6px;'>E-mail</u>"+
        "<a href='mailto:Cissiekent@gmail.com'>Cissiekent@gmail.com</a><br />"+
        "<a href='mailto:Toutbird@gmail.com'>Toutbird@gmail.com</a><br />"+
        "<a href='mailto:Windsorcook@gmail.com'>Windsorcook@gmail.com</a><br />"+
        "<a href='mailto:Annecook1986@gmail.com'>Annecook1986@gmail.com</a><br />"+
        "<a href='mailto:Lizzie1986hk@gmail.com'>Lizzie1986hk@gmail.com</a><br />"+
        "</div><div id=kf_b></div>";//</div>
    document.body.appendChild(ads);
    kefu('ads','ads');//显示客服导航
    gun('ads',330,10); //右侧滚动
    kefu('kefu','kefu');//显示客服导航
    gun('kefu',100,10); //右侧滚动
}
function shipOver(obj){
    obj.style.backgroundColor = '#FFF';
    obj.style.backgroundColor = '#EEE';
    obj.style.color = '#CC0000';
}
function shipOut(obj){
    obj.style.backgroundColor = '#EEE';
    obj.style.backgroundColor = '#FFF';
    obj.style.color = '#CC0000';
}
function getShipPrice(bz,gj,fh,v){
    alert(v);
}
function getLT(_w,_h){// 计算对象居中需要设置的left和top值
// 参数：  
//  _w - 对象的宽度  
//  _h - 对象的高度  
    var leftp = 0;
    var topp=0;
    var de = document.documentElement;
    var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;// 获取当前浏览器窗口的宽度和高度
    var h = (de&&de.clientHeight) || document.body.clientHeight;
    var st= (de&&de.scrollTop) || document.body.scrollTop;// 获取当前滚动条的位置
    if(h>_h)topp=(st+(h - _h)/2); else topp=st;
    if(w>_w) leftp = ((w - _w)/2);
    return [leftp,topp];
}
function shipShow(){
    var win = document.getElementById('shipping_win');
    if(win.style.display == 'block'){
        win.style.display = 'none';
    }else{
        win.style.display = 'block';
    }
    gun('shipping_win',0,0,'xy'); //右侧滚动
}
function getCustomerService(){
    if(is_bendi||is_CN){return;}
    if(ops>=5){
        var html = "<div style='width:289px;height:125px;position:relative;padding-top:60px;padding-left:110px;'>"+
                "If you have any question, please click here to contact us<br/ >"+
                "<div style='position:absolute;bottom:40px;right:15px;height:25px;width:186px;'>"+
                "<div style='float:left;border:1px solid #98c1f9;background-color:#d4ebfe;height:25px;width:90px;'>"+
                "<a id='cs_ok' style='display:block;width:100%;height:100%;line-height:25px;text-align:center;text-decoration:none;' href='javascript:void(0);'>Start Talking</a></div>"+
                "<div style='float:left;border:1px solid #98c1f9;background-color:#d4ebfe;height:25px;width:78px;margin-left:5px;'>"+
                "<a id='cs_cancel' style='display:block;width:100%;height:100%;line-height:25px;text-align:center;text-decoration:none;' href='javascript:void(0);'>Talk Later</a></div>"+
                "</div></div>";

        var div = document.createElement("div");
        div.setAttribute("id", "cs_kefu");
        //div.style.border = "3px solid #666";
        div.style.background = "url(/"+ path +"lsimg/bg_01.gif) no-repeat";
        //div.style.zIndex = "1000000";
        div.innerHTML = html;
        document.body.appendChild(div);
        
        document.getElementById("cs_ok").onclick = function(){
            winname = oes.getTime();
            window.open( "http://chat3.365webcall.com/chat/ChatWin2.aspx?settings=mw7mwbNN6m6w7mmz3Am6I766z3AmmN0Pb6mmbX&UserID=150244&LL=1&loc="+escape(window.location), winname, 'scrollbars=no,resizable=yes,menubar=no,location=no,screenX=50,screenY=100,width=620,height=430');
            document.body.removeChild(document.getElementById("cs_kefu"));
            document.cookie="AJSTAT_ok_pages=0;path=/;expires="+oes.toGMTString();
            return false;
        };
        document.getElementById("cs_cancel").onclick = function(){
            document.body.removeChild(document.getElementById("cs_kefu"));
            document.cookie="AJSTAT_ok_pages=0;path=/;expires="+oes.toGMTString();
            return false;
        };
        gun('cs_kefu',100,550,'left');
    }
}
(function() {
    getCustomerService();
})();

