var StayTimer=(function(url){
   var ref= encodeURIComponent(document.referrer);
   var start=new Date().getTime();
   function msg(m,a){
     var x;
     try{            x = new XMLHttpRequest();
     }catch(e){ try{ x = new ActiveXObject('Microsoft.XMLHTTP');
     }catch(e){ try{ x = new ActiveXObject('Msxml2.XMLHTTP');
     }catch(e){ return } } }
     x.open( "GET" , url + "?id="+start+"&time="+(((new
 Date()).getTime())-start)+"&msg="+m +"&ref="+ref, !a );
     x.send( "" );
   }
   msg('/start');
   function addEvent(type,l,c){
     if( window.addEventListener ){
       window.addEventListener( type,l,c );
     }else{
       window.attachEvent( 'on'+type,l );
     }
   }
   addEvent( 'unload', function(){ msg('/end',true); },true);
   return {
     msg:msg
   }
 })("/web/stayhistoryadd.do");