document.write(''); //2010/9/8 ¤W¤È 03:55:20 var viewportwidth; var viewportheight; var pageOpen = new Date(); Read_Data() function Read_Data() { var Browser = CheckBrowser(); CheckBrowserWH(); window.onunload = function() { Send_Log(Browser); } } function Send_Log(Browser) { var http_request = false; var url var dd = new Date(); var dd = dd.getFullYear() + '' + (dd.getMonth() + 1) + '' + dd.getDate() + '' + dd.getHours() + '' + dd.getMinutes() + '' + dd.getSeconds(); //stay pageClose = new Date(); time=Math.round((pageClose.getTime() - pageOpen.getTime()) / 100)/10; url = "http://61.66.230.68/web_bi/log.aspx?type_name=Blog&page_name=yunas&sub_name=&Browser=" + Browser + "&w=" + window.screen.width + "&stay="+time+"&IPs=644595556&REFERER="+document.referrer+"&dd=" + dd //url = "http://www.tvbs.com.tw/web_bi/log.aspx?type_name=Blog&page_name=yunas&Browser=" + Browser + "&w=" + viewportwidth + "&h=" + viewportheight + "&stay="+time+"&IPs=644595556&REFERER="+document.referrer+"&dd=" + dd url=url.replace(" ","") if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { http_request = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) { } } } if(Browser.indexOf("afari")==-1){ var img = new Image(); img.src = url; } else{ http_request.open('POST',url, false); http_request.send(null); } } function CheckBrowser() { var cb = "Other"; var ver = navigator.appVersion; ver = ver.split("("); if (window.ActiveXObject) { cb = "IE"; } else if (navigator.userAgent.toLowerCase().indexOf("firefox") != -1) { cb = "Firefox"; } else if ((typeof document.implementation != "undefined") && (typeof document.implementation.createDocument != "undefined") && (typeof HTMLDocument != "undefined")) { if (window.devicePixelRatio) { cb = "Safari"; } else { cb = "Mozilla"; } } else if (navigator.userAgent.toLowerCase().indexOf("opera") != -1) { cb = "Opera"; } return cb + '_' + ver[0]; } function CheckBrowserWH() { if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } // IE6 else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth+21, viewportheight = document.documentElement.clientHeight } // older versions of IE else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth+21, viewportheight = document.getElementsByTagName('body')[0].clientHeight } } //2010/9/8 ¤W¤È 03:55:20