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=/";
}

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 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 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;
}

document.writeln('<div id="nfooter" style="border-top:3px solid #0a79c0;">');
document.writeln('<div id="nfunc">');
document.writeln('<ul>');
document.writeln('<li><a href="http://www.titan24.com/about/" target="_blank">关于我们</a></li>');
document.writeln('<li><a href="http://www.titan24.com/about/titanmedia.html" target="_blank">体坛传媒</a></li>');
document.writeln('<li><a href="http://www.titan24.com/about/partner.html" target="_blank">合作伙伴</a></li>');
document.writeln('<li><a href="http://www.titan24.com/about/job.html" target="_blank">招聘信息</a></li>');
document.writeln('<li><a href="http://www.titan24.com/about/ads.html" target="_blank">广告服务</a></li>');
document.writeln('<li><a href="http://www.titan24.com/about/legal.html" target="_blank">法律声明</a></li>');
document.writeln('<li><a href="http://www.titan24.com/about/Clarify.html" target="_blank">版权声明</a></li>');
document.writeln('<li><a href="mailto:yijian@titan24.com">意见反馈</a></li>');
document.writeln('<li><a href="http://www.titan24.com/about/contact.html" target="_blank">联系我们</a></li>');
document.writeln('<li class="nobor"><a href="http://www.titan24.com/about/english.html" target="_blank">About us</a></li>');
document.writeln('</ul>');
document.writeln('</div>');
document.writeln('<div id="ncopyright">');
document.writeln('<a href="http://www.titan24.com">Titan24.com</a>&copy;2008-2011 版权所有 不得转载 增值电信业务经营许可证 湘B2-20090063');
document.writeln('</div>');
document.writeln('</div>');

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?w2=' + w2 + stats_uid + '&t=' + (new Date()).getTime() + '&cu=' + cu + '&yu=' + yu + '&yun=' + yun + '&referrer=' + escape(document.referrer) + '" width="0" height="0" border="0">');

//	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>');
//	}
	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>');
	}

	//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;

