// JavaScript Document
document.domain = "localhost";

//$(function () {
			//$(document.forms["form1"]).submit(function () { checksearch(document.forms["form1"]); return false; });
//});
function gocheck()
{
	 if (event.keyCode == 13)
     {
		checksearch();
		return false;
     }	
}

function strlen(str){var i;var len = 0;for (i=0;i<str.length;i++) if (str.charCodeAt(i)>255) len+=2; else len++;return len;}

function showtab(id)
{
	for(var i=1;i<=4;i++)
	{
		if(i==id)
		{
			document.getElementById("tlist"+id).style.display="";	
			document.getElementById("tab"+id).className="tophover";
		}
		else
		{
			document.getElementById("tlist"+i).style.display="none";
			document.getElementById("tab"+i).className="";
		}
	}
}

function shownew(id)
{
	for(var i=1;i<=2;i++)
	{
		if(i==id)
		{
			document.getElementById("new"+id).style.display="";	
			document.getElementById("tcolor"+id).className="yanse";
		}
		else
		{
			document.getElementById("new"+i).style.display="none";
			document.getElementById("tcolor"+i).className="";
		}
	}	
}

function showzt(id)
{
	for(var i=1;i<=2;i++)
	{
		if(i==id)
		{
			document.getElementById("zttj0"+id).style.display="";	
			document.getElementById("tzt"+id).className="she";
		}
		else
		{
			document.getElementById("zttj0"+i).style.display="none";
			document.getElementById("tzt"+i).className="";
		}
	}		
}

function showpic(id)
{
	document.getElementById("nownum").value=id;
	for(var i=1;i<=tolpic;i++)
	{
		if(id==i)
		{
			document.getElementById("pic"+id).style.display="";
			document.getElementById("dot"+id).className="scr";
		}
		else
		{
			document.getElementById("pic"+i).style.display="none";
			document.getElementById("dot"+i).className="";
		}
	}
}
function PicUp()
{
	var nowid=Number(document.getElementById("nownum").value)-1;
	//alert(nowid);
	if(nowid>=1)
	{
		for(var i=1;i<=tolpic;i++)
		{
			if(i==nowid)
			{
				document.getElementById("pic"+nowid).style.display="";
				document.getElementById("dot"+nowid).className="scr";
			}
			else
			{
				document.getElementById("pic"+i).style.display="none";
				document.getElementById("dot"+i).className="";
			}
		}
		document.getElementById("nownum").value=(nowid);
	}
	else
	{
		document.getElementById("nownum").value=tolpic;
	}
	
}
function PicNext()
{
	var nowid=Number(document.getElementById("nownum").value)+1;
	//alert(nowid);
	if(nowid<=tolpic)
	{
		for(var i=1;i<=tolpic;i++)
		{
			if(i==nowid)
			{
				document.getElementById("pic"+nowid).style.display="";
				document.getElementById("dot"+nowid).className="scr";
			}
			else
			{
				document.getElementById("pic"+i).style.display="none";
				document.getElementById("dot"+i).className="";
			}
		}
		document.getElementById("nownum").value=(nowid);
	}
	else
	{
		document.getElementById("nownum").value=1;
	}
}


function addfav()
{
	title = "集Q网";
	url = "http://www.luqq.net";
	if(window.sidebar){
			window.sidebar.addPanel(title,url,'');
		}else{
			try{
				window.external.AddFavorite(url,title);
			}catch(e){
				alert("您的浏览器不支持该功能,请使用Ctrl+D收藏本页");
			}
	}
}

