var _bright=new Object({_initialize:function(id){_bright.id=id;return _bright;},_trackBright:function(){var s_timeout=1800;var p_timeout=15768000;var max_length=2000;var brightProtocol=(("https:"==document.location.protocol)?"https://":"http://");var bright_id=_bright.id;var location_href=location.href;if(window.location&&window.location.href)
location_href=window.location.href;var ref=document.referrer;if(window.document&&window.document.referrer)
ref=window.document.referrer;var cgv="";if(typeof(goalValue)!="undefined")
cgv=goalValue;var title=document.title;var metadesc=getmetaContents('description');var metakeywords=getmetaContents('keywords');var elemHashTable={};elemHashTable["id"]=bright_id;elemHashTable["url"]=location_href;elemHashTable["ref"]=ref;elemHashTable["cgv"]=cgv;elemHashTable["title"]=title;elemHashTable["metadesc"]=metadesc;elemHashTable["metakeywords"]=metakeywords;var p_id=getCookie("p_id");var isP_IDExist=true;if(p_id.length==0){p_id=generateUniqID(_bright.id);isP_IDExist=false;}
setCookie("p_id",p_id,p_timeout);p_id=getCookie("p_id");var isCookieEnabled=true;if(p_id.length==0)
isCookieEnabled=false;if(isCookieEnabled){var p_first_ref='';var p_first_entry='';var p_last_ref='';var s_id=getCookie("s_id");var s_entry='';if(isP_IDExist){p_first_ref=getCookie("p_first_ref");p_first_entry=getCookie("p_first_entry");if(s_id.length>0)
p_last_ref=getCookie("p_last_ref");else
p_last_ref=ref;}else{p_first_ref=ref;p_first_entry=location_href;p_last_ref=ref;}
setCookie("p_first_ref",p_first_ref,p_timeout);setCookie("p_first_entry",p_first_entry,p_timeout);setCookie("p_last_ref",p_last_ref,p_timeout);if(s_id.length>0){s_entry=getCookie("s_entry");}else{s_id=generateUniqID(_bright.id);s_entry=location_href;}
setCookie("s_id",s_id,s_timeout);setCookie("s_entry",s_entry,s_timeout);elemHashTable["p_id"]=p_id;elemHashTable["s_id"]=s_id;elemHashTable["p_last_ref"]=p_last_ref;elemHashTable["s_entry"]=s_entry;elemHashTable["p_first_ref"]=p_first_ref;elemHashTable["p_first_entry"]=p_first_entry;}
if(isCookieEnabled){var elemListArray=new Array("id","p_id","url","ref","cgv","p_last_ref","s_entry","p_first_ref","p_first_entry","title","metadesc","metakeywords","s_id");}
else
var elemListArray=new Array("id","url","ref","cgv","title","metadesc","metakeywords");var url=createURL(brightProtocol,elemHashTable,elemListArray);if(url.length>max_length){for(var key in elemHashTable){if(elemHashTable[key]){elemHashTable[key]=elemHashTable[key]+"";elemHashTable[key]=elemHashTable[key].substring(0,450);}}
url=createURL(brightProtocol,elemHashTable,elemListArray);var index=elemListArray.length-1;while(url.length>max_length){elemListArray.splice(elemListArray.length-1,1);url=createURL(brightProtocol,elemHashTable,elemListArray);if(elemListArray.length<=1)
break;}}
var img=new Image(1,1);img.src=url;img.onload=function(){};}});function createURL(brightProtocol,elemHashTable,elemListArray){var url=brightProtocol+"cdn.brightedge.com/brightedge.php";var isFirst=true;for(i=0;i<elemListArray.length;i++){if(isFirst){url=url+"?";isFirst=false;}else{url=url+"&";}
url=url+elemListArray[i]+"="+escape(elemHashTable[elemListArray[i]]);}
return url;}
function getmetaContents(mn){var m=document.getElementsByTagName('meta');for(i=0;i<m.length;i++){if(m[i].name==null)
continue;if((m[i].name).toLowerCase()==mn.toLowerCase()){var returnStr=m[i].content;if(returnStr.length>255)
returnStr=returnStr.substring(0,255);return returnStr;}}
return'';}
function setCookie(name,value,timeout){var exdate=new Date();exdate.setTime(exdate.getTime()+timeout*1000);document.cookie=name+"="+escape(value)+"; path=/; expires="
+exdate.toGMTString();}
function getCookie(c_var){if(document.cookie.length>0){c_begin=document.cookie.indexOf(c_var+"=");if(c_begin!=-1){c_begin=c_begin+c_var.length+1;c_end=document.cookie.indexOf(";",c_begin);if(c_end==-1)
c_end=document.cookie.length;return unescape(document.cookie.substring(c_begin,c_end));}}
return"";}
function get36base(str){var value=str.charCodeAt(0);value=(value<=57)?value-22:value-65;return value;}
function get36char(num){num=(num<10)?num+48:num+55;return String.fromCharCode(num);}
function EncodeString(str){var b,result="";for(var k=str.length-1;k>=0;k--){b=(get36base(str.charAt(k))*17)%36;b=get36char(b);result=result+b;}
return result;}
function hashString(str){var temp=0,hashed=1;for(var l=str.length-1;l>=0;l--){temp=str.charCodeAt(l);temp=(temp*temp*temp)&268435455;hashed=hashed<<6+hashed*temp;}
return hashed;}
function generateUniqID(orgID){var hashed=hashString(navigator.userAgent);var rand_num=Math.floor(Math.random(hashed)*524288)+Math.floor(Math.random()*524288);var curDate=(new Date()).getTime();var id=orgID+rand_num+curDate;id=EncodeString(id);return id;}
