VihtoriDataCollector = function() { var trf = ' '; var thn = ' '; var tpn = ' '; var tqr = ' '; var screen_res = ''; var color_depth = ''; var dataTime = new Date(); var referrer_hostname = ''; var qStr = null; var advertisement_id = ''; try{ treferrer=top.document.referrer ? top.document.referrer : ""; thostnane=top.location.hostname ? top.location.hostname : ""; tpathname=top.location.pathname ? top.location.pathname : ""; tsearch=top.location.search ? top.location.search : ""; } catch(err) { try{ treferrer=parent.document.referrer ? parent.document.referrer : ""; thostnane=parent.location.hostname ? parent.location.hostname : ""; tpathname=parent.location.pathname ? parent.location.pathname : ""; tsearch=parent.location.search ? parent.location.search : ""; } catch(err) { treferrer=document.referrer ? document.referrer : ""; thostnane=location.hostname ? location.hostname : ""; tpathname=location.pathname ? location.pathname : ""; tsearch=location.search ? location.search : ""; }; }; try{ screen_res = screen.width && screen.height ? screen.width+' x '+screen.height : ""; } catch (err) { screen_res = ""; }; try{ color_depth = screen.colorDepth ? screen.colorDepth : ""; } catch(err) { color_depth = ""; } if (document.referrer) { var referrerMatchArray = document.referrer.toLowerCase().match( "^[^:]+[:/]+([^@]+@)?([^:/?]+)[:/]?" ); referrer_hostname = referrerMatchArray[2]; } var track_id = getValue(document.cookie,"track_id","; "); if (track_id == null || track_id == '') { var date = new Date(); track_id = '534b227d4bf5ad60d31b8cc49053d0ad'; date.setTime(date.getTime()+(360*24*60*60*1000)); document.cookie = 'track_id='+track_id+'; expires='+ date.toGMTString() + '; path=/'; } if(location.search.length > 1) qStr = location.search.substring(1, location.search.length); var referrer_params = decodeURI(document.referrer); //document.write(""); referrer_params = vihtoriEncodeURI(referrer_params ? referrer_params.split('?')[1] : ""); referrer_params = (referrer_params ? referrer_params.replace(/&/g, '%26') : ""); referrer_params = (referrer_params ? referrer_params.replace(/=/g, '%3d') : ""); if (qStr!= null) { advertisement_id = getValue(qStr,"bannerid","&"); if (advertisement_id == "") advertisement_id = getValue(qStr,"adwordid","&"); } data = new Array(); data[data.length] = 'tracking_code=' + vihtoriEncodeURI("4eaabca27e3a9447bd234f9d8c4fc862"); data[data.length] = 'track_id=' + vihtoriEncodeURI(track_id); data[data.length] = 'advertisement_id=' + vihtoriEncodeURI(advertisement_id); data[data.length] = 'url=' + vihtoriEncodeURI(document.URL ? document.URL.split('?')[0] : ""); data[data.length] = 'browser=' + vihtoriEncodeURI(navigator.appName ? navigator.appName : ""); data[data.length] = 'browser_version=' + vihtoriEncodeURI(navigator.appVersion ? navigator.appVersion : ""); data[data.length] = 'browser_lang=' + vihtoriEncodeURI(navigator.language ? navigator.language : ""); data[data.length] = 'platform=' + vihtoriEncodeURI(navigator.platform ? navigator.platform : ""); data[data.length] = 'system_lang=' + vihtoriEncodeURI(navigator.systemLanguage ? navigator.systemLanguage : ""); data[data.length] = 'referrer_url=' + vihtoriEncodeURI(document.referrer ? document.referrer.split('?')[0] : ""); data[data.length] = 'referrer_params=' + referrer_params; data[data.length] = 'referrer_hostname=' + vihtoriEncodeURI(referrer_hostname); var title = document.title; title = title.replace("&", "et"); data[data.length] = 'doc_title=' + vihtoriEncodeURI(title ? title : ""); data[data.length] = 'top_referrer=' + vihtoriEncodeURI(trf); data[data.length] = 'top_hostname=' + vihtoriEncodeURI(thn); data[data.length] = 'top_pathname=' + vihtoriEncodeURI(tpn); data[data.length] = 'top_search=' + vihtoriEncodeURI(tqr); data[data.length] = 'hostname=' + vihtoriEncodeURI(location.hostname ? location.hostname : ""); data[data.length] = 'pathname=' + vihtoriEncodeURI(location.pathname ? location.pathname : ""); data[data.length] = 'search=' + vihtoriEncodeURI(location.search ? location.search : ""); data[data.length] = 'history_length=' + vihtoriEncodeURI(history.length ? history.length : ""); data[data.length] = 'screen_res=' + vihtoriEncodeURI(screen_res); data[data.length] = 'color_depth=' + vihtoriEncodeURI(color_depth); data[data.length] = 'java_enabled=' + vihtoriEncodeURI(navigator.javaEnabled() ? 1 : 0); var qstr = ""; if (data.length > 0) { for (i = 0; i < data.length-1; i++) { qstr += data[i] + "&"; } qstr += data[data.length-1]; } var trackUrl = "http://www.vihtori-analytics.fi/analysingtool/trackinfo.php?" + qstr; var tag1 = "