var _ourplusCount = 'http://stat.ent.mop.com';
var _debug;
var _ourplusType;
var _ourplusShow;
var _ourplusShowStr='';
var _ourplusIframe;
var _ourplusCountPage = _ourplusCount + '/statsrv';
var _ourplusPageurl ='';
var _ourplusReferer ='';
var _ref_search='';
try{ _ourplusPageurl =escape(location.href);
    _ourplusReferer = escape(document.referrer);
    if(_ourplusReferer==''){
       _ourplusReferer = escape(top.document.referrer);
    }
}
catch(e){
     _ourplusPageurl = escape(top.location.href);
    _ourplusReferer = escape(top.document.referrer);
}
var _ourplusLanguage = (navigator.systemLanguage?navigator.systemLanguage:navigator.language);
var _ourplusCharset = document.charset;
var _ourplusFirstTime;
var _ourplusLastTime;
_ourplusFirstTime = _ourplusReadCookie( '_oft' );
if( _ourplusFirstTime == '' )
{
	_ourplusFirstTime = getTime();
	_ourplusLastTime = _ourplusFirstTime;
    var rdn=Math.floor(Math.random() * 100000000);
    _ourplusFirstTime=_ourplusFirstTime+"-"+rdn;
    _ourplusWriteCookie( '_oft', _ourplusFirstTime, 10000 );
}
else
{
	_ourplusLastTime = getTime();
}
// modify by Bate for record search referer.
_ref_search = _ourplusReadCookie( '_refs' );
if(_ref_search == '') {
	_ref_search = _setSearch(_ourplusReferer);
	if(_ref_search != '')	{
		_ourplusWriteCookie('_refs',_ref_search,1);
     		_ourplusReferer = escape(top.document.referrer+"*"+_ref_search+"*");
	}
} else {
     _ourplusReferer = escape(top.document.referrer+"*"+_ref_search+"*");
}
if( _ourplusType == null )
{
	_ourplusType = 1;
}
_ourplusReturnCount = _ourplusReadCookie( '_orccc' );
_ourplusReturnCount = _ourplusReturnCount == '' ? 0 : _ourplusReturnCount;

_ourplusReturnTime = _ourplusReadCookie( '_ort' );
if( _ourplusReturnTime == '' )
{
	_ourplusReturnTime = getTime();
	_ourplusWriteCookie( '_ort', _ourplusReturnTime, 10000 );
}
temp = _ourplusReturnTime.split( '-' )
_ourplusReturnTimeDate = new Date(temp[0], temp[1]-1, temp[2], temp[3], temp[4], temp[5] );
_ourplusNowTimeDate = new Date();
//window.status("now["+_ourplusNowTimeDate+"]return["+_ourplusReturnTimeDate+"]");
if( _ourplusNowTimeDate.getTime() - _ourplusReturnTimeDate.getTime() >= 43200000 )
{
	_ourplusWriteCookie( '_orccc', ++_ourplusReturnCount, 10000 );
	_ourplusWriteCookie( '_ort', getTime(), 10000 );
}
else
{
	_ourplusReturnCount = null;
}



if( _ourplusShow != null && _ourplusShow.length > 0 )
{
	var _ourplusShowStr = '';
	for( i = 0; i < _ourplusShow.length; i ++ )
	{
		_ourplusShowStr += "&show[]=" + _ourplusShow[i];
	}
}
else
{
	var _ourplusShowStr = "";
}
var _ourplusCountUrl = _ourplusCountPage + '?'
+ 'counturl=' + _ourplusCount
+ '&pageurl=' + _ourplusPageurl
+ '&referer=' + _ourplusReferer
+ '&language=' + _ourplusLanguage
+ '&debug=' + _debug
+ '&firsttime=' + _ourplusFirstTime
+ '&lasttime=' + _ourplusLastTime
+ '&type=' + _ourplusType
+ '&charset=' + _ourplusCharset
+ _ourplusShowStr
+ '&timezone=' + (new Date()).getTimezoneOffset()/60;

if( _ourplusReturnCount>0 )
{
	_ourplusCountUrl += '&return1=' + _ourplusReturnCount;
}

var _editor="";
if(document.getElementById("_mmov_div_1")){
    _editor=document.getElementById("_mmov_div_1").innerHTML;
}

if(_editor.length>0){
  _ourplusCountUrl += '&editor=' + _editor;  
}
	
function sendReq() {
    var i2 = new Image(1, 1);
    i2.src =  _ourplusCountUrl;
    i2.onload = function() {
        _uVoid();
    }
    return;
}
function _uVoid() {
    return;
}


function getTime()
{
	now = new Date();
	year=now.getYear();
	Month=now.getMonth()+1;
	Day=now.getDate();
	Hour=now.getHours();
	Minute=now.getMinutes();
	Second=now.getSeconds();
    MilSecond=now.getMilliseconds();
    //alert("getTime:"+year+"-"+Month+"-"+Day+"-"+Hour+"-"+Minute+"-"+Second+"-"+MilSecond);
    return year+"-"+Month+"-"+Day+"-"+Hour+"-"+Minute+"-"+Second+"-"+MilSecond;
}
function _ourplusReadCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  {
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    {
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
function _ourplusWriteCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire + "domain=;" + "path=/;";
}
// modify by Bate for record search referer.
function _setSearch(referer) {
var _search_list= new Array('www.baidu.com|baidu','www.google.com|google','www.google.cn|google','yahoo.cn|yahoo','yahoo.com|yahoo');
	var slist;
	var __ref = '';
	for(var i=0;i<_search_list.length;i++) {
		slist = _search_list[i].split('|');
		if(referer.match(slist[0],'i')) {
			__ref=slist[1];
			break;
		}
	}
	return(__ref);
}
sendReq();

