
// JavaScript到Flash通信
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) 
{  
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');  
	document.write('on error resume next \n');  
	document.write('Sub Price_FSCommand(ByVal command, ByVal args)\n');  
	document.write(' call Price_DoFSCommand(command, args)\n');  
	document.write('end sub\n');  
	document.write('</script\> \n');
} 
 
// JavaScript到Flash通信
function SetPrice(stockValue1, stockValue2, stockValue3, stockValue4, stockValue5, tradeValue1, tradeValue2, tradeValue3, tradeValue4, tradeValue5, marketValue1, marketValue2, marketValue3, marketValue4, marketValue5)
{
	window.document.Price.SetVariable("stockValue1", stockValue1);
	window.document.Price.SetVariable("stockValue2", stockValue2);
	window.document.Price.SetVariable("stockValue3", stockValue3);
	window.document.Price.SetVariable("stockValue4", stockValue4);
	window.document.Price.SetVariable("stockValue5", stockValue5);

	window.document.Price.SetVariable("tradeValue1", tradeValue1);
	window.document.Price.SetVariable("tradeValue2", tradeValue2);
	window.document.Price.SetVariable("tradeValue3", tradeValue3);
	window.document.Price.SetVariable("tradeValue4", tradeValue4);
	window.document.Price.SetVariable("tradeValue5", tradeValue5);

	window.document.Price.SetVariable("marketValue1", marketValue1);
	window.document.Price.SetVariable("marketValue2", marketValue2);
	window.document.Price.SetVariable("marketValue3", marketValue3);
	window.document.Price.SetVariable("marketValue4", marketValue4);
	window.document.Price.SetVariable("marketValue5", marketValue5);

	window.document.Price.SetVariable("isNewData", 1);
}
   
function SetProgressBlue(totalNum, stockCode, stockName, sortNum)
{
	window.document.ProgressBlue.SetVariable("totalNum", totalNum);
	window.document.ProgressBlue.SetVariable("stockCode", stockCode);
	window.document.ProgressBlue.SetVariable("stockName", stockName);
	window.document.ProgressBlue.SetVariable("sortNum", sortNum);

	window.document.ProgressBlue.SetVariable("isNewData", 1);
}
   
function SetProgressRed(totalNum, stockCode, stockName, sortNum)
{
	window.document.ProgressRed.SetVariable("totalNum", totalNum);
	window.document.ProgressRed.SetVariable("stockCode", stockCode);
	window.document.ProgressRed.SetVariable("stockName", stockName);
	window.document.ProgressRed.SetVariable("sortNum", sortNum);

	window.document.ProgressRed.SetVariable("isNewData", 1);
}

// 验证用户输入的是否是6位数字
function Form_Submit()
{
	var stockCode = document.getElementById("txtStockCode").value;
		
	if(IsNumber(stockCode))
	{
		return true;
	}
	else
	{
		alert('请输入六位数字!');
		
		return false;
	}
}

// 验证输入
function IsNumber(stockCode)
{
	var regExp = new RegExp(/\d{6}/g);
	
	return regExp.test(stockCode);	
}