"use strict";
/**
 * Dpc SuperTag for WebTrends v2.4
 *
 * @license Copyright (c) 2009 Direct Performance
 * jTag by Direct Performance (http://www.directperformance.com.br) is licensed under a Creative Commons Atribuicao-Uso Nao-Comercial-Compartilhamento pela mesma Licenca 2.5 Brasil License (http://creativecommons.org/licenses/by-nc-sa/2.5/br/).
 *
 * $Date: 2010/08/19 16:36:50 $
 * @fileoverview funcoes para auxiliar a implementacao do WebTrends
 * @author DirectPerformance -  http://www.directperformance.com.br/ <contato@directperformance.com.br>
 * @version $Revision: acf62451652f $
 */
/**
 * WebTrends SmartSource Data Collector
 * Copyright (c) 1996-2006 WebTrends Inc. All rights reserved.
 * $DateTime: 2006/03/01 12:51:54 $
 * Versao: 8.0.3
 */
try{var gImages=[],gIndex=0,DCS={},WT={},DCSext={},gQP=[],gI18n=false;if(window.RegExp){var RE=gI18n?{"%25":/\%/g}:{"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g,"%22":/\"/g,"%7F":/\x7F/g,"%A0":/\xA0/g};if(gI18n)var EXRE=/dcs(uri)|(ref)|(aut)|(met)|(sta)|(sip)|(pro)|(byt)|(dat)|(p3p)|(cfg)|(redirect)|(cip)/i}var dcsGetCookie=function(a){var b=document.cookie.indexOf(a+"=");if(b!=-1){a=b+a.length+1;b=document.cookie.indexOf(";",a);if(b==-1)b=document.cookie.length;
return unescape(document.cookie.substring(a,b))}return null},dcsGetCrumb=function(a,b){for(var c=dcsGetCookie(a).split(":"),d=0;d<c.length;d++){var e=c[d].split("=");if(b==e[0])return e[1]}return null},dcsGetIdCrumb=function(a,b){var c=dcsGetCookie(a);c=c.substring(0,c.indexOf(":lv=")).split("=");for(var d=0;d<c.length;d++)if(b==c[0])return c[1];return null},dcsIsFpcSet=function(a,b,c){if(b==dcsGetIdCrumb(a,"id"))if(c==dcsGetCrumb(a,"lv"))if(dcsGetCrumb(a,"ss"))return true;return false},dcsGetMeta=
function(a){var b;if(document.all)b=document.all.tags("meta");else if(document.documentElement)b=document.getElementsByTagName("meta");if(typeof b!="undefined")for(var c=1;c<=b.length;c++){var d=b.item(c-1);if(d.name&&d.name.indexOf(a)==0)return d.content}return null},dcsFPC=function(a){if(typeof a!="undefined")if(document.cookie.indexOf("WTLOPTOUT=")==-1){var b=gFpc,c=new Date,d=c.getTimezoneOffset()*6E4+a*36E5;c.setTime(c.getTime()+d);var e=new Date(c.getTime()+31536E7);a=new Date(c.getTime());
WT.co_f=WT.vt_sid=WT.vt_f=WT.vt_f_a=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";if(document.cookie.indexOf(b+"=")==-1){if(typeof gWtId!="undefined"&&gWtId!="")WT.co_f=gWtId;else{if(typeof gTempWtId!="undefined"&&gTempWtId!="")WT.co_f=gTempWtId;else{WT.co_f="2";for(var g=c.getTime().toString(),f=2;f<=32-g.length;f++)WT.co_f+=Math.floor(Math.random()*16).toString(16);WT.co_f+=g}WT.vt_f="1"}if(typeof gWtAccountRollup=="undefined")WT.vt_f_a="1";WT.vt_f_s=WT.vt_f_d="1";WT.vt_f_tlh=WT.vt_f_tlv="0"}else{f=
dcsGetIdCrumb(b,"id");var i=parseInt(dcsGetCrumb(b,"lv"));g=parseInt(dcsGetCrumb(b,"ss"));if(f==null||f=="null"||isNaN(i)||isNaN(g))return;WT.co_f=f;f=new Date(i);WT.vt_f_tlh=Math.floor((f.getTime()-d)/1E3);a.setTime(g);if(c.getTime()>f.getTime()+18E5||c.getTime()>a.getTime()+288E5){WT.vt_f_tlv=Math.floor((a.getTime()-d)/1E3);a.setTime(c.getTime());WT.vt_f_s="1"}if(c.getDay()!=f.getDay()||c.getMonth()!=f.getMonth()||c.getYear()!=f.getYear())WT.vt_f_d="1"}WT.co_f=escape(WT.co_f);WT.vt_sid=WT.co_f+
"."+(a.getTime()-d);d="; expires="+e.toGMTString();document.cookie=b+"=id="+WT.co_f+":lv="+c.getTime().toString()+":ss="+a.getTime().toString()+d+"; path="+gFpcPath+(typeof gFpcDom!="undefined"&&gFpcDom!=""?"; domain="+gFpcDom:"");if(!dcsIsFpcSet(b,WT.co_f,c.getTime().toString(),a.getTime().toString())){WT.co_f=WT.vt_sid=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";WT.vt_f=WT.vt_f_a="2"}}},dcsCookie=function(){if(typeof dcsOther=="function")dcsOther();else if(typeof dcsPlugin=="function")dcsPlugin();
else typeof dcsFPC=="function"&&dcsFPC(gTimeZone)},dcsTP=function(){if(document.cookie.indexOf("WTLOPTOUT=")==-1){if(document.cookie.indexOf("WT_DC=")!=-1&&dcsGetCrumb("WT_DC","tsp")=="1")WT.ttp="1";if(dcsGetMeta("SmartView_Page")=="1"){WT.tsp="1";document.cookie="WT_DC=tsp=1; expires=Thu, 31-Dec-2020 08:00:00 GMT; path=/"}else document.cookie="WT_DC=; expires=Sun, 1-Jan-1995 00:00:00 GMT;; path=/"}};dcsGetCookie=function(a){var b=document.cookie.indexOf(a+"=");if(b!=-1){a=b+a.length+1;b=document.cookie.indexOf(";",
a);if(b==-1)b=document.cookie.length;return unescape(document.cookie.substring(a,b))}return null};dcsGetCrumb=function(a,b){for(var c=dcsGetCookie(a).split(":"),d=0;d<c.length;d++){var e=c[d].split("=");if(b==e[0])return e[1]}return null};var dcsDynamic=function(a){if(a=a||window.event||""){var b=dcsEvt(a,"A");if(b.href&&b.protocol){var c=b.search?b.search.substring(b.search.indexOf("?")+1,b.search.length):"";if(c.toUpperCase().indexOf("WT.SVL=")==-1)WT.svl=dcsParseSvl(b.name?b.name.toString():b.onclick?
b.onclick.toString():"");if(b.protocol.indexOf("http")!=-1){if(b.hostname&&dcsIsOnsite(b.hostname))if(WT.svl&&WT.svl!=""){var d=b.pathname?b.pathname.indexOf("/")!=0?"/"+b.pathname:b.pathname:"/";dcsSaveHref(a);dcsMultiTrack("DCS.dcssip",b.hostname,"DCS.dcsuri",d,"DCS.dcsqry",c,"WT.ti","Custom:"+b.hostname+d+c,"WT.cl","cm");DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.cl=""}}else if(b.protocol=="javascript:"){dcsMultiTrack("DCS.dcssip","","DCS.dcsuri",b.href,"WT.ti","JavaScript:"+b.innerHTML,"WT.cl",
"js");DCS.dcssip=DCS.dcsuri=WT.ti=WT.cl=""}else if(b.protocol=="mailto:"){dcsMultiTrack("DCS.dcssip","","DCS.dcsuri",b.href,"WT.ti","MailTo:"+b.innerHTML,"WT.cl","mt");DCS.dcssip=DCS.dcsuri=WT.ti=WT.cl=""}WT.svl=""}}},dcsHandler=function(a){if(a=a||window.event||""){var b=dcsEvt(a,"A"),c=b.pathname?b.pathname.indexOf("/")!=0?"/"+b.pathname:b.pathname:"/",d=b.firstChild.data?b.firstChild.data:"";dcsSaveHref(a);dcsMultiTrack("DCS.dcssip",b.hostname,"DCS.dcsuri",c,"WT.ti",d);DCS.dcssip=DCS.dcsuri=WT.ti=
""}},dcsFunc=function(a){typeof window[a]=="function"&&window[a]()},dcsA=function(a,b){if(gI18n&&!EXRE.test(a))if(a=="dcsqry"){for(var c="",d=b.substring(1).split("&"),e=0;e<d.length;e++){var g=d[e],f=g.indexOf("=");if(f!=-1){var i=g.substring(0,f);g=g.substring(f+1);if(e!=0)c+="&";c+=i+"="+dcsEncode(g)}}b=b.substring(0,1)+c}else b=dcsEncode(b);return"&"+a+"="+dcsEscape(b,RE)},dcsTag=function(){if(document.cookie.indexOf("WTLOPTOUT=")==-1){var a="http://"+gDomain+(gDcsId==""?"":"/"+gDcsId)+"/dcs.gif?";
for(var b in DCS)if(DCS[b])a+=dcsA(b,DCS[b]);for(var c=["co_f","vt_sid","vt_f_tlv"],d=0;d<c.length;d++){var e=c[d];if(WT[e]){a+=dcsA("WT."+e,WT[e]);delete WT[e]}}for(b in WT)if(WT[b])a+=dcsA("WT."+b,WT[b]);for(b in DCSext)if(DCSext[b])a+=dcsA(b,DCSext[b]);if(a.length>2048&&navigator.userAgent.indexOf("MSIE")>=0)a=a.substring(0,2040)+"&WT.tu=1";dcsCreateImage(a)}},dcsMultiTrack=function(){if(arguments.length%2==0){for(var a=0;a<arguments.length;a+=2)if(arguments[a].indexOf("WT.")==0)WT[arguments[a].substring(3)]=
arguments[a+1];else if(arguments[a].indexOf("DCS.")==0)DCS[arguments[a].substring(4)]=arguments[a+1];else if(arguments[a].indexOf("DCSext.")==0)DCSext[arguments[a].substring(7)]=arguments[a+1];DCS.dcsdat=(new Date).getTime();dcsFunc("dcsCookie");dcsTag()}},dcsOffsite=function(a){if(a=a||window.event||""){var b=dcsEvt(a,"A");if(b.hostname&&!dcsIsOnsite(b.hostname)){var c=b.search?b.search.substring(b.search.indexOf("?")+1,b.search.length):"";if(c.toUpperCase().indexOf("WT.SVL=")==-1)WT.svl=dcsParseSvl(b.name?
b.name.toString():b.onclick?b.onclick.toString():"");var d=b.pathname?b.pathname.indexOf("/")!=0?"/"+b.pathname:b.pathname:"/";dcsSaveHref(a);dcsMultiTrack("DCS.dcssip",b.hostname,"DCS.dcsuri",d,"DCS.dcsqry","","WT.ti","Offsite:"+b.hostname+d+c,"WT.os","1");DCS.dcssip=DCS.dcsuri=DCS.dcsqry=WT.ti=WT.svl=WT.os=""}}},dcsQP=function(a){if(typeof a=="undefined")return"";var b=location.search.substring(1);if(b!=""){b=b.split("&");for(var c=0;c<b.length;c++){var d=b[c].indexOf("=");if(d!=-1)if(b[c].substring(0,
d)==a){gQP[gQP.length]=(c==0?"":"&")+b[c];return b[c].substring(d+1)}}}return""};dcsTP=function(){if(document.cookie.indexOf("WTLOPTOUT=")==-1){if(document.cookie.indexOf("WT_DC=")!=-1&&dcsGetCrumb("WT_DC","tsp")=="1")WT.ttp="1";if(dcsGetMeta("SmartView_Page")=="1"){WT.tsp="1";document.cookie="WT_DC=tsp=1; expires=Thu, 31-Dec-2020 08:00:00 GMT; path=/"}else document.cookie="WT_DC=; expires=Sun, 1-Jan-1995 00:00:00 GMT;; path=/"}};dcsGetMeta=function(a){var b;if(document.all)b=document.all.tags("meta");
else if(document.documentElement)b=document.getElementsByTagName("meta");if(typeof b!="undefined")for(var c=1;c<=b.length;c++){var d=b.item(c-1);if(d.name&&d.name.indexOf(a)==0)return d.content}return null};var dcsJV=function(){var a=navigator.userAgent.toLowerCase(),b=parseInt(navigator.appVersion),c=a.indexOf("mac")!=-1,d=a.indexOf("firefox")!=-1,e=a.indexOf("firefox/0.")!=-1,g=a.indexOf("firefox/1.0")!=-1,f=a.indexOf("firefox/1.5")!=-1,i=d&&!e&&!g&!f,k=!d&&a.indexOf("mozilla")!=-1&&a.indexOf("compatible")==
-1;d=k&&b==4;k=k&&b>=5;var h=a.indexOf("msie")!=-1&&a.indexOf("opera")==-1;b=h&&b==4&&a.indexOf("msie 4")!=-1;h=h&&!b;var l=a.indexOf("opera")!=-1,m=a.indexOf("opera 5")!=-1||a.indexOf("opera/5")!=-1;a=a.indexOf("opera 6")!=-1||a.indexOf("opera/6")!=-1;l=l&&!m&&!a;var j="1.1";if(i)j="1.7";else if(f)j="1.6";else if(e||g||k||l)j="1.5";else if(c&&h||a)j="1.4";else if(h||d||m)j="1.3";else if(b)j="1.2";return j},dcsVar=function(){var a=new Date;WT.tz=a.getTimezoneOffset()/60*-1;if(WT.tz==0)WT.tz="0";WT.bh=
a.getHours();WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;if(typeof screen=="object"){WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;WT.sr=screen.width+"x"+screen.height}if(typeof navigator.javaEnabled()=="boolean")WT.jo=navigator.javaEnabled()?"Yes":"No";if(document.title)WT.ti=document.title;WT.js="Yes";WT.jv=dcsJV();if(document.body&&document.body.addBehavior){document.body.addBehavior("#default#clientCaps");WT.ct=document.body.connectionType||
"unknown";document.body.addBehavior("#default#homePage");WT.hp=document.body.isHomePage(location.href)?"1":"0"}else WT.ct="unknown";if(parseInt(navigator.appVersion)>3)if(navigator.appName=="Microsoft Internet Explorer"&&document.body)WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight;else if(navigator.appName=="Netscape")WT.bs=window.innerWidth+"x"+window.innerHeight;WT.fi="No";if(window.ActiveXObject)for(var b=10;b>0;b--)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b);WT.fi=
"Yes";WT.fv=b+".0";break}catch(c){}else if(navigator.plugins&&navigator.plugins.length)for(b=0;b<navigator.plugins.length;b++)if(navigator.plugins[b].name.indexOf("Shockwave Flash")!=-1){WT.fi="Yes";WT.fv=navigator.plugins[b].description.split(" ")[2];break}if(gI18n){WT.em=typeof encodeURIComponent=="function"?"uri":"esc";if(typeof document.defaultCharset=="string")WT.le=document.defaultCharset;else if(typeof document.characterSet=="string")WT.le=document.characterSet}WT.tv="8.0.3";WT.sp="@@SPLITVALUE@@";
DCS.dcsdat=a.getTime();DCS.dcssip=window.location.hostname;DCS.dcsuri=window.location.pathname;if(window.location.search){DCS.dcsqry=window.location.search;if(gQP.length>0)for(b=0;b<gQP.length;b++){var d=DCS.dcsqry.indexOf(gQP[b]);if(d!=-1){a=DCS.dcsqry.substring(0,d);d=DCS.dcsqry.substring(d+gQP[b].length,DCS.dcsqry.length);DCS.dcsqry=a+d}}}if(window.document.referrer!=""&&window.document.referrer!="-")if(!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4))DCS.dcsref=
window.document.referrer},dcsEscape=function(a,b){if(typeof b!="undefined"){var c=String(a);for(var d in b)c=c.replace(b[d],d);return c}else return escape(a)},dcsEncode=function(a){return typeof encodeURIComponent=="function"?encodeURIComponent(a):escape(a)},dcsCreateImage=function(a){if(document.images){gImages[gIndex]=new Image;gImages[gIndex].src=a;gIndex++}else document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+a+'">')},dcsMeta=function(){var a;if(document.all)a=
document.all.tags("meta");else if(document.documentElement)a=document.getElementsByTagName("meta");if(typeof a!="undefined")for(var b=a.length,c=0;c<b;c++){var d=a.item(c).name,e=a.item(c).content,g=a.item(c).httpEquiv;if(d.length>0)if(d.indexOf("WT.")==0)WT[d.substring(3)]=e;else if(d.indexOf("DCSext.")==0)DCSext[d.substring(7)]=e;else{if(d.indexOf("DCS.")==0)DCS[d.substring(4)]=e}else if(gI18n&&g=="Content-Type"){d=e.toLowerCase().indexOf("charset=");if(d!=-1)WT.mle=e.substring(d+8)}}},dcsAdv=function(){dcsFunc("dcsET");
dcsFunc("dcsCookie");dcsFunc("dcsAdSearch");dcsFunc("dcsTP")};dcsVar();dcsMeta();dcsFunc("dcsAdv");if(typeof dpc_wt_conf==="undefined"||dpc_wt_conf.enable_auto_pageview===true)dcsTag()}catch(exception){if(typeof console!=="undefined"&&typeof console.error!=="undefined")console.error("WT-Core Exception "+(exception.name||"Error"),exception.message||exception)}
var dpc_wt_core={URL:document.location.href.toLowerCase(),REFERRER:document.referrer.toLowerCase(),PATHNAME:document.location.pathname.toLowerCase(),HOSTNAME:window.location.hostname.toLowerCase(),enconde:function(a){return escape(a)},sanitize:function(a,b){a=dpc_query.trim(a).toLowerCase().replace(/\s+/g,"_").replace(/[\u00e1\u00e0\u00e2\u00e3\u00e4\u00aa]/g,"a").replace(/[\u00e9\u00e8\u00ea\u00eb]/g,"e").replace(/[\u00ed\u00ec\u00ee\u00ef]/g,"i").replace(/[\u00f3\u00f2\u00f4\u00f5\u00f6\u00ba]/g,
"o").replace(/[\u00fa\u00f9\u00fb\u00fc]/g,"u").replace(/\u00e7/g,"c");if(b===true)a=a.replace(/\W/g,"_").replace(/_+/g,"_");return a},get_identifier:function(a,b){return(b!==false&&arguments.length>1?a.attr(b):dpc_query.trim(a.text())||a.attr("id")||a.attr("name")||a.attr("onclick")||a.attr("href")||a.attr("title")||a.attr("alt")||a.attr("src")||a.attr("class")||a[0].tagName.toLowerCase()).substring(0,100)},is_null:function(a){return!(a&&(a+"").length>0)},track:function(a,b,c,d){try{if(typeof dpc_wt_custom!==
"undefined"&&typeof dpc_wt_custom.hook_track==="function")try{dpc_wt_custom.hook_track(a,b,c,d)}catch(e){dpc_wt_core.track_error(e,"hook_track: "+e.message)}if(typeof dcsMultiTrack==="function"){var g="",f=a.indexOf("?");if(f>0){g=a.substring(f);a=a.substring(0,f)}dcsMultiTrack("DCS.dcssip",dpc_wt_core.HOSTNAME,"DCS.dcsuri",dpc_wt_core.enconde(a),"DCS.dcsqry",g,"WT.ti",dpc_wt_core.enconde(b),"WT.cl",c,"WT.z_convert",d);DCS.dcsqry=DCS.dcsuri=WT.ti=WT.cl=WT.z_convert=""}else throw Error("dcsMultiTrack not available");
}catch(i){if(typeof console!=="undefined"&&typeof console.error!=="undefined")console.error("Track Exception "+(i.name||"Error"),i.message||i)}},add_special_track:function(a){if(typeof a!=="object")return false;var b,c;for(b=0;b<a.length;b++)if(a.hasOwnProperty(b)){c=a[b];c["DCS.dcsuri"]=dpc_wt_core.is_null(c["DCS.dcsuri"])?dpc_wt_core.PATHNAME:dpc_wt_core.PATHNAME+c["DCS.dcsuri"];if(dpc_wt_core.is_null(c.identifier))c.identifier=false;if(dpc_wt_core.is_null(c["WT.ti"]))c["WT.ti"]=document.title;
if(dpc_wt_core.is_null(c["WT.cl"]))c["WT.cl"]="";if(dpc_wt_core.is_null(c["WT.z_convert"]))c["WT.z_convert"]="";if(typeof c.func!=="function")c.func=function(d,e){d["WT.ti"]+=" - "+dpc_wt_core.get_identifier(dpc_query(e),d.identifier)};dpc_query(a[b].selector).live("mousedown",function(d,e,g,f,i,k){return function(){try{var h={};h.identifier=d;h["DCS.dcsuri"]=g;h["WT.ti"]=f;h["WT.cl"]=i;h["WT.z_convert"]=k;e(h,this);dpc_wt_core.track(h["DCS.dcsuri"],h["WT.ti"],h["WT.cl"],h["WT.z_convert"])}catch(l){dpc_wt_core.track_error(l,
"track: "+l.message)}}}(c.identifier,c.func,c["DCS.dcsuri"],c["WT.ti"],c["WT.cl"],c["WT.z_convert"]))}},track_error:function(a,b){if(typeof console!=="undefined"&&typeof console.error!=="undefined")console.error("Exception "+(a.name||"Error"),b||a.message||a);dpc_wt_core.track("/event/js_error/"+dpc_wt_core.PATHNAME,"JS Exception: "+(a.name||"Error")+" - "+(b||a.message||a))}};
try{if(typeof dpc_wt_custom!=="undefined"&&typeof dpc_wt_custom.hook_asap==="function")try{dpc_wt_custom.hook_asap(dpc_wt_core.URL,dpc_wt_core.REFERRER)}catch(e$$6){dpc_wt_core.track_error(e$$6,"hook_asap: "+e$$6.message)}if(dpc_wt_conf.enable_jquery===true){if(typeof jQuery==="function"){jQuery.extend(jQuery.expr[":"],{regex:function(a,b,c){return RegExp(c[3],"i").test(jQuery(a).text())},hrefregex:function(a,b,c){if(!a.href)return false;return RegExp(c[3],"i").test(a.href)},actionregex:function(a,
b,c){if(!a.action)return false;return RegExp(c[3],"i").test(a.action)},external:function(a){if(!a.href||a.href.indexOf("javascript:")===0||a.href.indexOf("mailto:")===0)return false;return a.hostname&&a.hostname!==document.location.hostname}});var dpc_query=jQuery}else throw Error("jQuery not available");dpc_query(document).ready(function(){if(typeof dpc_wt_custom!=="undefined"&&typeof dpc_wt_custom.hook_onload==="function")try{dpc_wt_custom.hook_onload(dpc_wt_core.URL,dpc_wt_core.REFERRER)}catch(a){dpc_wt_core.track_error(a,
"hook_onload: "+a.message)}if(typeof dpc_wt_core!=="undefined"&&typeof dpc_wt_core.add_special_track==="function")try{dpc_wt_core.add_special_track(dpc_wt_conf.link_track)}catch(b){dpc_wt_core.track_error(b,"add_special_track: "+b.message)}});dpc_query(window).unload(function(){if(typeof dpc_wt_custom!=="undefined"&&typeof dpc_wt_custom.hook_onunload=="function")try{dpc_wt_custom.hook_onunload(dpc_wt_core.URL,dpc_wt_core.REFERRER)}catch(a){dpc_wt_core.track_error(a,"hook_onunload: "+a.message)}})}}catch(exception$$3){dpc_wt_core.track_error(exception$$3)};
