var chatId; function setStat() { var sitenum = "1"; var sessionid = "SESSIONID_"+sitenum; var connectid = "CONNECTID_"+sitenum; var refid = "REFID_"+sitenum; var appname = navigator.userAgent; var os; var osversion; var browser; var browsername; var isfirst = false; // 체크 해상도 var vn_screenx = screen.width; // 화면스크린 넓이 var vn_screeny = screen.height; // 화면스크린 높이 var resolution = vn_screenx + " * " + vn_screeny; // 체크 타임존 var tz = new Date(); var tzStr = (tz.getTimezoneOffset()/60) * -1; // 체크 사용언어별 var lang; if (navigator.appName == "Netscape") lang = navigator.language; else lang = navigator.userLanguage; // Check OS if(appname.indexOf("NT 5.0")>0) { os = "Windows 2000"; osversion = "2000"; } else if(appname.indexOf("NT 6.0")>0) { os = "Windows Vista"; osversion = "VISTA"; } else if(appname.indexOf("NT 5.1")>0) { os = "Windows XP"; osversion = "XP"; } else if(appname.indexOf("NT 5.2")>0) { os = "Windows 2003"; osversion = "2003"; } else if(appname.indexOf("98")>0) { os = "Windows 98"; osversion = "98"; } else if(appname.indexOf("ME")>0) { os = "Windows ME"; osversion = "ME"; } else if(appname.indexOf("LINU")>0) { os = "LINUX"; osversion=""; } else { os = "ETC"; osversion="-"; } if(appname.indexOf("MSIE 7.0")>0) { browser="MSIE 7.0"; browsername="Internet Explorer"; } else if(appname.indexOf("MSIE 6.0")>0) { browser="MSIE 6.0"; browsername="Internet Explorer"; } else if(appname.indexOf("MSIE 5.5")>0) { browser="MSIE 5.5"; browsername="Internet Explorer"; } else if(appname.indexOf("MSIE 5.0")>0) { browser="MSIE 5.0"; browsername="Internet Explorer"; } else if(appname.indexOf("MSIE")>0) { browser="MSIE"; browsername="Internet Explorer"; } else if(appname.indexOf("Gecko")>0) { browser="Gecko"; browsername=navigator.appName;} else if(appname.indexOf("Opera")>0) {browser = "Opera"; browsername="Internet Explorer";} else { browser = "ETC"; browsername=navigator.platform; } var url = document.URL var urls = url.split("?"); var urlhost = urls[0]; var urlquery = urls.length>1 ? urls[1] : ""; //alert(typeof("parent.document")); var pref = "";//document==null ? "" : parent.document.referrer; var ref = document.referrer; var refs, refhost="", refquery=""; try{ pref = parent.document.referrer;}catch(_e){ try{ pref = top.document.referrer; }catch(_e){ pref = ""} } if(pref != ref) { ref = pref; } if(ref==url) { ref = ""; } else { refs = ref.split("?"); refhost = refs[0]; refquery = refs.length>1 ? refs[1] : ""; } // 유입경로별 인서트 로직추가 var cururl = url; var cururl2 = ""; if(cururl.indexOf("http://www.") > -1) { cururl2 = cururl.substring(11, cururl.substring(11).indexOf("/") + 11); } else if(cururl.indexOf("http://") > -1) { cururl2 = cururl.substring(7, cururl.substring(7).indexOf("/") + 7); } var refurl = ref; var refurl2 = ""; if(refurl.indexOf("http://www.") > -1) { refurl2 = refurl.substring(11, refurl.substring(11).indexOf("/") + 11); } else if(refurl.indexOf("http://") > -1) { refurl2 = refurl.substring(7, refurl.substring(7).indexOf("/") + 7); } // 유입경로별 인서트 로직추가 끝 var expire = new Date(); var sessionid_val = getCookie(sessionid); var connectid_val = getCookie(connectid); var refid_val = getCookie(refid); var curdate = new Date(2018, 9, 26, 16, 5, 52, expire.getMilliseconds() ); expire.setTime(curdate.getTime() + 1000 * 3600 * 24 * 365); if(sessionid_val=="") { setCookie(sessionid, ""+curdate.getTime(), expire); sessionid_val = ""+curdate.getTime(); } if(connectid_val == "") { connectid_val = ""+curdate.getTime(); setCookie(connectid,connectid_val,null); isfirst = true; } // 유입경로별 인서트 로직추가 if(refid_val == "") { if(refurl2 == "") { refid_val = "BOOKMARK"; } else { refid_val = refurl2; } setCookie(refid,refid_val,null); } if( (refurl2 != "" && cururl2 != refurl2) && (refurl2 != refid_val) ) { connectid_val = ""+curdate.getTime(); setCookie(connectid,connectid_val,null); setCookie(refid,refurl2,null); isfirst = true; } // 유입경로별 인서트 로직추가 끝 chatId = connectid_val; // 이미지 링크할 때는 절대 경로로 합니다. HOST명까지 적어 주어야 합니다. var img = "http://weblog2.vizensoft.com/stat.jsp?sitenum=" + sitenum+"&isfirst="+isfirst+"&sessionid="+sessionid_val+"&connectid="+connectid_val+"&os="+escape(os)+"&osversion="+escape(osversion)+"&browser="+escape(browser)+"&browsername="+escape(browsername)+"&ref="+escape((ref))+"&url="+escape((url))+"&resolution="+resolution+"&lang="+lang+"&tzStr="+tzStr; document.write(""); } // COOKIE 설정 function getCookie(name) { var nameOfCookie = name + "="; var x = 0; while (x <= document.cookie.length) { var y = (x+nameOfCookie.length); if (document.cookie.substring (x, y) == nameOfCookie) { if ((endOfCookie = document.cookie.indexOf (";", y)) == -1) endOfCookie = document.cookie.length; return unescape (document.cookie.substring(y, endOfCookie)); } x = document.cookie.indexOf (" ", x) + 1; if (x == 0) break; } return ""; } function setCookie (name, value, expires) { if(expires==null) document.cookie = name + "=" + escape (value) + "; path=/"; else document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString(); } /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// setStat(); /////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////