function shareour() {
    if ($("#share").length > 0) { 
        $("#share").show();
        return;
    }
    $(document.body).append("<div id=\"share\" style='display:none'>");
    $("#share").css("top", "100px");
    var window_w = $(window).width();
    var obj_w = $("#share").width();
    $("#share").css("left", (window_w - obj_w) / 2 + "px");

    $("#share").append("<div class=\"share_title\">");

    $("#share .share_title").html("<span class=\"share_title1\">推荐给您的好朋友</span><i class=\"close\"></i>");
    $("#share .share_title .close").click(function () {
        $("#share").fadeOut(100);
    });
	var bshde="";
	bshde=bshde+"Hi，感谢您浏览集Q网，如果您觉得我们网站不错的话，可以点击下方按钮直接分享给您的好友。";
	//bshde=bshde+"<div id=\"bdshare\" class=\"bdshare_t bds_tools_32 get-codes-bdshare\">";
//	bshde=bshde+"<a class=\"bds_qzone\"></a>";
//	bshde=bshde+"<a class=\"bds_tsina\"></a>";
//	bshde=bshde+"<a class=\"bds_tqq\"></a>";
//	bshde=bshde+"<a class=\"bds_renren\"></a>";
//	bshde=bshde+"<span class=\"bds_more\">更多</span>";
//	bshde=bshde+"<a class=\"shareCount\"></a></div>";
//	bshde=bshde+"<script type=\"text/javascript\" id=\"bdshare_js\" data=\"type=tools\" ><//script>";
//	bshde=bshde+"<script type=\"text/javascript\" id=\"bdshell_js\"><//script>";
//	bshde=bshde+"<script type=\"text/javascript\">";
//	bshde=bshde+"document.getElementById(\"bdshell_js\").src = \"http://bdimg.share.baidu.com/static/js/shell_v2.js?t=10\";";
//	bshde=bshde+"<//script>";
	
	//alert(bshde);
	
	var bdhtml=document.getElementById("sharebdlist").innerHTML;
	bshde=bshde+bdhtml;
	//alert(bdhtml);
	
    var title = document.title;
    $("#share").append("<div class=\"share_msg\">");
    $("#share .share_msg").html(bshde);
	$("#share").show();
}

function ShowFXlist()
{
	document.getElementById("fenxiangmore").style.display="";	
}

function HiddenFxList()
{
	document.getElementById("fenxiangmore").style.display="none";	
}

function share(sname)
{
	var url=location.href;
	var title=document.title;
	if(sname=="qq")
	{
		var allurl="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title="+encodeURI(title)+"&url="+ encodeURI(url);
		window.open(allurl);
	}
	if(sname=="tqq")
	{
		var allurl="http://share.v.t.qq.com/index.php?c=share&a=index&title="+encodeURI(title)+"&url="+ encodeURI(url);
		window.open(allurl);
	}
	if(sname=="sina")
	{
		var allurl="http://service.weibo.com/share/share.php?title="+encodeURI(title)+"&url="+ encodeURI(url);
		window.open(allurl);	
	}
	if(sname=="pengyou")
	{
		var allurl="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&url="+encodeURI(url);
		window.open(allurl);
	}
	if(sname=="renren")
	{
		var allurl="http://share.renren.com/share/buttonshare.do?link="+encodeURI(url)+"&title="+encodeURI(title);	
		window.open(allurl);
	}
	if(sname=="kaixin")
	{
		var allurl="http://www.kaixin001.com/rest/records.php?content="+encodeURI(title)+"&url="+encodeURI(url)+"&aid=138636542&style=11";	
		window.open(allurl);
	}
	if(sname=="douban")
	{
		var allurl="http://shuo.douban.com/!service/share?image=&name="+encodeURI(title)+"&href="+encodeURI(url);	
		window.open(allurl);	
	}
	if(sname=="tieba")
	{
		var allurl="http://tieba.baidu.com/i/app/open_share_api?link="+encodeURI(url);	
		window.open(allurl);	
	}
	if(sname=="cang")
	{
		var allurl="http://cang.baidu.com/do/add?it="+encodeURI(title)+"&iu="+encodeURI(url);	
		window.open(allurl);	
	}
	if(sname=="bdhi")
	{
		var allurl="http://apps.hi.baidu.com/share/?url="+encodeURI(url)+"&title="+encodeURI(title);	
		window.open(allurl);	
	}
	if(sname=="sohu")
	{
		var allurl="http://www.jiathis.com/send/?webid=tsohu&url="+encodeURI(url)+"&title="+encodeURI(title);	
		window.open(allurl);	
	}
	if(sname=="qqtag")
	{
		var allurl="http://shuqian.qq.com/post?from=3&title="+encodeURI(title)+"&uri="+encodeURI(url);	
		window.open(allurl);	
	}
	if(sname=="163")
	{
		var allurl="http://t.163.com/article/user/checkLogin.do?info="+encodeURI(title)+"&href="+encodeURI(url);	
		window.open(allurl);	
	}
	if(sname=="copy")
	{
		try{
			var clipBoardContent="";  
			clipBoardContent=url;  
			window.clipboardData.setData("Text",clipBoardContent);  
			alert('复制成功')
		}catch(e){
			alert("您使用的是非IE浏览器核心。请手动复制网址！");
		} 	
	}
}
