ToyotaWebTrends.prototype=new WebTrends();ToyotaWebTrends.prototype.constructor=ToyotaWebTrends();function ToyotaWebTrends(dcsid,domain)
{this.loaded=0;this.submitted=0;this._dcsext={};this._dcs={};this._startTime=0;this._maxTime=3600;this._lastInteraction=0;this._timers={total:{start:0,duration:0,running:0}};if(typeof(this._eventParams)=="undefined")
this._eventParams={};WebTrends.apply(this,arguments);}
ToyotaWebTrends.prototype._getParam=function(strParam){var _pstr=document.location.search.substring(1);var _uparams=_pstr.split("&");for(i=0;i<_uparams.length;i++){var np=_uparams[i].split("=");if(this._trim(np[0].toLowerCase())==strParam.toLowerCase())
return this._trim(np[1]);}
return"";}
ToyotaWebTrends.prototype._getHashParam=function(strParam){if(strParam=="")
return"";var _pstr=document.location.hash.substring(1);var _uparams=_pstr.split("&");var _paramlist=new Object();for(var i=0;i<_uparams.length;i++){var np=_uparams[i].split("=");if(np.length==2)
{_paramlist[this._trim(np[0])]=this._trim(np[1]);}
if(strParam!=null&&strParam!=""&&this._trim(np[0].toLowerCase())==strParam.toLowerCase())
{return this._trim(np[1]);break;}}
return _paramlist;}
ToyotaWebTrends.prototype._trim=function(val){return val.replace(/^\s+|\s+$/g,'');}
ToyotaWebTrends.prototype._setCookie=function(cookieName,cookieValue,expire,strDomain){var pdm="";if(strDomain&&strDomain!="")
pdm=" domain="+strDomain+";";if((typeof(expire))=="object")
document.cookie=cookieName+"="+cookieValue+";expires="+expire.toGMTString()+"; path=/;"+pdm;else
document.cookie=cookieName+"="+cookieValue+"; path=/;"+pdm;}
ToyotaWebTrends.prototype._getCookie=function(strParam){var _ucookies=document.cookie.split(";");for(i=0;i<_ucookies.length;i++){var np=_ucookies[i].split("=");if(this._trim(np[0].toLowerCase())==strParam.toLowerCase())
{var val="";for(i=1;i<np.length;i++)
{if(i>1)
val+="=";val+=np[i];}
return unescape(this._trim(val));}}
return"";};ToyotaWebTrends.prototype._sendData=function()
{if(arguments.length>0)
t=arguments[0];else
t=this;var arglist=Array();for(var i in t._dcsext)
{arglist.push("DCSext."+i);arglist.push(t._dcsext[i]);}
t.dcsVar();t.dcsMeta();t.dcsAdv();if(typeof(t._dcs)!="")
{for(var d in t._dcs)
{t.DCS[d]=t._dcs[d];}};if(arglist.length>0||(typeof(t.WT)!="undefined"))
t.dcsMultiTrack.apply(t,arglist);for(var i in t._dcsext)
{delete(t._dcsext[i]);delete(t.DCSext[i]);}
try{delete(t.WT.cg_n);delete(t.WT.cg_s);}catch(err){}
try{delete(t.WT.flv_name);delete(t.WT.flv_status);}catch(err){}
try{delete(t.WT.ac);}catch(err){}};ToyotaWebTrends.prototype.ReceiveEvent=function(eventObj)
{if(typeof(eventObj)!="object")
return;var ev="";if(typeof(eventObj.Event)!="undefined")
ev=eventObj.Event.toLowerCase();else if(typeof(eventObj.EventClass)!="undefined"&&typeof(eventObj.Action)!="undefined")
ev=eventObj.EventClass.toLowerCase()+eventObj.Action.toLowerCase();else
return;var ts=Math.round(new Date().getTime()/1000);var myT=this;if(this._lastInteraction==0)
this._lastInteraction=ts;if(typeof(this._eventParams[ev])!="undefined")
{this._eventParams[ev].RunHandlers(eventObj,myT);this._lastInteraction=ts;}};ToyotaWebTrends.prototype.Unload=function()
{if(typeof(this._unloadEvents)=="undefined")
return;var t=this;try{for(var i=0;i<this._unloadEvents.length;i++)
{this._unloadEvents[i].call(this,t);}}catch(err){}}
ToyotaWebTrends.prototype._setTimer=function(tid)
{var ts=Math.round(new Date().getTime()/1000);var o=ts-this._lastInteraction;for(var i in this._timers)
{if(tid!=undefined&&i!="total"&&this._timers[i].running==1)
{this._timers[i].running=0;if(o>this._maxTime)
this._timers[i].duration=0;else
this._timers[i].duration+=ts-this._timers[i].start;this._timers[i].start=0;}}
if(typeof(this._timers[tid])=="undefined")
this._timers[tid]={start:ts,duration:0,running:1};else
{this._timers[tid].start=ts;this._timers[tid].running=1;}
if(this._timers.total.start==0)
{this._timers.total.start=ts;this._timers.total.running=1;}
if(o>this._maxTime)
{this._timers.total.duration=0;this._lastInteraction=0;this._timers.total.start=0;}
else
this._timers.total.duration=ts-this._timers.total.start;}
var EventObj=function(fireWhen,handler)
{this.Fire=fireWhen;this._handlers=Array();if(typeof(handler)=="function")
this._handlers.push(handler);this.AddHandler=function(f){this._handlers.push(f);}
this.RunHandlers=function(evObj,wtObj)
{var isOK=0;if(this.Fire.toLowerCase()=="once")
{var c=wtObj._getCookie(wtObj._cookieName);if(c=="")isOK=1;if(c.indexOf(evObj.Event)>=0)
isOK=0;else
{c+="|"+evObj.Event;wtObj._setCookie(wtObj._cookieName,c);isOK=1;}}
else if(this.Fire.toLowerCase()=="always")
isOK=1;if(isOK==1)
{for(var i=0;i<this._handlers.length;i++)
{this._handlers[i].call(this,evObj);}}}};ToyotaWebTrends.prototype.TrackFindADealerLoad=function()
{if(document.location.hostname.indexOf('nowwhere')>0)
{this.fpcdom=".nowwhere.com.au";if(document.location.search.indexOf('wtid')>0)
{var wtid=this._getParam('wtid');var dexp=new Date();dexp.setDate(dexp.getDate()+365);this._setCookie('WT_FPC',unescape(wtid),dexp,'.nowwhere.com.au');}}
var arglist=new Array('DCS.dcsuri','/dealer','WT.ti','Find a Dealer','WT.cg_n','MDS','WT.cg_s','Dealer Search application');if(this._getParam('postcode')!=""&&this.submitted==0)
{arglist.push('WT.FAD_submit',1);this.submitted=1;}
if(this.loaded==0)
{arglist.push('WT.FAD_start',1);this.loaded=1;}
this.dcsVar();this.dcsMeta();this.dcsAdv();this.dcsMultiTrack.apply(this,arglist);delete(this.WT.FAD_start);delete(this.WT.FAD_submit);}
ToyotaWebTrends.prototype.TrackFindADealerSubmit=function(stype)
{var arglist=new Array('DCS.dcsuri','/dealer','WT.ti','Find a Dealer','WT.cg_n','MDS','WT.cg_s','Dealer Search application');if(stype.toLowerCase()=="location")
arglist.push('WT.ac','SeachbylocationMDS','DCSext.ConversionPt','SearchbylocationMDS');else
arglist.push('WT.ac','FindadealerMDS','DCSext.ConversionPt','FindaDealerMDS');if(this.loaded==0)
{arglist.push('WT.FAD_start',1);this.loaded=1;}
if(this.submitted==0)
{arglist.push('WT.FAD_submit',1);this.submitted=1;}
this.dcsVar();this.dcsMeta();this.dcsAdv();this.dcsMultiTrack.apply(this,arglist);delete(this.WT.FAD_start);delete(this.WT.FAD_submit);}
