// JavaScript Document
function get_holiday_index_data(fatherid,divid)
{
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	//alert(xmlhttp.readyState);
	if (xmlhttp.readyState==4){
	//alert(xmlhttp.status);
	
	//alert(xmlhttp.responseText);
	
		if (xmlhttp.status==500){
			var data=xmlhttp.responseText;
			//对结果进行unescape解码以防止中文乱码
			//document.all("err").innerHTML=unescape(data);
			}
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			//对结果进行unescape解码以防止中文乱码
			document.all(divid).innerHTML=unescape(data);
			}
		}
	}
	xmlhttp.open("post", "/holiday_ajax_data/get_holiday_index_data.asp", true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send("fatherid="+fatherid);
}

function get_holiday_line_data(url,cmdstr,divid)
{
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	//alert(xmlhttp.readyState)
	xmlhttp.onreadystatechange=function(){
	if (xmlhttp.readyState==4){
		//alert(xmlhttp.status)
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			//对结果进行unescape解码以防止中文乱码
			//alert(unescape(data));
			document.all(divid).innerHTML=unescape(data);
			}
		}
	}
	xmlhttp.open('post', url, true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send(cmdstr);

}
function get_data2obj(url,cmdstr,divid)
{
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	//alert(xmlhttp.readyState);
	if (xmlhttp.readyState==4){
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			//对结果进行unescape解码以防止中文乱码
			//alert(unescape(data))
			document.all(divid).value=unescape(data);
			//alert(document.all(divid).value)
			}
		}
	}
	xmlhttp.open("post", url, true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send(cmdstr);
}

function get_data2objAtHtml(url,divid)
{
var url;
today=new Date();
if(url.indexOf("?")<0)
	{
		url+="?mydt=" + today.getDate() + today.getSeconds()
	}
	else
	{
		url+="&mydt=" + today.getDate() + today.getSeconds()
	}
//alert(url);
$.ajax({
 url: url,
 async: true,
 error: function(xmlhttp,msg){alert("Error:"+xmlhttp.StatusText);},
 complete: function(xmlhttp){document.getElementById(divid).innerHTML=xmlhttp.responseText}
});
}


var oPopup = window.createPopup(); 

function rdl_doClick(divid,obj,leftplus)
{ 
var oMessage=document.all(divid); 
//if (obj.value=="")
//	{
			with (oPopup.document.body) { 
			//style.backgroundColor="lightyellow"; 
			//style.border="solid black 1px"; 
			innerHTML=oMessage.value;
			} 
		oPopup.show(70, 70, 180, 1, document.body); 
		var width = oPopup.document.body.scrollWidth;
		var height = oPopup.document.body.scrollHeight;
		oPopup.hide();
		
		// 显示菜单
		var l = obj.offsetLeft; 
		var t = obj.offsetTop; 
			while(obj = obj.offsetParent) 
			{ 
			l += obj.offsetLeft; 
			t += obj.offsetTop; 
			} 
		
		oPopup.show(l+leftplus, t+20, width, height, document.body);
	//}	
} 

function rd2_doClick(divid,obj,leftplus)
{ 
var oMessage=document.all(divid); 
//if (obj.value=="")
//	{
			with (oPopup.document.body) { 
			//style.backgroundColor="lightyellow"; 
			//style.border="solid black 1px"; 
			innerHTML=oMessage.value;
			} 
		oPopup.show(70, 70, 180, 1, document.body); 
		var width = oPopup.document.body.scrollWidth;
		var height = oPopup.document.body.scrollHeight;
		oPopup.hide();
		
		// 显示菜单
		oPopup.show(10, 410, width, height, document.body);
	//}	
} 




function putStrValue(value,obj)
{

	document.all(obj).value=value;
	oPopup.hide();
}

function getclass(classid,divid,selectname,boxid,divbuttonid)
{
	var url="getclass.asp?fatherid="+classid+"&selectname="+selectname+"&type=select";
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	//alert("fatherid="+classid+"&selectname="+selectname+"&type=select");
	if (xmlhttp.readyState==4){
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			//对结果进行unescape解码以防止中文乱码
			//alert(data)
			processData(data,divid);
			//createvluebox(divbuttonid,selectname,boxid);
			j=-1;
			}
		}
	}
	xmlhttp.open("post", "getclass.asp", true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send("fatherid="+classid+"&selectname="+selectname+"&type=select");
}
function processData(html,classlayer)
{
	oPopup.document.all(classlayer).innerHTML=html;
}

function rd2_doClick(divid,obj)
{ 
var oMessage=document.all(divid); 
//alert(obj.value)
if (obj.value!="" && oMessage.value!="")
	{
			with (oPopup.document.body) { 
			style.backgroundColor="#FFFDF7"; 
			//style.border="1px solid #8EC1FF"; 
			innerHTML=oMessage.value;
			} 
		oPopup.show(70, 70, 180, 1, document.body); 
		var width = oPopup.document.body.scrollWidth;
		var height = oPopup.document.body.scrollHeight;
		oPopup.hide();
		
		// 显示菜单
		var l = obj.offsetLeft; 
		var t = obj.offsetTop; 
			while(obj = obj.offsetParent) 
			{ 
			l += obj.offsetLeft; 
			t += obj.offsetTop; 
			} 
		
		oPopup.show(l, t+20, width, height, document.body);
	}
	else
	{
	oPopup.hide();
	}	
} 
  function getvalue(txt)
  {
  parent.document.all("overarea").value=txt
  oPopup.hide();
  }

  function   list_up(obj)   
  {   
      var   a   =   oPopup.document.getElementsByName(obj);  
	  var num 
      for   (var   i=0;   i<a.length;   i++)   
         {
		 if(a[i].style.display=="")
			 {
			 a[i].style.display="none";
			 if(i==0)
				 {
				 a[a.length-1].style.display="";
				  break;
				 }
				 else
				{
				 a[i-1].style.display="";
				 break;
				}
			 }
		  }
  }   
  
   function   list_down(obj)   
  {   
      var   a   =   oPopup.document.getElementsByName(obj);   
      for   (var   i=0;   i<a.length;   i++)   
         {
		 if(a[i].style.display=="")
			 {
			 a[i].style.display="none";
			 if(i==a.length-1)
				 {
				 a[0].style.display="";
				  break;
				 }
				 else
				{
				 a[i+1].style.display="";
				 break;
				}
			 }
		  }
  }   

function get_data2obj_a(url,cmdstr,divid)
{
	var xmlhttp;
	try{
		xmlhttp=new XMLHttpRequest();
		}
	catch(e){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function(){
	//alert(xmlhttp.readyState);
	if (xmlhttp.readyState==4){
		if (xmlhttp.status==200){
			var data=xmlhttp.responseText;
			//对结果进行unescape解码以防止中文乱码
			//alert(unescape(data))
			document.all(divid).value=unescape(data);
			}
		}
	}
	xmlhttp.open("post", url, false);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send(cmdstr);
}

