text: function lost_focus(){popup_visible||(pagefocus=!1,defocus_timestamp=(new Date).getTime(),record_timestamp("D",defocus_timestamp),defocusing_count++)}function regained_focus(){pagefocus||popup_visible||(pagefocus=!0,refocus_timestamp=(new Date).getTime(),record_timestamp("R",refocus_timestamp),refocusing_count++,last_duration=refocus_timestamp-defocus_timestamp,duration_sum+=last_duration)}function onfocusout(){clearTimeout(timer),timer=setTimeout(lost_focus,100)}function onfocusin(){clearTimeout(timer),regained_focus()}function pagefocus_reset(){focus_data="",defocusing_count=0,refocusing_count=0,last_duration=0,duration_sum=0}function pagefocus_get_data(){var o={defocus:defocusing_count,refocus:refocusing_count,durationsum:duration_sum};return o}var focus_data,defocusing_count,refocusing_count,last_duration,duration_sum,defocus_timestamp,refocus_timestamp,pagefocus=!0,popup_visible=!1;if(pagefocus_reset(),record_timestamp=function(o,u){focus_data=focus_data+o+u+";"},"onfocusin"in document){var timer;document.onfocusin=onfocusin,document.onfocusout=onfocusout}else"onpageshow"in window&&(window.onfocus=window.onpageshow=regained_focus,window.onblur=window.onpagehide=lost_focus);