// 控制文章中的图片宽度
function PicLimit(){
	var len = document.images.length;
	for(var i=0;i<len;i++){
		if(document.images[i].src.indexOf("bt") != -1){
			continue;
		}
		if(document.images[i].width > 540){
			document.images[i].width = 540;	
			document.images[i].align = "center";
		}
	}
}

// 调用php程序给相应的机构或名家增加点击
function openpopup(fid){	
	var Server = new ActiveXObject("Microsoft.XMLHTTP");
	if(Server!=null){
		Server.open("get", "http://www.10jqka.com.cn/finance/add_step.php?id="+fid+"", false);
		Server.send(null);
		//alert(Server.responseText);
	}
}
// 用cookie控制机构点击，率刷新页面不顶用
function get_cookie(Name) {
	var search = Name + "="
	var returnvalue = "";
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) { // if cookie exists
			offset += search.length
			// set index of beginning of value
			end2 = document.cookie.indexOf(";", offset);
			// set index of end of cookie value
			if (end2 == -1)
			end2 = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end2))
		}
	}
	return returnvalue;
}
function loadpopup(cid, fid){
	// cookie后面跟guid值，不同的机构/名家列表用不同的cookie值，用于文章页面加点击
	if(get_cookie("org_guid_"+cid)==""){
		openpopup(fid);
		document.cookie="org_guid_"+cid+"=yes";
	}
}
function loadpopup_list(fid){
	// cookie后面跟type值，不同的机构/名家列表用不同的cookie值，用户列表页面加点击
	if(get_cookie("org_list_"+fid)==""){
		openpopup(fid);
		document.cookie="org_list_"+fid+"=yes";
	}
}



// 改变页面字体大小，同时再次伸缩页面的高度
function ChangeShow(x)
{
	switch (x){
	case "1":
	text.className="textbody1";
	break;
	case "2":
	text.className="textbody2";
	break;
	case "3":
	text.className="textbody3";
	break;
	}
}

// 点击文章中的股票代码——行情，跳出cgi分时图
function go(stock){
	window.open('http://www.10jqka.com.cn/cgihq/mainframe1.php?lx=feshi&code='+stock,"_blank"," width=800,height=600,toolbar=no,menubar=no,scrollbar=no,resizable=no,location=no,status=no,titlebar=no");
}
