
function send()
{
    var obtitle=document.getElementById("txttitle");
    var obcontent=document.getElementById("txtcontent");
    isNull(obtitle,"标题");
    isNull(obcontent,"内容");
    isLen(obtitle,80,"标题");
    isLen(obcontent,200,"内容");
    
    if(document.getElementById("chk").checked)
    {
       
    }
    
}

function isNull(ob,key)
{
    if(ob.value=="")
    {
        alert(key+"不允许为空!");
        ob.focus();
        return;
    }
}
function isLen(ob,len,key)
{
    if(ob.value.length>len)
    {
        alert(key+"不能超过"+len+"个字符!");
        ob.focus();
        return;
    }
}

var time;
var Antime;
function SelPer(ob)
{ 
  var temp;

  var id=document.getElementById("idhid").value;
 
  document.getElementById("idhid").value=ob.id;
  
  //temp=document.getElementById(id).innerText;
  
  document.getElementById("my").innerText=ob.innerText;
  
  //ob.innerText=temp;
  
  //temp=document.getElementById(id).id;
  
  //document.getElementById(id).id=ob.id;
  
  //ob.id=temp;
  if(time!=null)
  window.clearInterval(time);
  if(document.getElementById("idhid").value!="per")
  {
	Ajax(document.getElementById("idhid").value.split('_')[1],1);
	sel_chk(document.getElementById("An_chk"));
  }else
  {
    Ajax("per,"+document.getElementById("hid_per").value,1); 
  }
}

function AnSelPer(ob)
{ 
  var temp;

  var id=document.getElementById("Anidhid").value;
 
  document.getElementById("Anidhid").value=ob.id;
  
  //temp=document.getElementById(id).innerText;
  
  document.getElementById("Anmy").innerText=ob.innerText;
  
  //ob.innerText=temp;
  
  //temp=document.getElementById(id).id;
  
  //document.getElementById(id).id=ob.id;
  
  //ob.id=temp;
  window.clearInterval(Antime);
  if(document.getElementById("Anidhid").value!="Anper")
  {
	 Ajax(document.getElementById("Anidhid").value.split('_')[1],0);
	 sel_chk_An(document.getElementById("UAn_chk"));
  }else
  {
     Ajax("per,"+document.getElementById("Anhid_per").value,0); 
  }
}

function Sd_Re()
{
  Ajax(document.getElementById("idhid").value.split('_')[1],1);
  window.clearInterval(time);
  document.getElementById("An_chk").checked=false;
}

function AnSd_Re()
{
  Ajax(document.getElementById("Anidhid").value.split('_')[1],0);
  window.clearInterval(Antime);
  document.getElementById("uAn_chk").checked=false;
}

function createXMLHTTP()
{    
     var JxmlHttp;
		if(window.XMLHttpRequest) { 
		JxmlHttp = new XMLHttpRequest();
		if (JxmlHttp.overrideMimeType) {JxmlHttp.overrideMimeType("text/xml");}
}
	else if (window.ActiveXObject) { 
	try {JxmlHttp = new ActiveXObject("Msxml2.XMLHTTP");}
	catch (e) { try {JxmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}}
	}
		if (!JxmlHttp) { return null; }
		return JxmlHttp;
}
	
	

function Ajax(Toeid,Isfigure)
{
	   var url="/vip/StockLive/Contorl/Ajax_An_Que.aspx?Toeid="+Toeid+"&Isfigure="+Isfigure;
	   var JxmlHttp=createXMLHTTP();//创建XMLHttpRequest对象
	   if (!JxmlHttp)
	   {
			alert("系统错误: 如果你在操作过程中反复出现此问题(刷新都不能解决问题)，那么可能是你的windows系统中的“MSXML”系统文件受到损坏，请先到微软官方网站下载最新版本 “MSXML”文件重新安装，再尝试。<br><br><a href='http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=993c0bcf-3bcf-4009-be21-27e85e1857b1' target='_blank'>点击此处下载微软“MSXML”文件</a>");
			return;
	  }
	  JxmlHttp.open("GET",url,true);
	  JxmlHttp.onreadystatechange=function ()
	  {
			 if(JxmlHttp.readyState==4)//判断对象状态
				{    
					if(JxmlHttp.status==200)//信息成功返回，开始处理信息
					{
						var arr=JxmlHttp.responseText;
						if(arr)
						{ 
						  // alert(Isfigure);
						   if(Isfigure=="1")
						   {
					        document.getElementById("Content_div").innerHTML=arr;
					       }else
					       {
					        document.getElementById("An_Content_div").innerHTML=arr;
					         
					       }
					    }
					}
				}
		}
		JxmlHttp.send(null);   
}
	
