/* Omniture Optimization Suite
 * Copyright (c) Omniture 2001-2008. All rights reserved. Patent Pending.
 * Privacy Policy at http://www.omniture.com/privacy/
*/
/************************** CONFIG SECTION **************************/
/* You may add or alter any code config here. */

window.tc = window.tc || {};
tc.site_id = tc.site_id || 459;
tc.log_path = tc.log_path || "/script/omniture";
tc.server_hostname = tc.server_hostname || "tc.tdameritrade.com";
tc.timeout=3;

/************************** PLUGINS SECTION *************************/


/* #591 - adding tc_extra_info_from_analytics.js */
tc.extraInfoFromAnalytics = {
  propList : "pageName, channel, events",
  source : "omtr.data",
  encode : true
};

/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
window.undefined=window.undefined;window.omtr=window.omtr||{};omtr.extend=function(_1,_2,_3){var _4=_1.split("."),_5=window;if(typeof _3!="boolean"){_3=false;}for(var i=0;i<_4.length;i++){_5[_4[i]]=_5[_4[i]]||{};_5=_5[_4[i]];}for(var _7 in _2){if(_3||typeof _5[_7]=="undefined"){_5[_7]=_2[_7];}}return _5;};omtr.extend("omtr.tc.plugin",{tc_swf_content:function(_8,_9){if(!_8||!(typeof _8=="object")){return _9;}if(typeof deconcept!="object"||typeof deconcept.SWFObject!="function"){return _9;}_8.id=_8.id||"tc-flash-content";_8.version=_8.version||"6.0.65";_8.backgroundColor=_8.backgroundColor||"#FFFFFF";if(!_8.swf||!_8.width||!_8.height){return _9;}var _a=new deconcept.SWFObject(_8.swf,_8["id"],_8.width,_8.height,_8.version,_8.backgroundColor,false,_8["quality"],false,_8["detectKey"],_8["detection"]);if(_8.vars&&typeof _8.vars=="object"){var a=[];for(var i=0;i<_8.vars.length;i++){if(typeof _8.vars[i]=="string"){a[i]=_8.vars[i].split("=");_a.addVariable(a[i][0],a[i][1]);}}}if(_a.installedVer.versionIsValid(_a.getAttribute("version"))){return _a.getSWFHTML();}else{return _9;}}});window.tc_swf_content=omtr.tc.plugin.tc_swf_content;omtr.extend("omtr.tc.plugin.tc_extra_info_from_analytics",{init:function(_d){if(!_d.extraInfoFromAnalytics){return _d;}var _e="",_f=_d.extraInfoFromAnalytics;_d.extra_info=_d.extra_info||"";_f.source=_f.source||omtr.data;_f.propList=_f.propList||window.undefined;if(typeof _f.encode!="boolean"){_f.encode=true;}if(typeof omtr.data==("object")&&typeof omtr.data.serialize==("function")){_e=omtr.data.serialize(_f.propList,_f.encode);_d.extra_info+=_e;return _d;}var _10,_11=_f.source,_12=(typeof encodeURIComponent!="undefined"?encodeURIComponent:escape);for(_10 in _11){if((typeof (_11[_10])!=("function"))&&(typeof (_11[_10])!=("array"))&&(typeof (_11[_10])!=("object"))&&(typeof (_11[_10])!=("undefined"))&&((_11[_10])!=(""))&&((_11[_10])!=(null))){_e+="&"+_12(_10.toString())+"="+_12(_11[_10]);}}_d.extra_info+=_e;return _d;}});omtr.extend("omtr.tc.plugin.sitecatalyst_reporting",{observers:[],ready:false,serveData:null,init:function(_13){this.doStandardReport=omtr.tc.report;omtr.tc.report=this.sendReport;},add:function(ele){this.observers.push(ele);if(omtr.tc.plugin.sitecatalyst_reporting.ready){if(typeof (ele)=="function"){ele.apply(this,[omtr.tc.serveData]);}}else{}},notify:function(_15){for(var i=0;i<this.observers.length;i++){var _17=this.observers[i];if(typeof (_17)=="function"){_17.apply(this,[_15]);}}},sendReport:function(_18){if(typeof _18=="object"){omtr.tc.plugin.sitecatalyst_reporting.serveData=_18;}else{_18=omtr.tc.plugin.sitecatalyst_reporting.serveData;}var _19=omtr.tc.plugin.sitecatalyst_reporting.doStandardReport();if((_19===0)||(typeof _19==="undefined"&&!_18)){return;}else{if(_19===2){omtr.tc.serveData={visitor:"Page Default"};}else{if(_19===3){omtr.tc.serveData={visitor:"Page Error"};}else{if(_18!==null&&typeof _18=="object"){omtr.tc.serveData={visitor:_18.visitor};}else{omtr.tc.serveData={visitor:"No Data From Server"};}}}}omtr.tc.plugin.sitecatalyst_reporting.ready=true;omtr.tc.plugin.sitecatalyst_reporting.notify(omtr.tc.serveData);}});omtr.extend("omtr.tc",{Version:"5.3",Vendor:"Omniture",Product:"TouchClarity"});(function(){var _1a=function(){var _1b="undefined";var api=this;var _1d=window.location;var _1e={timeout:5,site_id:425,server_hostname:"tagging-qa.touchclarity.com",active:true,base_url:_1d.href,products:"",referrer:(function(){if(typeof document.referrer==_1b){return _1b;}if(document.referrer===null){return "null";}if(document.referrer===""){return "empty";}return document.referrer;})(),log_path:"/touchclarity",containers:new function(){var _1f=function(id,_21){this.id=id;this.rendered=false;this.displayed=false;this.defaulted=false;this.error=false;this.content="";this.default_content=_21;this.timeout_id=null;this.coids=[];};var ccs={};this.add=function(_23){var cc=new _1f(_23,"");ccs[_23]=cc;return cc;};this.get=function(_25){var cc=ccs[_25];if(!cc){cc=this.add(_25);cc.error=true;}return cc;};this.getAll=function(){var _27=[];for(var id in ccs){if(ccs[id].constructor==_1f){_27.push(ccs[id]);}}return _27;};this.getIDs=function(){var ids=[];for(var id in ccs){if(ccs[id].constructor==_1f){ids.push(id);}}return ids;};}()};var _2b=new function(){var _2c=encodeURIComponent||escape;this.getLogURL=function(_2d,_2e,_2f,_30,_31){var _32=function(url){if(typeof url==_1b||url===""||url===null){return _1e.base_url;}url=""+url;if(url.substring(0,4)!="http"&&url.substring(0,1)!="/"){url=_1d.pathname.substring(0,_1d.pathname.lastIndexOf("/")+1)+url;}if(url.substring(0,1)=="/"){url=api.logger.http+_1d.host+url;}return url;};var _34=function(_35){_35=(typeof _35!=_1b?_35:_1e.base_url);if(_35.indexOf("?")>0){_35=_35.substring(0,_35.indexOf("?"));}var al=(_35!=api.logger.http+_1d.host+_1d.pathname);return al;};if(typeof _2d==_1b){_2d="i";}_2e=_32(_2e);var url=api.logger.http+_1e.server_hostname+"/"+_2d+"?siteID="+_1e.site_id;var _38=new Date().getTime();url+="&ts="+(typeof _30!=_1b?_30:_38);var _39=_1e.containers.getIDs();if(_39.length>0){for(var cc=0;cc<_39.length;cc++){url+="&ccID="+_2c(_39[cc]);}}if(_2d=="c"){url+="&log=no";}var al=_34(_2e);if(al){url+="&alias=true";}if(_2f&&_2f.length){url+="&prod="+_2c(_2f);}if(typeof _31!=_1b){url+=_31;}_2e=_2c(_2e);while(_2e.length>1999-url.length){_2e=_2e.substring(0,_2e.lastIndexOf(_2c("&")));}url+="&location="+_2e;var dg={};dg.tagv=_2c(omtr.tc.Version);dg.tz=0-(new Date().getTimezoneOffset());dg.r=_2c(_1e.referrer);dg.title=""+_2c(document.title);if(al){dg.aliased=_2c(_1d.href);}if(screen){dg.cd=screen.colorDepth;dg.ah=screen.availHeight;dg.aw=screen.availWidth;dg.sh=screen.height;dg.sw=screen.width;dg.pd=screen.pixelDepth;}for(var key in dg){if((typeof (dg[key])!=("function"))&&(typeof (dg[key])!=("array"))&&(typeof (dg[key])!=("object"))){var _3e="&"+key+"="+dg[key];if(url.length+_3e.length<2000){url+=_3e;}else{break;}}}return url;};}();this.logger=new function(){var _3f=this;this.loaded=true;this.http="http"+(_1d.href.substring(0,6)=="https:"?"s":"")+"://";var _40=false;var _41=false;var _42=[];var _43=function(_44,url,_46,_47,_48){if(typeof url==_1b||url===""){return false;}if(_1e.active){var _49=new Image();_49.src=_2b.getLogURL("i",_46,_48,new Date().getTime());_42.push(_49);}if(typeof _47==_1b){return window.open(url,_44);}else{return window.open(url,_44,_47);}};var _4a=function(_4b,_4c,_4d){if(!_1e.active){return null;}var _4e=new Image();_4e.src=_2b.getLogURL("i",_4b,_4c,new Date().getTime(),_4d);_42.push(_4e);return _4e;};var _4f=function(_50,url,_52,_53,_54,_55){var _56=null;if(typeof url==_1b||url===""){return;}if(typeof _55==_1b||_55===""){_55="window.location.href='"+url+"'";}if(typeof _52==_1b){_52=url;}if(typeof _50==_1b||_50===""||_50=="_self"||_50=="_parent"||_50=="_top"){if(_1e.active){_56=new Image();_56.timeout_id=setTimeout(_55,(_1e.timeout*1000));_56.onload=function(){eval(_55);clearTimeout(_56.timeout_id);};_56.onerror=function(){eval(_55);clearTimeout(_56.timeout_id);};_56.src=_2b.getLogURL("i",_52,_54,new Date().getTime());_42.push(_56);}else{eval(_55);}}else{if(typeof _50=="object"&&_50.document){if(_1e.active){_56=new Image();_56.src=_2b.getLogURL("i",_52,_54);_42.push(_56);}_50.location.href=url;}else{_43(_50,url,_52,_53,_54);}}};var _57=function(_58){if(_58.containers){return null;}else{var _59=null;if(_1e.active&&!_41){_59=_4a();_59.onload=function(){_40=true;};}_41=true;return _59;}};this.init=function(_5a){if(_41){return;}if(typeof _5a!="object"){if(typeof window.tc=="object"){_5a=window.tc;}else{_5a={};}}if(_5a.active===false||_5a.active==="false"||_5a.active===0){_1e.active=false;}if(_5a.site_id){_1e.site_id=_5a.site_id;}if(_5a.server_hostname){_1e.server_hostname=_5a.server_hostname;}if(_5a.page_alias){_1e.base_url=_5a.page_alias;}if(_5a.extra_info){_1e.base_url+=(_1e.base_url.indexOf("?")>0?"&":"?")+_5a.extra_info;}if(_5a.timeout){_1e.timeout=_5a.timeout;}if(_5a.products){_1e.products=_5a.products;}if(_5a.referrer){_1e.referrer=_5a.referrer;}_57(_5a);};api.log=_4a;api.redirect=_4f;}();this.targeter=new function(){this.loaded=true;this.content_url="";var _5b=false;var _5c=false;var _5d=function(){return (!document.getElementById&&!document.all);};var _5e=function(){if(_5c===true){return 0;}var cc,_60=_1e.containers.getAll(),_61="",_62=0,_63=0,_64=0;for(var i=0;i<_60.length;i++){cc=_60[i];if(cc.error){_61+="&error="+cc.id;_62++;}}if(_62>0){api.log(null,null,_61);_5c=true;return 3;}for(var i=0;i<_60.length;i++){cc=_60[i];if(!cc.displayed&&!cc.defaulted){return 0;}if(cc.defaulted){_61+="&default="+cc.id;_63++;}else{for(var co=0;co<cc.coids.length;co++){_61+="&displayed="+cc.coids[co];_64++;}}}api.log(null,null,_61);_5c=true;var _67=1;if(_63>0&&_64==0){_67=2;}if(_63>0&&_64>0){_67=3;}return _67;};api.report=_5e;var _68=function(cc){return (function(){if(!cc.displayed){cc.defaulted=true;document.getElementById("tc_content_"+cc.id).innerHTML=cc.default_content;}omtr.tc.report();});};var _6a=function(id,_6c){var _6d=function(_6e){document.write("<span id='tc_content_"+id+"'>"+_6e+"</span>");};if(_5d()){_6d(_6c);return;}var cc=_1e.containers.get(id);cc.default_content=_6c;if(_1e.active===false){_6d(_6c);}else{if(cc.error===true){_6d(_6c);}else{if(cc.content!==""){if(cc.content=="__default__"){_6d(cc.default_content);}else{_6d(cc.content);}cc.displayed=true;}else{_6d("");cc.rendered=true;if(cc.default_content){var _70=_68(cc);cc.timeout_id=setTimeout(_70,_1e.timeout*1000);}}}}omtr.tc.report();};var _71=function(_72,_73,_74){var cc=_1e.containers.get(_72);if(cc.defaulted){return;}cc.coids.push(_73);if(cc.rendered){if(_74=="__default__"){_74=cc.default_content;}document.getElementById("tc_content_"+_72).innerHTML+=_74;cc.displayed=true;}else{cc.content+=_74;}};this.init=function(_76){if(_5b){return;}if(typeof _76.containers=="string"){_1e.containers.add(_76.containers);}else{if(_76.containers&&_76.containers.length){for(var i=0;i<_76.containers.length;i++){_1e.containers.add(_76.containers[i]);}}else{return;}}if(_76.log_path){_1e.log_path=_76.log_path;}if(_1e.active&&!_5d()){var _78=_76.test?_76.test:_2b.getLogURL("c");this.content_url="<scr"+"ipt src='"+_78+"'></scr"+"ipt>";document.writeln("<iframe id='tc_iframe' name='tc_iframe' src='"+_1e.log_path+"/tc_targeting.html' width=0 height=0 style='display:none'></iframe>");}_5b=true;};api.optimize=_6a;api.set_content=_71;}();var _79=function(_7a){if(omtr.tc.plugin){for(var _7b in omtr.tc.plugin){if(omtr.tc.plugin[_7b].init){omtr.tc.plugin[_7b].init(_7a);}}}};var _7c=false;this.init=function(_7d){if(_7c){return;}if(typeof _7d!="object"){if(typeof window.tc=="object"){_7d=window.tc;}else{_7d={};}}_79(_7d);this.logger.init(_7d);this.targeter.init(_7d);_7c=true;};};omtr.extend("omtr.tc",new _1a());if(window.tc&&window.tc.autoStart){omtr.tc.init(tc);}})();