// Constant DEBUG Flag: var DEBUG = false; // true; // if ( DEBUG ) alert( "browsercap_js.asp LOADED!" ); tracking_init(); //-----------------------------------------------------------------------------| //-----------------------------------------------------------------------------| /** * ECB_BrowserSize - Object which calculates the browser size for the ECB * Homepage. This implementation is very specific to the ECB site and the * related framesets in use there, namely a frameset nested within another * frameset (thus the use of parent.top and parent.parent). * * This object has been tested on Windows 2000 Server (SP 4) with the following * browsers: * * MSIE 6.0.2800.1106 * Netscape 4.7 * Netscape 6.0 * Mozilla 1.4 * Opera 7.11 * */ function ECB_BrowserSize() { this.width = 0; this.height = 0; if ( typeof( parent.top.innerWidth ) == 'number' ) { // Non-IE this.width = parent.top.innerWidth; this.height = parent.top.innerHeight; } else { if ( parent.parent.document.documentElement && ( parent.parent.document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { // IE 6+ in 'standards compliant mode' this.width = parent.parent.document.documentElement.clientWidth; this.height = parent.parent.document.documentElement.clientHeight; } else { if ( parent.parent.document.body && ( parent.parent.document.body.clientWidth || parent.parent.document.body.clientHeight ) ) { // IE 4 compatible this.width = parent.parent.document.body.clientWidth; this.height = parent.parent.document.body.clientHeight; } // if } // else } // else } // ECB_BrowserSize() //-----------------------------------------------------------------------------| function tracking_init() { if ( DEBUG ) alert( "START tracking_init()" ); var useColorDepth = (screen.colorDepth > 0); //var host = window.location.hostname; var host = "infopages.europcar.ch"; if (host == null || host == "") host = window.location.hostname; var sw = screen.width; var sh = screen.height; /* var bw = window.innerWidth ? window.innerWidth : document.body.clientWidth ? document.body.clientWidth : document.body.offsetWidth; var bh = window.innerHeight ? window.innerHeight : document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight; */ ecbBrowserSize = new ECB_BrowserSize(); var bw = ecbBrowserSize.width; var bh = ecbBrowserSize.height; // SAM - 2003.08.22: Verify cookies for browsers other than IE4+ and NS6+ // NOTE: NOT YET TESTED!!! AND THEREFORE NOT YET IMPLEMENTED. ;-) /* var cookieEnabled = (navigator.cookieEnabled) ? true : false; // if not IE4+ nor NS6+ if ( typeof navigator.cookieEnabled == "undefined" && ! cookieEnabled ) { var orig_cookie = document.cookie; document.cookie = "testcookie"; cookieEnabled = ( document.cookie == "testcookie" ) ? true : false; // replace dummy value with original value (if there was one) document.cookie = orig_cookie; } // if */ var cd = useColorDepth ? screen.colorDepth : screen.pixelDepth; var ce = navigator.cookieEnabled ? 1 : 0; var je = navigator.javaEnabled() ? 1 : 0; var fv = getFlashVersion(); var arrParams = new Array; var dateToday = new Date(); var dateExpire = new Date(); var id; // SAM - 2003.08.13: now tracking "intended" site. var site = "http://infopages.europcar.ch/europcar/infopage-Geneve/kon.jsp"; var p1 = ""; var p2 = ""; var p3 = ""; var p4 = ""; var c1 = "Infopage Genève Tourisme"; var c2 = "Kontakt"; var c3 = ""; var c4 = ""; var ref = ""; var lan = "fr"; // SAM - 2003.08.13: now tracking "PDF Enabled". var pe = pdfEnabled() ? 1 : 0; id = getCookie("BrowserCapId"); if (id == null) { id = dateToday.getTime(); dateExpire.setTime(dateToday.getTime()+1000*60*60*24*365); document.cookie = "BrowserCapId=" + escape(id) + "; expires=" + dateExpire.toGMTString()+ "; path=/"; } arrParams.push("id=" + id); arrParams.push("host=" + host); arrParams.push("site=" + escape(site) ); arrParams.push("ba=" + escape(navigator.userAgent)); arrParams.push("sw=" + sw); arrParams.push("sh=" + sh); arrParams.push("bw=" + bw); arrParams.push("bh=" + bh); arrParams.push("cd=" + cd); arrParams.push("ce=" + ce); arrParams.push("je=" + je); arrParams.push("pe=" + pe); arrParams.push("fv=" + fv); arrParams.push("p1=" + p1); arrParams.push("p2=" + p2); arrParams.push("p3=" + p3); arrParams.push("p4=" + p4); arrParams.push("c1=" + c1); arrParams.push("c2=" + c2); arrParams.push("c3=" + c3); arrParams.push("c4=" + c4); arrParams.push("ref=" + ref); arrParams.push("lan=" + lan); //var scriptString = ""; var httphost = "www.multisite.amag.ch"; var pathinfo = "/statistik/browsercap_js.asp"; pathinfo = pathinfo.substring(0, pathinfo.lastIndexOf( "browsercap_js.asp")); var http = "http://"; //if ("80" == "81") { // http = "https://"; //} if (site.indexOf("https://")>-1) { http = "https://"; } var scriptString = ""; if ( DEBUG ) { alert( "about to write scriptString: \n\n" + scriptString ); alert ("Server Port: 80"); var hrefString = "script"; document.write( hrefString ); } // DEBUG document.write( scriptString ); if ( DEBUG ) alert( "END tracking_init()" ); } // tracking_init() //-----------------------------------------------------------------------------| function pdfEnabled() { return false; } // pdfEnabled() //-----------------------------------------------------------------------------| function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else begin += 2; var end = document.cookie.indexOf(";", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin + prefix.length, end)); } //-----------------------------------------------------------------------------| function getFlashVersion() { var flashinstalled = 0; var flashversion = 0; if (navigator.plugins && navigator.plugins.length) { x = navigator.plugins["Shockwave Flash"]; if (x) { flashinstalled = 2; if (x.description) { y = x.description; flashversion = y.charAt(y.indexOf('.')-1); } } else { flashinstalled = 1; } if (navigator.plugins["Shockwave Flash 2.0"]) { flashinstalled = 2; flashversion = 2; } } else if (navigator.mimeTypes && navigator.mimeTypes.length) { x = navigator.mimeTypes['application/x-shockwave-flash']; if (x && x.enabledPlugin) flashinstalled = 2; else flashinstalled = 1; } else { flashversion = getFlashVersionIE(); //call VBScript Function } return(flashversion); } //-----------------------------------------------------------------------------|