/**新分面动作**/
var tempCname;
function pgOver(cobj){
	tempCname=cobj.className;
	if (tempCname!="pgtubut"){
		cobj.className="pgcurbut";
	}
	else{
		cobj.className="pgtucurbut";
	}
}
function pgOut(cobj){
	cobj.className=tempCname;
}

/**
 * 用户对网址的顶或踩
 */
function dcFeng(rowid,ctype,cclass){
	
	if (rowid=="" || ctype=="")
	{
		return;
	}
	var url="/webdcFeng.php?rowid="+rowid+"&ctype="+ctype;
	
	if (cclass!=null)
	{
		url+="&cclass="+cclass;
	}
	frames["updateWindow"].location=url;
}

function showdc(event,rowid){
		var tobj = document.getElementById("sd");
		//写入参数
		var hobj = document.getElementById("caiCnt");
		var tempHTML = "<li><a href='javascript:return false' onclick='dcFeng("+rowid+",2,21),closedc()'>内容不健康,污染首页</a></li>";
		tempHTML += "<li><a href='javascript:return false' onclick='dcFeng("+rowid+",2,22),closedc()'>网站设计太杂太乱</a></li>";
		tempHTML += "<li><a href='javascript:return false' onclick='dcFeng("+rowid+",2,23),closedc()'>网站内容信息陈旧</a></li>";
		hobj.innerHTML=tempHTML;
		tobj.style.display="block";
		sd.style.left=document.body.scrollLeft+event.clientX-70;
		sd.style.top=document.body.scrollTop+event.clientY+10;
}
function closedc(){
	var tobj = document.getElementById("sd");
	tobj.style.display="none";
}

/*用户新共享网址的预览
 * shPreview()
 * chbk()
 */
function shPreview(id,shurl){
	var shid = "sh"+id;
	var shframe = "shframe"+id;
	var obj = document.getElementById(shid);
	if (obj.style.display=="none"){
		frames[shframe].location.href=shurl;
		obj.style.display="block";
	}
	else{
		obj.style.display="none";
	}
}	

function chbk(obj){
	if(obj.innerText=="◎预览")
		obj.innerText="关闭预览";
	else
		obj.innerText="◎预览";
}


function nsPanBut(groupid,curid){
	ids = groupid.split(",");
	var spObj,dtObj;
	for(i=0;i<ids.length;i++){
		spObj = document.getElementById("nspb_"+ids[i]);
		dtObj = document.getElementById("data_"+ids[i]);
		if (ids[i]==curid)
		{
			spObj.className="nsPan_curBut";
			dtObj.style.display="block";
		}
		else{
			spObj.className="nsPan_But";
			dtObj.style.display="none";
		}
	}
	//首页主体确定
	if (curid=="1"){
		chpage("1");//最新共享网址
	}
	else if(curid=="2"){
		chpage("2");//用户顶起的网址
	}
	else if(curid=="3"){
		chpage("3");//最新共享图片
	}
}

function chpage(str){
	for(i=1;i<9;i++){
		var tpObj = document.getElementById("page"+i);
		url = tpObj.href;
		if ((tpObj.href).indexOf("?")>0)
		{
			url = (tpObj.href).substring(0,(tpObj.href).indexOf("?"));
		}
		tpObj.href=url+"?type="+str;
	}
}

function initPage(){
	url = window.location.href;
	pos = url.indexOf("?");
	var curid="";
	if (pos<1)
	{
		return;
	}
	
	//获取参数
	paras=(url.substring(pos+1)).split("&");
	for(i=0;i<paras.length;i++){
		paras[i]=paras[i].split("=");
	}
	for(i=0;i<paras.length;i++){
		//alert("参数名："+paras[i][0]+"参数值："+paras[i][1])
		if (paras[i][0]=="type")
		{
			curid=paras[i][1];
		}
	}
	
	
	if(curid=="2" || curid=="3")
		nsPanBut('1,2,3',curid);
}

