// This script is part of the BrowserHawk software, and provided
// for use under license from cyScape, Inc. (www.cyscape.com). It
// may not be used in any fashion without purchase of this license.
// Copyright (c) 2007 cyScape, Inc. All rights reserved.
// PATENT PENDING.

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}
// var proto = document.location.protocol;
// if (proto = "http:")
//  {
  // var recordserver = 'www.miracleblanket.com:8080/reports/brws'; // leave off the http:// or https:// part
  // }
  // else
  // {
  // var recordserver = 'www.miracleblanket.com:8443/reports/brws'; // leave off the http:// or https:// part
  // }

var recordserver = 'www.miracleblanket.com/reports/brws'; // leave off the http:// or https:// part

var user = getCookie('AMBID');      // configure as you like, maybe read from a cookie
var session = null;   // configure as you like, maybe read from a cookie
var extraString1 = null;  // configure to assoc string data w/ this hit,
var extraString2 = null;  // maybe reading text from a getElementById() call
var extraString3 = null;
var extraString4 = null;
var extraString5 = null;
var extraInt1 = null;     // and/or integer data
var extraInt2 = null;
var extraInt3 = null;
var extraDouble1 = null;  // and/or floating point data
var extraDouble2 = null;
var extraDouble3 = null;

var _bhi=new Date().getTime();var _plti='';var _pltl='';function $a(){$h=document.domain.toLowerCase();re=/.*?([^\.]+\.(com|org|net|edu|mil|gov|co.uk|ac.uk|gov.uk|net.uk|org.uk|com.au|net.au|org.au|co.nz|ac.nz|aero|biz|coop|info|jobs|mobi|int|museum|pro|travel|tv|..\.us))$/;ex=re.exec($h);if(ex){return "."+ex[1];}else{return $h;}};function gd(){var $h=$a();if($h==this.document.domain){return "";}else{return "; domain="+$h;}};function sc($i,$j){var $k=gc("plt_state");var $l=gc("plt_stm");var $m=gc("plt_url");if($i=="plt_state")$k=$j;else if($i=="plt_stm")$l=$j;else if($i=="plt_url")$m=$j;else return;$n="plt_state="+$k+"&plt_stm="+$l+"&plt_url="+encodeURIComponent($m);document.cookie='bhawkplt='+$n+'; path=/'+gd();};function gc($i){var $o=new RegExp($i+'=([^;&]+)').exec(document.cookie);if($o){var $p=decodeURIComponent($o[1]);if($p=="null")$p=null;return $p;}else{return null;}};function $b($q){var $r=document.location.protocol;if($r!='http:'&&$r!='https:')return;var $s=new Image(1,1);$s.src=$r+'//'+recordserver+'?'+$q;};function $c($t,$u,$v){if($u!=null&&$u==unescape(document.referrer)){return "Click";}else if(!$t){return "Cookieless";}else if(!$u){return "Entry";}else if($t){return "ComeBack";}else{return "IntraOnly";}};function $d(){var $w=new Date().getTime();var $x=gc('plt_stm');sc('plt_stm',$w);var $y='transitional';if($x!=null&&$w-$x<500){$y='doubled';};sc('plt_state',$y);};function $e(){sc('plt_state','exited');sc('plt_url',document.location);};function plt_getIntraMillis(){return _plti;};function plt_getLatencyMillis(){return _pltl;};function plt_getTotalMillis(){return _plti+_pltl;};function plt_getIntraSecs(){return Math.round((_plti/1000)*Math.pow(10,1))/Math.pow(10,1);};function plt_getLatencySecs(){if(_pltl=="")return "";return Math.round((_pltl/1000)*Math.pow(10,1))/Math.pow(10,1);};function plt_getTotalSecs(){return Math.round((plt_getTotalMillis()/1000)*Math.pow(10,1))/Math.pow(10,1);};function $f(){var $z=new Date().getTime();var $A=$z-_bhi;var $l=gc('plt_stm');var $B=($l!=null)?_bhi-$l:'null';var $t=gc('plt_state');var $u=gc('plt_url');if($u!=null&&$u.indexOf("#")>=0){$u=$u.substring(0,$u.indexOf("#"));};var $C=$c($t,$u,document.referrer);if($C!="Click"){$B="";};if($A<0){$A="";$B="";$C="ClockSkew";};var $D=($A=="")?"":"&intra="+$A;var $E=($C!="Click")?"":"&latency="+$B;var $F=(user==null)?"":"&u="+encodeURIComponent(user);var $G=(session==null)?"":"&s="+encodeURIComponent(session);var $H=((extraString1==null)?"":"&uds1="+encodeURIComponent(extraString1))+((extraString2==null)?"":"&uds2="+encodeURIComponent(extraString2))+((extraString3==null)?"":"&uds3="+encodeURIComponent(extraString3))+((extraString4==null)?"":"&uds4="+encodeURIComponent(extraString4))+((extraString5==null)?"":"&uds5="+encodeURIComponent(extraString5))+((extraInt1==null)?"":"&udi1="+encodeURIComponent(extraInt1))+((extraInt2==null)?"":"&udi2="+encodeURIComponent(extraInt2))+((extraInt3==null)?"":"&udi3="+encodeURIComponent(extraInt3))+((extraDouble1==null)?"":"&udd1="+encodeURIComponent(extraDouble1))+((extraDouble2==null)?"":"&udd2="+encodeURIComponent(extraDouble2))+((extraDouble3==null)?"":"&udd3="+encodeURIComponent(extraDouble3));var $I="";if(true){$I='&debugstr='+$t+":"+encodeURIComponent($u)+":"+encodeURIComponent(unescape(document.referrer));};var $J='hittype='+$C+$I+$E+$D+$F+$G+'&p='+encodeURIComponent(window.location)+$H+"&pltver=105";$b($J);sc('plt_state','entered');_plti=$A;_pltl=$B;$g($C,plt_getIntraSecs(),plt_getLatencySecs(),plt_getTotalSecs());};function $g($C,$K,$L,$M){$N=document.getElementById('plt_hittype');$O=document.getElementById('plt_intra');$P=document.getElementById('plt_latency');$Q=document.getElementById('plt_total');if($N){$N.innerHTML=$C;};if($O){$O.innerHTML=$K;};if($P){$P.innerHTML=$L;};if($P){$Q.innerHTML=$M;}};if(window.attachEvent){window.attachEvent('onunload',$e);window.attachEvent('onbeforeunload',$d);window.attachEvent('onload',$f);}else{window.addEventListener('unload',$e,false);window.addEventListener('beforeunload',$d,false);window.addEventListener('load',$f,false);};sc('plt_state','entering');


