//获取页面参数
function lssp_Request(name) {
//	alert(name);
    var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
    if (reg.test(location.href)){
//    	alert(unescape(RegExp.$2.replace(/\+/g, " ")));
	    return unescape(RegExp.$2.replace(/\+/g, " "));
	  }else{
	    return "";
	  }
}
//选择几个DIV中一个（每个DIV的ID由“,”间隔，索引从1开始），只是显示选中的DIV
//当有DIV的ID后加“_sel”时，索引项设置为“on”
function OnSelectedDiv(strDivIDs,iIndex)
{
	var arDivIDs=strDivIDs.split(",");
	var i=0;
	var obj=document.getElementById(arDivIDs[iIndex-1]);
	if(obj.style.display=="block"){
		return true;
	}
	for(i=0;i<arDivIDs.length;i++){
		//alert(arDivIDs[i]);
		try{
			obj=document.getElementById(arDivIDs[i]);
			if((i+1)==iIndex){
				obj.style.display="block";
			}else{
				obj.style.display="none";
			}
			obj=document.getElementById(arDivIDs[i]+"_sel");
			if((i+1)==iIndex){
				obj.className="on";
			}else{
				obj.className="";
			}
		}catch(err){}
	}
	return false;
}

//在更多页面中，通过PSID刷新列表显示
function OnMoreListByPSID(iPSId,strTitleText)
{
	//alert('OnMoreListByPSID('+iPSId+','+strTitleText+')');
	OnMoreListByPSID_PSCID(-1,iPSId,strTitleText,1);
}
//在更多页面中，通过PSID和PSCID刷新列表显示
function OnMoreListByPSID_PSCID(iPSCId,iPSId,strTitleText,iPageNo)
{
	//alert('OnMoreListByPSID_PSCID('+iPSCId+','+iPSId+','+strTitleText+','+iPageNo+')');
	if(iPageNo<1){iPageNo=1;}
	getUrlToInnerHTML("more_list","/lssp_columnex_more_list.aspx?PSID="+iPSId+"&PSCID="+iPSCId+"&PageNo="+iPageNo+"&TitleText="+encodeURIComponent(strTitleText)+"&rnd="+Math.random());
}
//站内检索提交
function InsideSearch(strIssuePath,iPSId)
{
	try
	{
	  var search=document.getElementById("SearchText");
	  if(search.value.length<1)
	  {
	    alert("请输入检索文字");
	    search.focus();
	    return;
	  }
	  if(iPSId>1){
	    window.location.href=strIssuePath+"/channel"+iPSId+"_more.shtml?search="+escape (search.value)+"&PSID="+iPSId;
	  }else{
	    window.location.href=strIssuePath+"/mainpage_more.shtml?search="+escape (search.value)+"&PSID="+iPSId;
	  }
	}
	catch(err)
	{
    alert(err);
	}
}
//站内检索提交(有选择项专用)
function InsideSearchSel(strIssuePath,iPSId,objSelect)
{
	try
	{
	  var search=document.getElementById("SearchText");
	  if(search.value.length<1)
	  {
	    alert("请输入检索文字");
	    search.focus();
	    return;
	  }
	  if(iPSId>1){
	  	if(objSelect.selectedIndex==0){
	    	window.location.href=strIssuePath+"/channel"+iPSId+"_more.shtml?search="+escape (search.value)+"&PSID="+iPSId;
	  	}else{
	  		window.location.href="/lssp_columnex_more.aspx?search="+escape (search.value)+"&PSCID="+objSelect.options[objSelect.selectedIndex].value;
	  	}
	  }else{
	  	if(objSelect.selectedIndex==0){
	    	window.location.href=strIssuePath+"/mainpage_more.shtml?search="+escape (search.value)+"&PSID="+iPSId;
	    }else{
	    	window.location.href="/lssp_columnex_more.aspx?search="+escape (search.value)+"&PSID="+objSelect.options[objSelect.selectedIndex].value;
	    }
	  }
	}
	catch(err)
	{
    alert(err);
	}
}
//评论提交
function OnCritiqueSend()
{
	try{
		var objForm=document.getElementById('formCritique');
		var objDesc=document.getElementById('cmt_content');
		var objStatus=document.getElementById('spanCritiqueStatus');
		if(objDesc.value.length<=0){
			alert('评论内容不能为空');
			objDesc.focus();
			return;
		}
		objStatus.innerHTML='正在提交，请稍等……';
		objForm.action='/lssp_Critique.aspx';
		objForm.target='iframeCritique';
		objForm.submit();
	}catch(err){
		objStatus.innerHTML=err;
	}
}
//评论提交结束
function OnCritiqueSend_End(iPCDId,strErr)
{
	try{
		var objStatus=document.getElementById('spanCritiqueStatus');
		if(strErr.indexOf("Err:")==0)
		{
			objStatus.innerHTML=strErr.substring(4);
		}else{
			if(strErr!=""){
				objStatus.innerHTML=strErr;
			}else{
				getUrlToInnerHTML("detail_critique","/lssp_Critique.aspx?PCDID="+iPCDId+"&rnd="+Math.random());
			}
		}
	}catch(err){
		alert(err);
	}
}

