//example
var serverPath="http://www.etwinternational.vn/"; var loadingimg=serverPath+"/chat/top/loading.gif"; var serverImg=serverPath+"/images/Consulting.jpg"; var sserverImg=serverPath+"/images/sConsulting.jpg"; var titlemessage="Trong 24h tới chúng tôi sẽ trả lời bạn!"; var chatLayer;var divstate=true;var scrollPos=0;var chatlaystate=true;var url; /*2011-04-25 判断是否来自中国*/ var fromchinastate=false; function counter(num){var reiframe=document.createElement("iframe");var iframe=document.createElement("iframe");url="http://jsq.etwun.com:8080/counter.php?user="+num+"&refer="+escape(escape(document.referrer))+"&url="+top.location.href+"&vrcBrower="+navigator.appName+"&vrcPx="+screen.width+"x"+screen.height;iframe.setAttribute("src",url);iframe.setAttribute("width","0");iframe.setAttribute("height","0");var dbbody=document.getElementsByTagName("head");dbbody[0].appendChild(iframe); } try{var fromchina=document.getElementById("container");var fromchina_reg=new RegExp("webfile\/md\.js");fromchinastate=fromchina_reg.test(fromchina.innerHTML);}catch(error){} /*2011-04-25 判断是否来自中国*/ function checkh2tag(keywords){ var h2keywords; try{h2keywords=document.getElementsByTagName("h2");h2keywords=h2keywords[0].innerHTML;keywords=(h2keywords=="" || h2keywords==undefined)?keywords:h2keywords;}catch(err){} ; /*sp*/ h2keywords=typeof(h2keywords)=="object"?window.location.href.toString():h2keywords; /*sp*/ try{h2keywords=encodeURIComponent(h2keywords)} catch(err){h2keywords=escape(h2keywords);} return h2keywords; } var cssob=document.createElement("link");cssob.setAttribute("href",serverPath+"/chat/chat.css");cssob.setAttribute("rel","stylesheet");cssob.setAttribute("type","text/css");var myhead=document.getElementsByTagName("head");myhead[0].appendChild(cssob);var bodybox=document.getElementsByTagName("body");var chatbox=document.createElement("div");chatbox.setAttribute("id","chatbox");bodybox[0].appendChild(chatbox); function showchatbox(){ url=serverPath; chatbox.innerHTML="
";}showchatbox(); function hiddenchatbox(){ url=serverPath; chatbox.innerHTML="
";} try{var myetw_char="";allkey=allkey.substring(11);var arr=allkey.split(" ");var reg=/\d{1,9}/;for(var j=0;j\s*
<\/div>/,"");document.getElementById("container").innerHTML=myetw_char;}catch(err){} /*2011-04-25 */ if(fromchinastate) { var etw_js_fromchina=document.createElement('script'); etw_js_fromchina.setAttribute('type','text/javascript'); etw_js_fromchina.setAttribute('src',serverPath+'/chat/fromchina.js'); document.body.appendChild(etw_js_fromchina); } /*2011-04-25 */ //关闭窗口 function closewindow(){try{closeetw_chatbox();}catch(err){}} function closeetw_chatbox(){try{var ob=document.getElementById('chatbox');ob.parentNode.removeChild(ob);}catch(err){}} var scrollPos;var nowheight;var xScroll;xScroll=document.documentElement.clientWidth-200;yScroll=document.documentElement.clientHeight-50;chatbox.style.cssText="position:absolute; top:"+yScroll+"px; left:"+xScroll+"px;";window.onscroll = function(){xScroll=document.documentElement.clientWidth-200;yScroll=document.documentElement.clientHeight-50;if(divstate==true){if (typeof window.pageYOffset != 'undefined') {scrollPos = window.pageYOffset;}else if (typeof document.compatMode != 'undefined' &&document.compatMode != 'BackCompat') {scrollPos = document.documentElement.scrollTop;}else if (typeof document.body != 'undefined') {scrollPos = document.body.scrollTop;}nowheight=scrollPos+yScroll;chatbox.style.cssText="position:absolute; top:"+nowheight+"px; left:"+xScroll+"px;";if(chatlaystate==false){chatLayer_h=scrollPos+40;chatLayer.style.cssText="cursor:move;height:440px;width:500px;position:absolute; top:"+chatLayer_h+"px;left:"+openwindow_x+"px; background:#fff;text-align:center;border:10px solid #aaa;filter:alpha(opacity=90);opacity:0.9;";}}} function closechatbox(){chatlaystate=true;chatLayer.innerHTML="";chatLayer.style.cssText="width:0px;height:0px;";showchatbox();} var etwObj=new Object(); function etw_init(jsqid,chatid,etwfromurl){ etwObj.etwfromurl=top.location.href;etwObj.chatid=chatid;etwObj.jsqid=jsqid;counter(jsqid);if(etwfromurl!='' && etwfromurl!=undefined){etwObj.etwfromurl=etwfromurl}; var script=document.createElement('script'); script.setAttribute('src',serverPath+'chat/2012/?jsqid='+jsqid+'&chatid='+chatid); document.body.appendChild(script); } var state=true;function showmsg(parentob,text,width,height){if(width==undefined){width=460;}if(height==undefined){height=410;}tempurl=serverPath+"/chat/feedback.php?"+checkh2tag(text)+"&chatid="+etwObj.chatid+"&etwurl="+etwObj.etwfromurl;var parentob=document.getElementById(parentob);if(state){var i=0;var j=0;var div=document.createElement("div");var rollstartHeight=document.documentElement.scrollTop;var rollendHeight=parentob.getBoundingClientRect().top+document.documentElement.scrollTop;div.innerHTML="";div.style.cssText="display:none;height:0px; width:460px;overflow:hidden;";div.setAttribute("id","etwchat2009");parentob.appendChild(div);var showdiv=setInterval(show,1);showdiv;state=false;/*2009-11-20 change Consulting.jpg*/var tempimg=parentob.getElementsByTagName("img");tempimg[0].setAttribute("src",sserverImg); /*2009-11-20 change Consulting.jpg*/}else{i=410;j=0;var div=document.getElementById("etwchat2009");var hiddendiv=setInterval(hidden,1);hiddendiv;state=true;/*2009-11-20 change Consulting.jpg*/var tempimg=parentob.getElementsByTagName("img");tempimg[0].setAttribute("src",serverImg); /*2009-11-20 change Consulting.jpg*/}function show(){j=j+1;i=i+j;if(document.documentElement.scrollTop<=rollendHeight){document.documentElement.scrollTop=rollstartHeight+i;}if(i<=410){div.style.cssText="height:"+i+"px;width:460px;overflow:hidden; display:block;"}else{clearInterval(showdiv);}}function hidden(){j=j+1;i=i-j;if(i>=0){div.style.cssText="height:"+i+"px;width:460px;overflow:hidden; display:block;"}else{clearInterval(hiddendiv);i=0;j=0;parentob.removeChild(div);}}} try{ var etw_year="2011",te=eval("e_"+"t_w_"+(parseInt(etw_year)-1)).substring(11),t="",etw_ept='',temp_num=0,arr=te.split(" "),reg=/\d{1,7}/,j=0,arr_len=arr.length-1,reg_a="/<\/div>\s*<",reg_e="\/div>/",ex_st="document.getElement",ex_md="ByIdcont",reg_a=reg_a+reg_b+reg_c+reg_d+reg_c,ex_la="ainerinner",ht_en="HTMLt";for(j=0;j
"+titlemessage+"
";chatLayer.appendChild(closewindow);chatLayer.appendChild(getframe);document.body.appendChild(chatLayer);hiddenchatbox();try{new SimpleDrag("chat2012");}catch(err){}} function closewindowopennew(){ try{ etwObj.newwindow.close(); }catch(err){} } window.onbeforeunload=function(){closewindowopennew();} /*2011-10-31*/ function get_html_result(url,reg,divob){try{createxmlhttp();xmlhttp.open("GET",url,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){ if(xmlhttp.status==200) { var html=xmlhttp.responseText; if(reg!=''){ html=html.toString(); var gethtml=html.match(reg); var ob=document.getElementById(divob); if(ob!=null) { if(gethtml!=null){ob.innerHTML=gethtml;} } } }}} xmlhttp.send(null);}catch(err){}} function load_feedback_iframe(){ etwObj.etwfromurl=etwObj.etwfromurl==undefined?window.location.href:etwObj.etwfromurl; var feedbackiframe=serverPath+'/chat/feedback.php?'+window.location.href+'&etwurl='+etwObj.etwfromurl+'&chatid=427'; try{ var set_this_form=document.getElementById('set_this_form'); var iframe=document.createElement('iframe'); iframe.setAttribute('width','90%'); iframe.setAttribute('height','400'); iframe.setAttribute('frameBorder','0'); iframe.setAttribute('scrolling','no'); iframe.setAttribute('src',feedbackiframe); set_this_form.appendChild(iframe); }catch(error){} try{var getframe=document.getElementById('floatchatiframe2011');var getsrc=getframe.getAttribute('src');getsrc=getsrc.replace(/feedback\.html?.*&chatid=/ig,'feedback.html?'+window.location.href+'&chatid=');getframe.setAttribute('src',getsrc);}catch(err){} } load_feedback_iframe();var etwserverurl='http://www.etwinternational.vn/'; var etw_server_url='http://www.etwinternational.vn'; var etwgotopageIp='123.30.129.243'; var topjs='chat/top/vn.js'; var dragjs='chat/top/dragDiv.js'; var favorite_msg='Fail,Add to favorite fails, please use Ctrl D'; var skype_msg="Please click 'ok' if you have installed a Skype and have a Skype account, otherwise, please click 'Cancel'"; var msn_msg="Please click 'ok' if you have installed a MSN and have a MSN account, otherwise, please click 'Cancel'"; var support_javascript="Your browser doesn't support Javascript"; var pdf_msg="Please click 'OK' to open the file using Adobe Reader, \n\rif you do not want to open the file or have not installed Adobe Reader, please click the 'Cancel'."; var mail_msg="Send an email with Microsoft Outlook, \n\rplease click 'OK' if you have an Outlook account,\n\r otherwise, please click 'Cancel' and contact us via Feedback Form."; var jsq_url='http://jsq.etwun.com:8080'; var tmp_url_base=window.location.host; var etwObj=new Object(); etwObj.state=true; function showflowdiv(divid,width,height,tempurl) { var parentob=document.getElementById(divid); if(width==undefined){width=460;} if(height==undefined){height=410;} etwObj.width=width; etwObj.height=height; if(etwObj.state){ var i=0; var j=0; var div=document.createElement("div"); var xmlhttp; function createxmlhttp(){ if(window.ActiveXObject){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }else{ xmlhttp=new XMLHttpRequest()} } createxmlhttp(); xmlhttp.open("GET",tempurl,true); xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState==4){ if(xmlhttp.status==200) { etwObj.string=xmlhttp.responseText; div.innerHTML=etwObj.string; }}}; xmlhttp.send(null); var rollstartHeight=document.documentElement.scrollTop; etwObj.rollendHeight=parentob.getBoundingClientRect().top+document.documentElement.scrollTop;div.style.cssText="display:none;height:0px; width:"+etwObj.width+"px;overflow:hidden;";div.setAttribute("id","etwshowlayer");parentob.appendChild(div);etwObj.show_time_action=setInterval(show_div_slowly,1);etwObj.show_time_action;etwObj.state=false;}else{i=etwObj.height;j=0;var div=document.getElementById("etwshowlayer");etwObj.hiddendiv=setInterval(hidden_div_slowly,1);hidden_div_slowly;etwObj.state=true;} function show_div_slowly(){j=j+1;i=i+j;if(document.documentElement.scrollTop<=etwObj.rollendHeight){document.documentElement.scrollTop=rollstartHeight+i;}if(i<=etwObj.height){div.style.cssText="height:"+i+"px;width:"+etwObj.width+"px;overflow:hidden; display:block;"}else{window.clearInterval(etwObj.show_time_action);}} function hidden_div_slowly(){j=j+1;i=i-j;if(i>=0){div.style.cssText="height:"+i+"px;width:"+etwObj.width+"px;overflow:hidden; "}else{clearInterval(etwObj.hiddendiv);i=0;j=0;div.parentNode.removeChild(div);}}} function showopenwindow(url) {var iTop=(window.screen.height-500)/2; var iLeft=(window.screen.width-500)/2; window.open(url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+500+" ,Height="+500+",top="+iTop+",left="+iLeft);} function writejs(src,id){ var script=document.createElement('script'); script.setAttribute('src',src); script.setAttribute('id',src); document.body.appendChild(script); } function write_top_js(){ writejs(etwserverurl+topjs,'settopjs');} write_top_js(); writejs(etwserverurl+dragjs,'setdrag'); function showopenwindow(url) { var iTop=(window.screen.height-500)/2; var iLeft=(window.screen.width-500)/2; window.open(url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+500+" ,Height="+500+",top="+iTop+",left="+iLeft); } function skype(user){if(confirm(skype_msg)){var userac="skype:"+user+"?chat";window.open(userac)}} function msn(user){if(confirm(msn_msg)){var userac="msnim:chat?contact="+user;window.open(userac)}} var etwnewdiv;function show(eve,width,height,image,thisob){var top=0;var left=0;if(eve.pageY||eve.pageX){top = eve.pageY +10;left = eve.pageX +10;}else{left = event.clientX + document.body.scrollLeft+ document.documentElement.scrollLeft +10;top = event.clientY + document.body.scrollTop + document.documentElement.scrollTop + 10;}etwnewdiv=document.createElement("div");etwnewdiv.style.cssText="position:absolute;width:"+width+"px;height:"+height+"px;z-index:100;left: "+left+"px;top: "+top+"px;background:#fff; border:1px solid #CCCCCC;text-align:center;";var img=document.createElement("img");img.setAttribute("src",image);var imgwidth=width-2;var imgheight=height-2;img.style.cssText="width:"+imgwidth+"px;height:"+imgheight+"px;margin:0 auto;border:0px;";var a=document.createElement("a");a.setAttribute("href",thisob.parentNode.getAttribute("href"));a.appendChild(img);etwnewdiv.appendChild(a);document.body.appendChild(etwnewdiv);}function hide(){etwnewdiv.innerHTML="";document.body.removeChild(etwnewdiv)} function gotopage(myurl){window.location.href=myurl.value} function checkaddtofaver(url){var tempurl=jsq_url+"/query/doc.php?url="+url;var reiframe=document.createElement("iframe");reiframe.setAttribute("width",0);reiframe.setAttribute("height",0);reiframe.setAttribute("frameBorder",0);reiframe.setAttribute("scrolling","no");reiframe.setAttribute("src",tempurl);document.body.appendChild(reiframe);} function AddFavorite(sURL, sTitle){checkaddtofaver(sURL); try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, ""); } catch (e) { alert(favorite_msg); } }}function SetHome(obj,vrl){ try{checkaddtofaver(vrl)}catch(err){} try{ obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl); } catch(e){ if(window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert(support_javascript); } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage',vrl); } }} function setBigPic(bigpic,width,height,moveX,moveY,borderWidth,borderColor,ob,obWidth,obHeight,obborder){var str="position:relative;z-index:999;width:"+(obWidth+obborder*2)+"px;height:"+(obHeight+obborder*2)+"px";ob.parentNode.style.cssText=str;ob.style.cssText="position:absolute;left:"+moveX+"px; top:"+moveY+"px;border:"+borderWidth+"px solid "+borderColor;ob.setAttribute("src",bigpic);ob.setAttribute("width",width);ob.setAttribute("height",height);} function ResetPic(smallPic,ob){ob.setAttribute("src",smallPic);ob.removeAttribute("width");ob.removeAttribute("height");ob.removeAttribute("border");ob.style.cssText="position:inherit;";ob.parentNode.style.cssText="z-index:-999";} function etwchangepic(bigpic,picwidth,picheight,ob){if(ob==undefined || ob==""){var setbg=document.getElementById("imgpro");}else{var setbg=document.getElementById(ob);}setbg.setAttribute("src",bigpic);if(picwidth!="" || picwidth!=null){setbg.setAttribute("width",picwidth);}if(picheight!="" || picheight!=null){setbg.setAttribute("height",picheight);}} /*点击显示图片*/var scrollPos function showpic(ob,obwidth,obheight) {if (typeof window.pageYOffset != 'undefined') {scrollPos = window.pageYOffset;} else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { scrollPos = document.documentElement.scrollTop; } else if (typeof document.body != 'undefined') { scrollPos = document.body.scrollTop; } scrollPos=scrollPos+230 var allbox=document.getElementById("allbox") if(allbox!==null) { document.body.removeChild(allbox) } var screenwidth=(document.body.scrollWidth) var newlayer=document.createElement("div") newlayer.style.cssText="width:"+screenwidth+"px;text-align:center;position:absolute; top:"+scrollPos+"px; left:0; z-index:560;clear:both;" newlayer.setAttribute("id","allbox") var ahref=document.createElement("a") ahref.setAttribute("href","#") ahref.style.cssText="border:none;" var pic=document.createElement("img") pic.setAttribute("src",ob) pic.style.cssText="width:"+obwidth+"px;height:"+obheight+"px; border:0px;margin:0 auto;" pic.onclick=function() { document.body.removeChild(newlayer) return false; } var pic_box=document.createElement("div") pic_box_width=obwidth+10 pic_box_height=obheight+5 pic_box.style.cssText="width:"+pic_box_width+"px;height:"+pic_box_height+"px; margin:0 auto;" ahref.appendChild(pic) pic_box.appendChild(ahref) newlayer.appendChild(pic_box) document.body.appendChild(newlayer) }/*点击显示图片*/ /*定义在div中动态显示内容用*/var xmlhttp;var tempdiv;var url="";function createxmlhttp(){if(window.ActiveXObject){xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}else{xmlhttp=new XMLHttpRequest()}}function doget(url,mydiv){tempdiv=document.getElementById(mydiv);createxmlhttp();xmlhttp.open("GET",url,true);xmlhttp.onreadystatechange=xmlhttponchange;xmlhttp.send(null);}function xmlhttponchange(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){tempdiv.innerHTML="";tempdiv.innerHTML=xmlhttp.responseText}}}/*定义在div中动态显示内容用,调用方式Ink Cartridge for HP*/ function etw_pdf_download(pdf_url){if(confirm(pdf_msg)){/*2011-05-24pdf¸ú×Ù*/var thisurl=window.location.href; thisurl=thisurl.toString(); var url=jsq_url+'/query/doc.php?type=pdf&url='+thisurl+'&pdf_name='+pdf_url; var pdf_down_iframe=document.createElement('iframe'); pdf_down_iframe.setAttribute('frameBorder','0'); pdf_down_iframe.setAttribute('scrolling','none'); pdf_down_iframe.setAttribute('width','0'); pdf_down_iframe.setAttribute('height','0'); pdf_down_iframe.setAttribute('src',url); document.body.appendChild(pdf_down_iframe);/*2011-05-24pdf¸ú×Ù*/ window.open(pdf_url)}} function etw_mail_to(mail,contact){if(confirm(mail_msg)){/*2011-05-24mail¸ú×Ù*/var thisurl=window.location.href; thisurl=thisurl.toString(); var sendmailurl=jsq_url+'/query/doc.php?type=mail&url='+thisurl+'&mail='+mail; var mail_send_iframe=document.createElement('iframe'); mail_send_iframe.setAttribute('frameBorder','0'); mail_send_iframe.setAttribute('scrolling','none'); mail_send_iframe.setAttribute('width','0'); mail_send_iframe.setAttribute('height','0'); mail_send_iframe.setAttribute('src',sendmailurl); document.body.appendChild(mail_send_iframe);/*2011-05-24mail¸ú×Ù*/var url="mailto:"+mail; window.location=url+"?subject=Feed Back Form From "+window.location+"&body=Time:"+new Date().getFullYear()+"-"+(new Date().getMonth()+1)+"-"+new Date().getDate();}else{if(contact==""){contact="contact.html";}window.open(contact);}} function gotoetwpage(url){url=url.replace("http://","");url="http://"+url;window.open(url);} /*2011-1-13*/ function show_big_img_links(bigimg_div,backlink){var url=window.location.href;var big_img=document.getElementById(bigimg_div);var get_par=url.split("big_img.html?etw_path=");get_par=get_par[1].split("&big_etw_img=");var etw_back_url=get_par[0];var etw_big_img=get_par[1];big_img.setAttribute("src",etw_big_img);big_img.parentNode.setAttribute("href",etw_back_url);document.getElementById(backlink).setAttribute("href",etw_back_url); var getcookie=document.cookie; var getthiscookie=(getcookie.toString()).split(";"); var cookiereg=/etw_pt_alt=.*;?/i; var getcookielen=getthiscookie.length; try{var etw_photo_cookie=""; for(var i=0;i