var ops=1;
var path = '';
var is_CN = false;
var oes =new Date();
var url = document.domain;
var tjId = '4778378';
var serState = true;
var is_bendi = true;
oes.setTime(oes.getTime()+60*60*1000);
if((url!="")&&(url.indexOf("127.")<0&&url.indexOf("168.")<0&&url.indexOf("local")<0)){is_bendi = false;}else{path = 'site07/';tjId = '2757074';}
if(window.navigator.browserLanguage){if(window.navigator.browserLanguage.toLowerCase().indexOf('cn')>-1) is_CN = true;}
else{if(window.navigator.appVersion.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 lsdat=new Date();var lsts=30*60000+8*3600000-(lsdat.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;';
document.write("<div id=ads style='display: none;'>");
document.write("<a href='"+root+"page/promotion.html'><img src="+root+"template/fen/images/ad.gif></a>");
document.write("</div>");
//document.write("<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;
//document.write("<a href='"+root+"page/promotion.html'><img src="+root+"template/fen/images/left.gif></a>");
//document.write("</div>");
document.write("<div id=kefu style='display: none;' onmouseover=kefu('kf_b','kf_a') onmouseout=kefu('kf_a','kf_b')>");
document.write("<div id=kf_a style='display: none;'>");
document.write("<u style='background-position: 0px -110px;'>Contact Number:</u>");
document.write("As the time difference, <br />Please call the following<br />number at  your time: <br />"+ t1 +" to "+ t2 +"<br />+1(702)823-0580"); //+1(425)484-0097 <br />
document.write("<u style='background-position: 0px -17px;'>Customer Service:</u>");
document.write("&raquo; <a href='"+tLink+"UserID=150249&amp;LL=1&amp;loc="+escape(window.location)+"' target=_blank>Daisy</a><br />");
document.write("<u style='background-position: 0px -90px;'>Skype</u>");
document.write("<a href='skype:frank200083?call'onclick='s_objectID=\"skype:frank200083?call_1\";return this.s_oc?this.s_oc(e):true'>Frank200083</a><br />");
document.write("<u style='background-position: 0px 6px;'>E-mail</u>");
document.write("<a href='mailto:Cissiekent@gmail.com'>Cissiekent@gmail.com</a><br />");
document.write("<a href='mailto:Toutbird@gmail.com'>Toutbird@gmail.com</a><br />");
document.write("<a href='mailto:Windsorcook@gmail.com'>Windsorcook@gmail.com</a><br />");
document.write("<a href='mailto:Annecook1986@gmail.com'>Annecook1986@gmail.com</a><br />");
document.write("<a href='mailto:Lizzie1986hk@gmail.com'>Lizzie1986hk@gmail.com</a><br />");
document.write("</div><div id=kf_b></div></div>");
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 jump(links){window.location.href=root+'catalogues/'+links+'.html';return;}
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%';
    mes.style.top=_top?_top+'px':0;
    mes.style.zIndex = "1000000";
    if(xy=='left'){mes.style.left=_right+'px';}else{mes.style.right=_right+'px';}
    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 sImg(id1,id2){
    var id2s = id2.replace(/\//g,'').replace('smaill','').replace('s','').replace('pro','');
    document.getElementById('img'+id1).src=imgUrl+id2+'.jpg';
    document.getElementById('p'+id1).href=root+'shows/'+id2s+'.html'; //proImg
    document.getElementById('c'+id1).href=root+'cart/'+id2s+'.html'; //cart
    document.getElementById('id'+id1).innerHTML='ID: '+id2s+'';
}
function menu_mousemove(state){
    var dropdown_list = document.getElementById('dropdown_list');
    if(state=='over'){
        dropdown_list.style.display = 'block';
    }else if(state == 'out'){
        dropdown_list.style.display = 'none';
    }
}
function list2_mousemove(id,opt){
    var list = document.getElementById(id);
    if(opt=="over"){
        list.style.display = "block";
    }else{
        list.style.display = "none";
    }
}
function mousemove(opt,id){
    var cont1 = "topArt_cont1";
    var cont2 = "topArt_cont2";
    document.getElementById("topArt_cont1").style.display="none";
    document.getElementById("topArt_cont2").style.display="none";
    if(id=="news")
        document.getElementById(cont1).style.display="block";
    else
        document.getElementById(cont2).style.display="block";
    if(opt=="over"){
        document.getElementById("news").style.background="url("+path+"images/nav1.png) no-repeat scroll 0px 0px";
        document.getElementById("orders").style.background="url("+path+"images/nav1.png) no-repeat scroll 0px 0px";
        document.getElementById(id).style.background="url("+path+"images/nav1.png) no-repeat scroll 0px -30px";
    }
}
function addEvent(func){
    var load = window.onload;
    if(typeof window.onload!='function'){
        window.onload = func;
    }else{
        window.onload = function(){
            load();
            func();
        }
    }
}
function phplive_unique() { var date = new Date() ; return date.getTime() ; }
function getCustomerService(){
    //check time
    //serState = document.cookie.match(new RegExp("serState=([^;]*)(;|$)"))[1];
    if(is_bendi){return;}
    kefu('kefu','kefu');//显示客服导航
    gun('kefu',100,10); //右侧滚动
    kefu('ads','ads');//显示客服导航
    gun('ads',330,10); //右侧滚动
    //kefu('adleft','adleft');//显示左侧滚动
    //gun('adleft',20,10,'left'); //左侧滚动
    //gun('lsTools',100,10,'left'); //左侧滚动
    if(ops>=5){
        document.getElementById("ads").style.display = 'none';
        document.getElementById("kefu").style.display = 'none';
        var html = "";
        //html += "<div id=kf_a style='display: none;'>";
        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>";
        //html += "</div><div id=kf_b></div>";

        var div = document.createElement("div");
        div.setAttribute("id", "cs_kefu");
        //div.style.border = "3px solid #666";
        div.style.background = "url(/"+ path +"includes/bg_01.gif) no-repeat";
        //div.style.zIndex = "1000000";
        div.innerHTML = html;
        document.body.appendChild(div);
        document.getElementById("cs_ok").onclick = function(){
            //window.open(tLink+"&UserID=150251&amp&LL=1","Chat_Web_Call");
            //window.location.href = "http://chat3.365webcall.com/chat/ChatWin2.aspx?settings=mw7mwbNN6m6w7mmz3Am6I766z3AmmN0Pb6mmbX&UserID=150249&LL=1"; //"http://" + url + "/"+ path +"page/contact-us.html";
            winname = phplive_unique();
            window.open( "http://chat3.365webcall.com/chat/ChatWin2.aspx?settings=mw7mwbNN6m6w7mmz3Am6I766z3AmmN0Pb6mmbX&UserID=150249&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();
            kefu('kefu','kefu');//显示客服导航
            kefu('ads','ads');//显示客服导航
            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();
            kefu('kefu','kefu');//显示客服导航
            kefu('ads','ads');//显示客服导航
            return false;
        };
        gun('cs_kefu',100,550,'left');
    }
}
function showImgs(elem){
    document.getElementById("showImg").src = elem.href;
    document.getElementById("daimg").href = elem.href;
}
addEvent(getCustomerService);
