function tabFolder(hideClass, displayClass, tabName, divName,  count, id){
  for(var i=1; i<count+1; i++){
    if(i == id){
      document.getElementById(divName+"_"+i).style.display="block";
      document.getElementById(tabName+"_"+i).className=displayClass;
    }else{
      document.getElementById(divName+"_"+i).style.display="none";
      document.getElementById(tabName+"_"+i).className=hideClass;
    }
  }
}
// 左部排行榜
function nTabs(thisObj, Num) {
	if (thisObj.className == "active")
		return;
	var tabObj = thisObj.parentNode.id;
	var tabList = document.getElementById(tabObj).getElementsByTagName("div");
	for (i = 0; i < tabList.length; i++) {
		if (i == Num) {
			thisObj.className = "active";
			document.getElementById(tabObj + "_con" + i).style.display = "block";
		} else {
			tabList[i].className = "normal";
			document.getElementById(tabObj + "_con" + i).style.display = "none";
		}
	}
}
// 其它标签切换
function nTabs1(thisObj, Num) {
	if (thisObj.className == "active1")
		return;
	var tabObj = thisObj.parentNode.id;
	var tabList = document.getElementById(tabObj).getElementsByTagName("div");
	for (i = 0; i < tabList.length; i++) {
		if (i == Num) {
			thisObj.className = "active1";
			document.getElementById(tabObj + "_con" + i).style.display = "block";
		} else {
			tabList[i].className = "normal1";
			document.getElementById(tabObj + "_con" + i).style.display = "none";
		}
	}
}

// 论坛转帖
var clipBoardContent = document.URL;
function copyUserHomeToClipBoard() {
	window.clipboardData.setData("Text", clipBoardContent);
	alert("复制成功，请粘贴到你的QQ/MSN上推荐给你的好友！\r\n\r\n内容如下：\r\n" + clipBoardContent);
}

// 收藏
function soucang() {
	var arturl = document.URL;
	var arttitle = document.title;
	// document.writeln("<ul class=\"mdsclist\"><li><a href=\"#\"
	// onclick=\"javascript:window.external.AddFavorite(location.href+\'#sc\',\'★\'+document.title)\">添加到收藏夹<\/a><\/li><li><a
	// href=\"#\"
	// onclick=\"javascript:window.open(\'http:\/\/cang.baidu.com\/do\/add?it=\'+encodeURIComponent(document.title.substring(0,76))+\'&iu=\'+encodeURIComponent(location.href)+\'&fr=ien#nw=1\',\'_blank\',\'scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes\');
	// void 0\">收藏到百度<\/a><\/li><li><a href=\"#\"
	// onclick=\"window.open(\'http:\/\/myweb.cn.yahoo.com\/popadd.html?url=\'+encodeURIComponent(document.location.href)+\'&title=\'+encodeURIComponent(document.title),
	// \'Yahoo\',\'scrollbars=yes,width=780,height=550,left=80,top=80,status=yes,resizable=yes\');\">收藏到雅虎<\/a><\/li><li><a
	// href=\"#\"
	// onclick=\"javascript:window.open(\'http:\/\/shuqian.qq.com\/post?from=3&title=\'+encodeURIComponent(document.title)+\'&uri=\'+encodeURIComponent(document.location.href)+\'&jumpback=2&noui=1\',\'favit\',\'\');void(0)\">收藏到QQ<\/a><\/li><\/ul>");
	document
			.writeln("" +"<DIV class=\"mdphbg w178\"><P class=\"mdphname floatl\">热门软件推荐<\/P><\/DIV>"+
					"<ul class=\"mdsclist\">" +
					"<li><a href=\"http\:\/\/www.wapmy.cn\/webmy\/soft_down\/0\/1\/2021.jsp\" target=\"_blank\">UCWEB手机浏览器<\/a><\/li>" +
					"<li><a href=\"http\:\/\/www.wapmy.cn\/webmy\/soft_down\/0\/5\/2195.jsp\" target=\"_blank\">360手机卫士<\/a><\/li>" +
					"<li><a href=\"http\:\/\/www.wapmy.cn\/webmy\/soft_down\/0\/3\/2210.jsp\" target=\"_blank\">ET短信精灵<\/a><\/li>" +
					"<li><a href=\"http\:\/\/www.wapmy.cn\/webmy\/soft_down\/0\/1\/2010.jsp\" target=\"_blank\">手机QQ浏览器<\/a><\/li>" +
					"<li><a href=\"http\:\/\/www.wapmy.cn\/webmy\/soft_down\/0\/4\/1945.jsp\" target=\"_blank\">ET天气<\/a><\/li><\/ul>");
}
// 显示详细机型
function showmolist() {
	var oo = document.getElementById("os");
	var oa = document.getElementById("molist");
	var ob = document.getElementById("cb");
	if (oa.style.display == "block") {
		oo.style.display = "block";
		oa.style.display = "none";
		ob.innerHTML = "↓点击查看详细机型列表";
	} else {
		// oo.style.display = "none";
		oa.style.display = "block";
		ob.innerHTML = "↑点击隐藏详细机型列表";
	}
	return false;
}
function scale_img(img) {
	return;
	var w = 120;
	var h = 160;
	if (img.width > w) {
		img.width = w;
		img.height = Math.floor(img.height * (w / img.width));
	}
	if (img.height > h) {
		img.height = h;
		img.width = Math.floor(img.width * (h / img.height));
	}
}

function rss(brand, model) {
	document
			.writeln('<LI><a href="http://www.xianguo.com/subscribe.php?url=http://www.ruan8.com/rss/'
					+ brand
					+ '/'
					+ model
					+ '" target="_blank"><img border="0" alt="订阅到鲜果" src="/img/rss_xianguo.jpg"/></a></LI><LI><a href="http://fusion.google.com/add?feedurl=http://www.ruan8.com/rss/'
					+ brand
					+ '/'
					+ model
					+ '" target="_blank"><img border="0" alt="订阅到Google" src="/img/rss_google.gif"/></a></LI><LI><a href="http://www.zhuaxia.com/add_channel.php?url=http://www.ruan8.com/rss/'
					+ brand
					+ '/'
					+ model
					+ '" target="_blank"><img border="0" alt="订阅到抓虾" src="/img/rss_zhuaxia.gif"/></a></LI><LI><a href="http://add.my.yahoo.com/rss?url=http://www.ruan8.com/rss/'
					+ brand
					+ '/'
					+ model
					+ '" target="_blank"><img border="0" alt="订阅到Yahoo" src="/img/rss_yahoo.gif"/></a></LI><LI><a href="http://www.pageflakes.com/subscribe.aspx?url=http://www.ruan8.com/rss/'
					+ brand
					+ '/'
					+ model
					+ '" target="_blank"><img border="0" alt="订阅到飞鸽" src="/img/rss_pageflakes.gif"/></a></LI>');
}
