function createReq(){
	 var httpReq;
	 if(window.XMLHttpRequest){
		 httpReq = new XMLHttpRequest();
		 if(httpReq.overrideMimeType){
			 httpReq.overrideMimeType('text/xml');
		 }
	 }
	 else if(window.ActiveXObject){
		 try{
			  httpReq = new ActiveXObject('Msxml2.XMLHTTP');
		 } catch(e){
			 try{
			    httpReq = new ActiveXObject('Microsoft.XMLHTTP');
			 } catch(e2){
			 }
		 }
	 }
	 return httpReq;
}
function $(objName){
	if(document.getElementById){
		return document.getElementById(objName);
	}else{
		return document.all.objName;
	}
}
function showChartTitle(title)
{
	if($("stock_title"))
	$("stock_title").innerHTML = title;
}

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){
	  try{
	  http_request=new ActiveXobject("Microsoft.XMLHttp");
	  }catch(e2){}
	 }
    }
	if(!http_request){//异常，创建对像实例失败
	 window.alert("创建XMLHttp对像失败！");
	 return false;
	}

	return http_request;
}
function  DateDiff(sDate1,  sDate2){    //sDate1和sDate2是2006-12-18格式
       var  aDate,  oDate1,  oDate2,  iDays
       aDate  =  sDate1.split("-")
       oDate1  =  new  Date(aDate[1]  +  '-'  +  aDate[2]  +  '-'  +  aDate[0])    //转换为12-18-2006格式
       aDate  =  sDate2.split("-")
       oDate2  =  new  Date(aDate[1]  +  '-'  +  aDate[2]  +  '-'  +  aDate[0])
       iDays  =  parseInt(Math.abs(oDate1  -  oDate2)  /  1000  /  60  /  60  /24)    //把相差的毫秒数转换为天数
       return  iDays
   }
function setURL(){
    var dtStart=document.all.dtStart.value;
	var dtEnd=document.all.dtEnd.value;
	var url='detailList.php?IDStock=<?=$IDStock?>&market=<?=$market?>&dtStart='+dtStart+'&dtEnd='+dtEnd+'&mobile=0';
	window.location=url;
}
//*************
function setLJURL(market,IDStock){

	var dtStart=document.getElementById("dtStart").value;
	var dtEnd=document.getElementById("dtEnd").value;
	var stock_title=$("stock_title").innerHTML;
	var url = '?market='+market+'&IDStock='+IDStock+'&start='+dtStart+'&end='+dtEnd+'&mobile=0&stock_title='+stock_title;
	window.location=encodeURI(url);
}
function setKLineURL(market,IDStock){
	var dtStart=document.getElementById("dtStart").value;
	var dtEnd=document.getElementById("dtEnd").value;
	var url='?market='+market+'&IDStock='+IDStock+'&start='+dtStart+'&end='+dtEnd+'&mobile=0&kl=1&stock_title='+$("stock_title").innerHTML;
	window.location=encodeURI(url);
}
function setURL(market,IDStock){
    var dtStart=document.getElementById("dtStart").value;
	var dtEnd=document.getElementById("dtEnd").value;
	var url='?market='+market+'&IDStock='+IDStock+'&dtStart='+dtStart+'&dtEnd='+dtEnd+'&stock_title='+$("stock_title").innerHTML+'&type=1';
	window.location=encodeURI(url);
}
  function showTodayPVchart(url){
	document.getElementById("HKImage").setAttribute("width",512);
	document.getElementById("HKImage").setAttribute("height",288);
}