window.onload=function()
{   
	//Ajax('all','1'); 
	//Ajax('all','0');
	AjaxLive(); 
    //document.getElementById("Content_div").innerHTML="<img src='/StockLive/images/loading2.gif'>正在下载....";
    //document.getElementById("An_Content_div").innerHTML="<img src='/StockLive/images/loading2.gif'>正在下载....";
    document.getElementById("div_Live").innerHTML="<img src='/vip/StockLive/images/loading2.gif'>正在下载....";	 
}

function sel_chk(ob)
{
     if(ob.checked)
	 {  
		time=window.setInterval("Ajax('"+document.getElementById("idhid").value.split('_')[1]+"','1')",2000);
	 }else
	 {
	    window.clearInterval(time);
	 }
}

function sel_chk_An(ob)
{
     if(ob.checked)
	 {  
		Antime=window.setInterval("Ajax('"+document.getElementById("Anidhid").value.split('_')[1]+"','0')",2000);
	 }else
	 {
	    window.clearInterval(Antime);
	 }
}
var Livetime;
function SelLive(ob)
{
     if(ob.checked)
	 {  
		Livetime=window.setInterval("AjaxLive()",20000);
	 }else
	 {
	    window.clearInterval(Livetime);
	 }
}

function AjaxLive()
{　　
	document.getElementById("div_Live").innerHTML="正在加载....";
    var url="/vip/StockLive/Contorl/Live.aspx?TempNum="+Math.random();
	   var JxmlHttp=createXMLHTTP();//创建XMLHttpRequest对象
	   if (!JxmlHttp)
	   {
			alert("系统错误: 如果你在操作过程中反复出现此问题(刷新都不能解决问题)，那么可能是你的windows系统中的“MSXML”系统文件受到损坏，请先到微软官方网站下载最新版本 “MSXML”文件重新安装，再尝试。<br><br><a href='http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=993c0bcf-3bcf-4009-be21-27e85e1857b1' target='_blank'>点击此处下载微软“MSXML”文件</a>");
			return;
	  }
	  JxmlHttp.open("GET",url,true);
	  JxmlHttp.onreadystatechange=function ()
	  {
			 if(JxmlHttp.readyState==4)//判断对象状态
				{    
					if(JxmlHttp.status==200)//信息成功返回，开始处理信息
					{
						var arr=JxmlHttp.responseText;
						if(arr)
						{ 
					       document.getElementById("div_Live").innerHTML=arr;  
					    }
					}
				}
		}
		JxmlHttp.send(null);   
}

function ShowPic(id)
{
  var div = document.createElement("div");
  div.id = "mlay";
  div.style.cssText ="DISPLAY:inline;CURSOR:default;POSITION:absolute;height:112px; width:174px;";
  document.body.appendChild(div);
  div.style.left=event.clientX+document.body.scrollLeft;
  div.style.top=event.clientY+document.body.scrollTop;
  AjaxPic(id);
}
function HidPic(id)
{  
  var div = document.getElementById("mlay");
  if(div!=null)
  div.parentNode.removeChild(div); 
}

function AjaxPic(id)
{
       var url="/vip/StockLive/Contorl/Pic.aspx?id="+id;
	   var JxmlHttp=createXMLHTTP();//创建XMLHttpRequest对象
	   if (!JxmlHttp)
	   {
			alert("系统错误: 如果你在操作过程中反复出现此问题(刷新都不能解决问题)，那么可能是你的windows系统中的“MSXML”系统文件受到损坏，请先到微软官方网站下载最新版本 “MSXML”文件重新安装，再尝试。<br><br><a href='http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=993c0bcf-3bcf-4009-be21-27e85e1857b1' target='_blank'>点击此处下载微软“MSXML”文件</a>");
			return;
	  }
	  document.getElementById("mlay").innerHTML="<img src='/vip/StockLive/images/loading2.gif'>正在下载...."; 
	  JxmlHttp.open("GET",url,true);
	  JxmlHttp.onreadystatechange=function ()
	  {
			 if(JxmlHttp.readyState==4)//判断对象状态
				{    
					if(JxmlHttp.status==200)//信息成功返回，开始处理信息
					{
						var arr=JxmlHttp.responseText;
						if(arr)
						{ 
					       document.getElementById("mlay").innerHTML=arr; 
					    }
					}
				}
		}
		JxmlHttp.send(null);  
}

function SubLiveOnline()
{   
   url="/vip/StockLive/Aj/SubLiveOnline.aspx?key="+Math.random();
   var SubXmlHttp=createXMLHTTP();//创建XMLHttpRequest对象 
   SubXmlHttp.open("GET",url,true); 
   SubXmlHttp.onreadystatechange=function()
   {
		
   }
   SubXmlHttp.send(null);
}


