function $(objName){
	if(document.getElementById(objName)) 
		return document.getElementById(objName);
	return document.all.objName;
};

function functionCheckusub(page) 
		{
			var IDSMSUsers=$('IDSMSUserhiddenid').value;
var holiday = $('holidaypart').value;
			var url = "sms_sendusubpage.php?holiday="+holiday+"&IDSMSUser="+IDSMSUsers+"&page="+page;//?page="+LoginName.value; 
			//alert("123");
			//alert("afdafads");
			//var ajax = new ActiveXObject("Msxml2.XMLHttp");
			var ajax=Ajaxs();
			ajax.open("post", url, true); 
			ajax.onreadystatechange = function() 
			{  
				if (ajax.readyState == 4 )
				{  // alert(page);
					if(ajax.status == 200  ) 
					{ 
						try { 
						//alert("123")
							//alert(ajax.responseText);
							//alert($("sendsms").innerHTML);
						    checkName=ajax.responseText; //alert("123");
							//checkName="<font color='red'>test</font>";
							$("subpges").innerHTML = checkName;
							//alert($("sendsms").innerHTML);
							//alert(checkName);
							//checkName=checkName.replace(/[ ]/g,"")
						} catch (err) {}
						ajax=null;
					}
				} 
			};
			ajax.send(null);
		}			
			
function  UpdateStockMoreInfos(market,IDStock)	
{
	//alert(market+":"+IDStock);
	var k=Math.round(Math.random(100)*100);
	//alert(k);
	var url = "../../stock/getNewStockInfo.php?market="+market+"&IDStock="+IDStock+"&sid="+k;

			var ajax=Ajaxs();
			ajax.open("get", url, true); 
			ajax.onreadystatechange =function() 
			{  
				//alert(ajax.status);
				if (ajax.readyState == 4 && ajax.status == 200)
				{  
					
					//var resp =  ajax.responseText;
					//alert(resp);
				window.location.reload(true);
		
				}
			}
			ajax.send(null);
            window.location.reload(true);

}
	
	
function Ajaxs(){
	http_request=false;
	//开始初始化XMLHttpRequest对象
	if(window.XMLHttpRequest){//Mozilla浏览器
		http_request=new XMLHttpRequest();
		
		if(http_request.overrideMimeType){//设置MIME类别
			http_request.overrideMimeType("text/xml");
			
		}
	}
	else if(window.ActiveXObject){//IE浏览器
		try{
			http_request=new ActiveXObject("Msxml2.XMLHttp");
			
		}catch(e){
			alert("err");
			try{
				http_request=new ActiveXobject("Microsoft.XMLHttp");
			}catch(e){alert("err");}
		}
	}
	if(!http_request){//异常,创建对象实例失败
		window.alert("创建XMLHttp对象失败");
		return false;
	}
	return http_request;
};
function changeSelectFind(OptValue,CurrentpricesTwoId,seclectDivId){
	var selectLen=seclectDivId.length;
	var selectId=seclectDivId.substr(0,selectLen-3);
	var inputTwoLen=CurrentpricesTwoId.length;
	var inputTwoId=CurrentpricesTwoId.substr(0,inputTwoLen-3);
	if(OptValue=="BetweenGL"){
		$(CurrentpricesTwoId).style.display="block";
		$(seclectDivId).style.left="400px";
		$(inputTwoId).focus();
		//alert(inputTwoId);
	}
	else{
		$(CurrentpricesTwoId).style.display="none";
		$(seclectDivId).style.left="400px";
		if(OptValue=="Greater")
		$(selectId).options[0].selected = true;
	}
}
//改变查找单位
function showUnit(isUs){
	if(isUs=="US" || isUs=="HK"){
		$("CurrentPricesUnit").innerHTML="$";
		//$("EarningUnit").innerHTML="$";
		//$("DividendsUnit").innerHTML="$";
		$("MarketValueUnit").innerHTML="亿";
		$("CurrentPricesUnit2").innerHTML="$";
		$("EarningUnit2").innerHTML="$";
		$("DividendsUnit2").innerHTML="$";
		$("MarketValueUnit2").innerHTML="亿$";
	}
	else{
		$("CurrentPricesUnit").innerHTML="¥";
		//$("EarningUnit").innerHTML="¥";
		//$("DividendsUnit").innerHTML="¥";
		$("MarketValueUnit").innerHTML="亿";
		$("CurrentPricesUnit2").innerHTML="¥";
		$("EarningUnit2").innerHTML="¥";
		$("DividendsUnit2").innerHTML="¥";
		$("MarketValueUnit2").innerHTML="亿¥";

	}
}
function updateStock(){
	//alert(m);
	var IDStock;
	for(i=0;i<30;i++){
		IDStock="IDStock_"+i;
		var x=document.getElementById(IDStock).innerHTML;
		//alert(x);
		//var curId=x.value;
		//alert(curId);break;
		var m=x.substr(0,2);
		var id=x.substr(2);
		//alert(m+"::"+id);break;
		UpdateStockMoreInfos(m,id);
	}
}

function clearform()
{
	var t=document.getElementById("quote");

	for(i=0;i<t.length-3;i++)
	{
		//alert(t.elements[i].value);
		if(i%3==2)continue;
		t.elements[i].value="";

	}
	t.submit();
}
