function clearTextBox(id)
{
	var tb = document.getElementById(id);
	tb.value = "";
}

function openFundIndex()
{
	var tb = document.getElementById("tbFundCode");
	var fundCode = tb.value;
	if (fundCode == "")
	{
		alert("请输入基金代码。");
		return;
	}
	
	if (!existFundCode(fundCode))
	{
		alert("基金代码不正确。")
		return;
	}
	
	var url = "http://www.jjmmw.com/cgi-bin/fund/view?fundCode=" + tb.value;
	window.open(url);
}

function openFundIndex2()
{
	var tb = document.getElementById("q");
	var fundCode = tb.code;
	
	if (typeof(fundCode) == 'undefined')
	{
		alert("请输入基金代码。");
		return;
	}
	
	var url = "http://www.jjmmw.com/cgi-bin/fund/view?fundCode=" + fundCode;
	window.open(url);
}

function goFundIndex()
{
	var tb = document.getElementById("TextFundIndex");
	var fundCode = tb.value;
	if (fundCode == "")
	{
		alert("请输入基金代码。");
		return;
	}
	
	if (!existFundCode(fundCode))
	{
		alert("基金代码不正确。")
		return;
	}
	
	var url = "/html/" + tb.value + "/";
	window.open(url);
}
function goFundIndex2()
{
	var tb = document.getElementById("TextFundIndex");
	var fundCode = tb.code;
	
	if (typeof(fundCode) == 'undefined')
	{
		alert("请输入基金代码。");
		return;
	}
	
	var url = "/html/" + fundCode + "/";
	window.open(url);
}
function goEstimateFund()
{
	var tb = document.getElementById("TextFundIndex");
	var fundCode = tb.value;
	if (fundCode == "")
	{
		alert("请输入基金代码。");
		return;
	}
	
	if (!existFundCode(fundCode))
	{
		alert("基金代码不正确。")
		return;
	}
	
	var url = "http://gs.fund123.cn/EstimateFund" + tb.value + ".aspx";
	window.open(url);
}
function goEstimateFund2()
{
	var tb = document.getElementById("TextFundIndex");
	var fundCode = tb.code;
	
	if (typeof(fundCode) == 'undefined')
	{
		alert("请输入基金代码。");
		return;
	}
	
	var url = "http://gs.fund123.cn/EstimateFund" + fundCode + ".aspx";
	window.open(url);
}
function goNetValueHistory()
{
	var tb = document.getElementById("TextFundIndex");
	var fundCode = tb.value;
	if (fundCode == "")
	{
		alert("请输入基金代码。");
		return;
	} 
	
	if (!existFundCode(fundCode))
	{
		alert("基金代码不正确。")
		return;
	}
	
	var url = "http://My.fund123.cn/NetValueHistory" + tb.value + ".aspx";
	window.open(url);
}
function goNetValueHistory2()
{
	var tb = document.getElementById("TextFundIndex");
	var fundCode = tb.code;
	
	if (typeof(fundCode) == 'undefined')
	{
		alert("请输入基金代码。");
		return;
	}
	
	var url = "http://My.fund123.cn/NetValueHistory" + fundCode + ".aspx";
	window.open(url);
}
function existFundCode(fundCode)
{
	var stockFunds = stockFund[1].split(";");
	var mixFunds = mixFund[1].split(";");
	var bondFunds = bondFund[1].split(";");
	var etfFunds = etfFund[1].split(";");
	var lofFunds = lofFund[1].split(";");
	var qdiiFunds = QDIIFund[1].split(";");
	
	for(var i = 0; i < stockFunds.length; i++)
	{
		if (stockFunds[i] == fundCode)
		{
			 return true;
		}
	}
	
	for(var i = 0; i < mixFunds.length; i++)
	{
		if (mixFunds[i] == fundCode)
		{
			 return true;
		}
	}
	
	for(var i = 0; i < bondFunds.length; i++)
	{
		if (bondFunds[i] == fundCode)
		{
			 return true;
		}
	}
	
	for(var i = 0; i < etfFunds.length; i++)
	{
		if (etfFunds[i] == fundCode)
		{
			 return true;
		}
	}
	
	for(var i = 0; i < lofFunds.length; i++)
	{
		if (lofFunds[i] == fundCode)
		{
			 return true;
		}
	}
	
	for(var i = 0; i < qdiiFunds.length; i++)
	{
		if (qdiiFunds[i] == fundCode)
		{
			 return true;
		}
	}
	
	return false;
}


