function getCookiefooter(Key) {
    var search = Key + "=";
    var begin = document.cookie.indexOf(search);
    if (begin != -1) {
        begin += search.length;
        var end = document.cookie.indexOf(";", begin);
        if (end == -1) end = document.cookie.length;
        return document.cookie.substring(begin,end);
    }
}
function SetCookiefooter(sName, sValue, sDate) {
	if(sDate != '') {
		var exp  = new Date();
		exp.setTime(exp.getTime() + sDate*24*60*60*1000);
		sDate = exp.toGMTString();
	}
	document.cookie = sName + "=" + escape(sValue) + "; expires=" + sDate + "; domain=" + getMainHost(window.location.host) + "; path=/";
}

function delCookie(key) {
        var exp  = new Date();
        exp.setTime(exp.getTime() - 366*24*60*60*1000);
        sDate = exp.toGMTString();
        document.cookie = key + "=; expires=" + sDate + "; domain=" + getMainHost(window.location.host) + "; path=/";
}

var w2 = getCookiefooter('w2');
if(w2 == '-') {
        delCookie('w2');
}
else if(/usessionid=/.test(document.URL) || /usessionid=/.test(document.referrer) || /#w2/.test(document.referrer) || /#w3/.test(document.referrer) || /#w2/.test(document.URL) || /#w3/.test(document.URL)) {
        w2 = '-';
}
var stats_uid = getCookiefooter('342ec_titanuserid');
try {
if(typeof(stats_uid) == 'undefined' || stats_uid == '') {
    stats_uid = '';
}
else {
    stats_uid = '&uid=' + stats_uid;
}
}
catch(e) {
}
var statsArticle = '';
try {
if(typeof(titansite) != 'undefined' && titansite && aid > 0) {
        statsArticle = 'titansite=' + titansite + '&aid=' + aid + '&';
}
}
catch(e) {
}

function getMainHost(phost) {
        var chosts = phost.toLowerCase().split('.');
        var ahost = new Array('com', 'net', 'org', 'co', 'edu', 'gov');
        var returnhost = chosts[chosts.length - 2] + "." + chosts[chosts.length - 1];
        if(stats_in_array(chosts[chosts.length - 2], ahost) != -1) {
                returnhost = chosts[chosts.length - 3] + "." + returnhost;
        }
        return returnhost;
}



function stats_in_array(str, arr) {
        for(var i in arr) {
                if(str == arr[i]) {
                        return i;
                }
        }
        return -1;
}
try {
	if(titanstatsOff != true) {
		titanstatsOff = false;
	}
}
catch(e) {
	titanstatsOff = false;
}

var cu = getCookiefooter('cu');
if(typeof(cu) == "undefined" || cu == '') {
	cu = parseInt(10000000000000 * Math.random());
	SetCookiefooter('cu', cu, '');
}

var yun = 0;
var yu = getCookiefooter('yu');
if(typeof(yu) == "undefined" || yu == '') {
	yu = parseInt(10000000000000 * Math.random());
	SetCookiefooter('yu', yu, 9999);
	yun = 1;
}
if(titanstatsOff != true) {
	document.writeln('<scr' + 'ipt sr' + 'c="http://w.cnzz.com/c.php?id=30040084"></scr' + 'ipt>');
	document.writeln('<img src="http://59.151.99.240/www_titan24_com/logo.gif?' + statsArticle + 'w2=' + w2 + stats_uid + '&t=' + (new Date()).getTime() + '&cu=' + cu + '&yu=' + yu + '&yun=' + yun + '&referrer=' + escape(document.referrer) + '" width="0" height="0" border="0">');
	if(w2 != '-') {
	        document.writeln('<scr' + 'ipt sr' + 'c="http://w.cnzz.com/c.php?id=30001341"></scr' + 'ipt>');
	}
	else {
	        document.writeln('<scr' + 'ipt sr' + 'c="http://w.cnzz.com/c.php?id=30022837"></scr' + 'ipt>');
	}
	//Google Analytics
//	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
//	if(w2 != '-') {
//		document.writeln('<scr' + 'ipt sr' + 'c="' + gaJsHost + 'google-analytics.com/ga.js?t=' + (new Date()).getTime() + '"></scr' + 'ipt>');
//	}
//	setTimeout(settimeoutgoogle,2000);

	//Baidu Tongji
	if(w2 != '-') {
		var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
		document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F18ed3f474842d491827b6ed7d9fb843a' type='text/javascript'%3E%3C/script%3E"));
	}
	else {
		var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
		document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fd9769812dbe6239221f271784f408025' type='text/javascript'%3E%3C/script%3E"));
	}

}
titanstatsOff = true;

function settimeoutgoogle() {
	if ( typeof(_gat) == "object" ) {
		var pageTracker = _gat._getTracker("UA-9578182-1");
		pageTracker._trackPageview();
	}
}

