var path = "";
function initPath()
{
	path = document.getElementById("path").value;
}
function cutString(str, start, len) {
	var ilen = start + len;
	var reStr = "";
	if (str.length <= ilen) {
		return str;
	}
	for (i = 0; i < ilen; i++) {
		if (escape(str.substr(i, 1)) > 160) {
			reStr += str.substr(i, 2);
			i++;
		} else {
			reStr += str.substr(i, 1);
		}
	}
	return reStr;
}

//截取时间字段
function formatDates(str,size)
{
	if(size==null)size=10;
 	return str.length >10 ? str.substring(0,size) : str;
}
//截取时间字段
function formatDates(str,size){
	if(size==null)size=16;
 	return str.length >10 ? str.substring(0,size) : str;
}
 function showDetail(el){
 	var divId = document.getElementById(el);
 	var imageId = document.getElementById(el+"_image");
 	if(divId.style.display!="none"){
 		imageId.src=""+path+"/common/images/jia_r2_kc2.gif";
 		divId.style.display = "none";
 	}
 	else if(divId.style.display=="none")
	{
		imageId.src=""+path+"/common/images/guan_r2_kc2.gif";
		divId.style.display="block";
	}
 }
 
  //根据活动标题关键字搜索
function queryFinance()
{
	var title = document.getElementById("financeTitle").value;
	if(title == "" || title == "请输入搜索文章标题...")
	{
		getScreenByStatus("jsAddScreenInfo","info","","","","","");
    	showScreen("","ScreenInForss","promptBoxInForss",null,260,20);
	 	document.getElementById("p_content").innerHTML="请输入搜索关键字！";
	}
	else
	{
		window.location.href=path+"/p/financeResult.html?queryTitle="+encodeURI(title); 
	}
}

function addFinanceIndexViewHistory(p)
{
	XMLHttp.sendReq('post', ''+p+'/ajax/bottomNavAjax.html?operationType=addNewsFinanceIndexHistory', '', noReturnFun);
}
function noReturnFun()
{}
