/*
 *   Pixy.js
 *   Version: 1.3.3 RP (01/23/2012)
 *   Copyright 2012 Pixy JavaScript GWIM Channel Analytics
 */
var _pixy=new Object({ver:"1.3.3",imgLoc:"",pxsid:"",customPageName:"",doc:document,eType:"0",tags:"INPUT,OPTION,BUTTON,IMG,A,AREA",pxsName:"pxs",pxvDomain:".ml.com",pxsDomain:"",pxSec:"",pxp:"",pxv:"",pxs:"",noblur:false,q:new Array(),nop:true,linker:false,sjs:"javascript:",isSaf:navigator.userAgent.toString().toLowerCase().indexOf("safari")>-1,Track:function(pxSiteId,custPageName,pxSection){if(!this.IE(pxSiteId)){this.pxsid=pxSiteId}else{return}if(!this.IE(custPageName)){this.customPageName=custPageName}if(!this.IE(pxSection)){this.pxSec=pxSection}},Init:function(){if(this.IE(this.pxsid)||this.IE(this.imgLoc)||!this.CIds()){return}else{this.nop=false}this.Connect();_pixyUtil.pixySet=true},Pr:function(ev,overrride,elems,anykey,anyval){var q=new Array();q[q.length]="pxt="+this.eType;q[q.length]="&pxsid="+this.pxsid;q[q.length]=this.GetIds();switch(this.eType){case"0":var ref=this.GetRef();if(ref.length>0){q[q.length]="&pxr="+this.CE(ref[0]);if(ref.length>1){q[q.length]="&pxrqs="+this.CE(ref[1])}}else{q[q.length]="&pxr=&pxrqs="}q[q.length]="&pxc="+self.screen.colorDepth+"&pxd="+self.screen.width+"x"+self.screen.height;if(window.navigator.cpuClass!=undefined){q[q.length]="&pxcc="+window.navigator.cpuClass}q[q.length]="&pxtit="+this.GetTitle();if(this.customPageName!=""){q[q.length]="&pxcn="+this.CE(this.customPageName)}if(this.pxSec!=""){q[q.length]="&pxsec="+this.CE(this.pxSec)}q[q.length]="&pxul="+this.GetUl();var a=this.GetUrl();q[q.length]="&pxurl="+a[0];q[q.length]="&pxqs="+a[1];break;case"1":case"2":var go=false;if(ev==undefined&&window.event){ev=window.event}var parent=null;if(ev.srcElement!=null){if(ev.srcElement.tagName=="SELECT"){parent=ev.srcElement[ev.srcElement.options.selectedIndex]}else{if(ev.srcElement.nodeType==3){parent=ev.srcElement.parentNode}else{parent=ev.srcElement}}}if(parent==null){if(ev.target!=null){if(ev.target.tagName=="SELECT"){parent=ev.target[ev.target.options.selectedIndex]}else{if(ev.target.nodeType==3){parent=ev.target.parentNode}else{parent=ev.target}}}}if(parent==null){return}if(parent.type=="password"){return}if(this.linker){var c=0;if(parent.tagName=="A"){_pixy.Link(parent.href,parent);c=1}if(c==0){var p=parent.parentNode;if(p!=null){if(p.tagName=="A"){_pixy.Link(p.href,p);c=1}}}if(c==0){var p=parent.parentNode.parentNode;if(p!=null){if(p.tagName=="A"){_pixy.Link(p.href,p);c=1}}}}if(overrride==undefined){if(this.tags.split(",").length>0){var elms=this.tags.split(",");for(var j=0;j<elms.length;j++){if(elms[j].toLowerCase()==parent.tagName.toLowerCase()){go=true;break}}}}else{if(overrride){go=true}}if(!go){var pxn=parent.getAttribute("pxname");if(pxn!=null&&pxn!=undefined&&pxn!=""){go=true}else{return}}if(!go){return}var coord=this.GCo(ev);var tmp="";tmp=this.IE(parent)?"":this.GetId(parent);q[q.length]="&pxname="+tmp;q[q.length]="&pxo="+coord[0]+"|"+coord[1];tmp="";tmp=this.IE(parent)?"":this.GetVal(parent);q[q.length]="&pxval="+tmp;q[q.length]="&pxf="+this.GetForm(parent);break;case"3":if(this.IE(anykey)!=undefined&&anyval!=undefined){q[q.length]="&"+anykey+"="+anyval}break;case"4":if(elems==undefined){return}if(elems.length>0){var objs=elems.split(";");if(objs.length==0){return}for(var i=0;i<objs.length;i++){var obj=this.doc.getElementById(objs[i]);if(obj!=undefined||obj!=null){obj=this.GetId(obj)}else{obj=""}if(obj!=""){q[q.length]="&"+obj+"="+this.GetValue(objs[i])}}}break;case"5":break}q[q.length]="&pxdt="+this.GetTime();_pixy.q=q;this.Req()},Pr1:function(section,elem,er){var q=new Array();q[q.length]="pxt="+this.eType;q[q.length]="&pxsid="+this.pxsid;q[q.length]=this.GetIds();switch(this.eType){case"7":q[q.length]="&pxsec="+this.CE(section);break;case"8":q[q.length]="&pxname="+this.CE(section);break;case"9":q[q.length]="&pxname="+this.CE(elem);q[q.length]="&pxval="+this.CE(er);break;case"11":q[0]="pxt=3";if(section==undefined){return}var er=false;if(typeof(section)=="string"){var s=section;try{var tmp=eval("("+s+")");s=tmp}catch(e){er=true}finally{if(!er){section=s}}}if(!er){for(var i in section){q[q.length]="&"+escape(i)+"="+escape(section[i])}}break;default:break}q[q.length]="&pxdt="+this.GetTime();_pixy.q=q;this.Req()},Listen:function(ev){try{_pixy.eType="1";_pixy.Pr(ev)}catch(e){}},Connect:function(){this.eType="0";this.Pr();if(!_pixyUtil.pixySet){_pixyUtil.DOMLoad(function(){_pixyUtil.AddEvent(_pixy.doc,"click",_pixy.Listen);_pixyUtil.AddEvent(window,"unload",_pixyUtil.Unload);if(!_pixy.noblur){var elems=_pixy.doc.getElementsByTagName("INPUT");for(var i=0;i<elems.length;i++){if(elems[i].type=="text"){_pixyUtil.AddEvent(elems[i],"blur",_pixy.Listen)}}elems=_pixy.doc.getElementsByTagName("SELECT");for(var j=0;j<elems.length;j++){_pixyUtil.AddEvent(elems[j],"blur",_pixy.Listen)}}if(_pixy.isSaf){var elems=_pixy.doc.getElementsByTagName("A");for(var i=0;i<elems.length;i++){var hr=elems[i].href;if(_pixy.IE(hr)){continue}if((hr.indexOf("java")==0)||(hr.indexOf("#")==0)||(hr.indexOf("tel")==0)){continue}_pixyUtil.AddEvent(elems[i],"mousedown",_pixy.Listen)}}})}},TrackTag:function(event){if(this.nop){return}var ev=(event)?event:window.event;this.eType="2";this.Pr(ev,true)},TrackAny:function(key,val){if(this.nop){return}this.eType="3";this.Pr(null,null,null,key,val)},TrackMultiple:function(arr){if(this.nop){return}this.eType="11";this.Pr1(arr)},Submit:function(elems){if(this.nop){return}this.eType="4";this.Pr(null,null,elems)},TrackSecLoad:function(sec){if(this.nop){return}if(this.IE(sec)){return}this.pxSec=sec;this.eType="7";this.Pr1(sec)},TrackSecEvent:function(sec){if(this.nop){return}if(this.IE(sec)){return}this.pxSec=sec;this.eType="8";this.Pr1(sec)},TrackValError:function(elem,err){if(this.nop){return}this.eType="9";if(this.IE(elem)||this.IE(err)){return}this.Pr1(null,elem,err)},Req:function(){try{this.q=this.q.join("");if(this.q.length>2083){this.q=this.q.substring(0,2082)}var img=new Image(1,1);img.onload=function(){this.style.display="none"};img.src=this.imgLoc+"?"+this.q}catch(e){}finally{this.q=new Array()}},IE:function(str){if(str==undefined||str==null||str===""){return true}else{return false}},CE:function(obj){if(obj!=undefined){return encodeURIComponent(obj).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}else{return""}},SetAlt:function(pxVar){var expDate=new Date();switch(pxVar){case"pxv":expDate.setTime(expDate.getTime()+(10*365*24*60*60*1000));var pxvVal=this.GetUuid();this.SC(pxVar,pxvVal,expDate.toUTCString(),"/",this.pxvDomain,false);var test=this.GetCookie(pxVar);if(this.IE(test)){this.pxvVal="";return}this.pxv=pxvVal;break;case"pxp":this.pxp=this.GetUuid();break;case"pxs":var pxsVal=this.GetUuid();this.SC(pxVar,pxsVal,false,"/",(this.IE(this.pxsDomain)?(this.IE(this.pxvDomain)?false:this.pxvDomain):this.pxsDomain),false);var test=this.GetCookie(pxVar);if(this.IE(test)){this.pxsVal="";return}this.pxs=pxsVal;break;default:return}},CIds:function(){var c=new Array();if(this.IE(this.pxs)){this.pxs=this.GetCookie("Bear");if(this.IE(this.pxs)){this.pxs=this.GetCookie(this.pxsName,"val")}if(this.IE(this.pxs)){this.pxs=this.GetCookie(this.pxsName)}if(this.IE(this.pxs)){this.SetAlt("pxs")}}if(this.IE(this.pxs)){c[c.length]="no-pxs"}if(this.IE(this.pxv)){this.pxv=this.GetCookie("pxv");if(!this.IE(this.pxv)){this.UC("pxv",this.pxv,"/",this.pxvDomain,false)}else{this.SetAlt("pxv")}}if(this.IE(this.pxv)){c[c.length]=",no-pxv"}if(this.IE(this.pxp)){this.SetAlt("pxp")}if(this.IE(this.pxp)){c[c.length]=",no-pxp"}if(this.IE(this.pxv)||this.IE(this.pxs)||this.IE(this.pxp)){return false}return true},GetCookieVal:function(offset,sub){if(this.doc.cookie.length==0){return""}var endstr=this.doc.cookie.indexOf(";",offset);if(endstr==-1){endstr=this.doc.cookie.length}if(sub!=undefined){var t=this.doc.cookie.substring(offset,endstr);if(t.indexOf(sub)==-1){return""}var subStart=t.indexOf(sub)+sub.length+1;var subEnd=t.indexOf("&",subStart);if(subEnd==-1){return t.toString()}else{return t.substring(subStart,subEnd)}}else{return this.doc.cookie.substring(offset,endstr)}},GetCookie:function(n,sub){var arg=n+"=";var alen=arg.length;var clen=this.doc.cookie.length;var i=0;var ck=this.doc.cookie;while(i<clen){var j=i+alen;if(ck.substring(i,j)==arg){return this.GetCookieVal(j,sub)}i=this.doc.cookie.indexOf(" ",i)+1;if(i==0){break}}return""},GCo:function(e){var res=new Array();var posx=0;var posy=0;if(!e){var e=window.event}try{if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY}else{if(e.clientX||e.clientY){posx=e.clientX+this.doc.body.scrollLeft+this.doc.documentElement.scrollLeft;posy=e.clientY+this.doc.body.scrollTop+this.doc.documentElement.scrollTop}}res[0]=posx;res[1]=posy}catch(e){}return res},GetForm:function(obj){if(obj.form!=null&&obj.form!=undefined){return obj.form.id}else{return""}},GetId:function(obj){if(obj.tagName=="OPTION"){obj=obj.parentNode}var id;try{id=obj.getAttribute("pxname");if(id!=null&&id!=undefined&&id!=""){return this.CE(id)}else{id=obj.getAttribute("id");if(id==null||id==undefined||id==""){id=obj.getAttribute("name")}return this.CE(id)}}catch(e){}if(id==undefined){return""}},GetIds:function(){return"&pxp="+this.CE(this.pxp)+"&pxv="+this.CE(this.pxv)+"&pxs="+this.CE(this.pxs)},GetRef:function(){var ref=this.doc.referrer;var a=new Array();if(ref.length>0){if(ref.indexOf("?")>0){a=ref.split("?")}else{a[a.length]=ref}}return a},GetTime:function(){return new Date().getTime()},GetTitle:function(){return ""},GetVal:function(obj,override){var val="";var passVal=false;var tmpObj=obj;if(tmpObj.tagName=="OPTION"){tmpObj=obj.parentNode}var pxval=tmpObj.getAttribute("pxval");if(pxval==null||pxval==undefined||pxval==""){passVal=false}else{if(pxval=="true"){passVal=true}else{passVal=false}}switch(obj.tagName.toLowerCase()){case"input":switch(obj.type){case"checkbox":if(!passVal){return val}val=obj.checked?"1":"0";if(obj.value!="on"){val+="-"+obj.value}break;case"radio":if(!passVal){return val}val=obj.value;break;case"button":case"password":break;case"text":if(override!=undefined){if(override==true){val=this.CE(obj.value);break}}if(!passVal){return val}val=this.CE(obj.value);break;default:if(!passVal){return val}val=this.CE(obj.value);break}break;case"button":case"textarea":break;case"a":case"area":var href=obj.href.toString();if(this.CE(href).length>0){if(href.indexOf(this.sjs)>-1){val=""}else{if(href.substr(0,1)=="#"){if(href.length>1){val=this.CE(obj.href)}else{val=""}}else{val=this.CE(obj.href)}}}else{val=""}break;case"div":case"span":break;case"option":if(!passVal){return val}val=this.CE(obj.innerHTML);break;default:if(!passVal){return val}val=this.CE(obj.value);break}return val},GetValue:function(id){if(this.doc.getElementById(id)!=undefined){return this.GetVal(this.doc.getElementById(id),true)}else{return""}},GetUl:function(){if(window.navigator.userLanguage!=undefined){return this.CE(window.navigator.userLanguage.toLowerCase())}else{if(window.navigator.language!=undefined){return this.CE(window.navigator.language)}else{return""}}},GetUrl:function(){var a=new Array();a[a.length]=this.CE(this.doc.location.protocol+"//"+this.doc.location.host+this.doc.location.pathname);var s="";if(this.doc.location.search.length>0){s=this.doc.location.search.substring(1,this.doc.location.search.length)}a[a.length]=this.CE(s);return a},Link:function(a,h){var dmn=this.doc.domain;var lh="localhost";if(dmn!=lh&&!this.IE(a)){var hr=a;if(hr=="#"||hr.indexOf(this.sjs)>-1||this.PU(hr)==lh||hr.indexOf("tel:")>-1){return}if(h!=undefined&&h!=null){var pxdef=h.getAttribute("pxdeftps");if(!this.IE(pxdef)){if(pxdef=="true"){return}}}var s1=hr.split("//");if(s1.length>0){s1=s1[1]}else{s1=hr}var s2=s1.split("/");if(s2.length>0){s2=s2[0]}else{s2=s2}if(this.PU(s2)==this.PU(dmn)||this.PU(s2).toLocaleString()=="bankofamerica.com"){return a}hr=hr.split("#");var fhr=hr[0];if(fhr.indexOf("?")>-1){if(fhr.indexOf("_tps")>-1){try{fhr=fhr.substr(0,fhr.indexOf("_tps")-1)}catch(e){}}fhr=fhr+(fhr.indexOf("?")>-1?"&":"?")+"_tps="+this.pxs}else{fhr=fhr+"?_tps="+this.pxs}if(hr.length>1){fhr=fhr+"#"+hr[1]}a=fhr;if(h!=undefined&&h!=null){h.href=a}else{return a}}},GetUuid:(function(){var CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return function(len,radix){var chars=CHARS,uuid=[],rnd=Math.random;radix=radix||chars.length;if(len){for(var i=0;i<len;i++){uuid[i]=chars[0|rnd()*radix]}}else{var r;uuid[8]=uuid[13]=uuid[18]=uuid[23]="-";uuid[14]="4";for(var i=0;i<36;i++){if(!uuid[i]){r=0|rnd()*16;uuid[i]=chars[(i==19)?(r&3)|8:r&15]}}}return uuid.join("")}})(),SC:function(name,value,expires,path,domain,secure){var flag=true;try{domain=this.doc.location.hostname.indexOf(domain)==-1?false:domain;this.doc.cookie=name+"="+value+((expires)?"; expires="+expires:"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?";secure":"");var check=this.GetCookie(name);if(this.IE(check)){flag=false}else{flag=true}}catch(err){flag=false}finally{return flag}},UC:function(cName,cVal,cPath,cDomain,cSec){var exp="";if(cName=="pxv"){var cDate=new Date();cDate.setTime(cDate.getTime()+(10*365*24*60*60*1000));exp=cDate.toUTCString();this.SC(cName,cVal,exp,cPath,cDomain,cSec)}},PU:function(u){if(this.IE(u)){return}try{return(u.match(/[^.]*\.com/)||u.match(/[^.]*\.net/)||u.match(/[^.]*\.org/))[0]}catch(e){return""}}});var _pixyUtil=new Object({pixySet:false,AddEvent:function(obj,type,fn){try{if(obj.addEventListener){obj.addEventListener(type,fn,false)}else{if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event)};obj.attachEvent("on"+type,obj[type+fn])}}}catch(e){}},DOMLoad:(function(){var load_events=[],load_timer,script,done,exec,old_onload,init=function(){done=true;clearInterval(load_timer);while(exec=load_events.shift()){exec()}if(script){script.onreadystatechange=""}};return function(func){if(done){return func()}if(!load_events[0]){if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);

/*@cc_on@*/

/*@if (@_win32)var proto = "src='" + _pixy.sjs + "void(0)'"; document.write("<script id=__pxie_onload defer " + proto + "><\/scr" + "ipt>"); script = document.getElementById("__pxie_onload"); script.onreadystatechange = function() { if (this.readyState == "complete") { init(); } }; /*@end@*/

}if(/WebKit/i.test(navigator.userAgent)){load_timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init()}},10)}old_onload=window.onload;window.onload=function(){init();if(old_onload){old_onload()}}}load_events.push(func)}})(),RemoveEvent:function(obj,type,fn){try{if(obj.removeEventListener){obj.removeEventListener(type,fn,false)}else{if(obj.detachEvent){obj.detachEvent("on"+type,obj[type+fn]);obj[type+fn]=null;obj["e"+type+fn]=null}}}catch(e){}},Unload:function(){}});


//actual tag calling

if (typeof (_pixy)== "object") {
	_pixy.imgLoc= "/publish/ose/images/pixy.gif";
	_pixy.linker= true;
	_pixy.pxvDomain= ".merrilledge.com";
	_pixy.Track("OSE", "", "");
	_pixy.Init();
}
