function mouseovertr(o) {
	  o.style.backgroundColor="#FFF6C7";
      //o.style.cursor="hand";
  }
function mouseouttr(o) {
  o.style.backgroundColor=""
}
function mouseovertr_x(o) {
	  o.style.backgroundColor="#00A8BC";
      //o.style.cursor="hand";
}
  
function IsVaildNum(obj)
{
	if(isNaN(obj)){ 
	alert("请输入正确的数字");
	return false;
	}
	else if(Number(obj)<0)
	{
	alert("数字不能为负数");
	return false;
	}
	return true;

}

//验证日期
function strDateTime(str)
{ 
	var dates = str.split("-");
	if(dates.length != 3)
		return false;	
	var date = new Date(dates[0] + "/" + dates[1] + "/" + dates[2]);
	if(date.getFullYear()==dates[0] && (date.getMonth()+1)==dates[1] && date.getDate()==dates[2])
		return true;
	else
		return false;	
} 

//打开新的窗口
function OpenNewWindow(theURL,winName,features,iWidth,iHeight){
	var  iTop=(window.screen.height-iHeight)/2;
	var  iLeft=(window.screen.width-iWidth)/2;
	if(features != ""){
		window.open(theURL,winName,features + ",width=" + iWidth + ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + "");
	}else{
		window.open(theURL,winName,"width=" + iWidth + ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + "");
	}
}

function OpenDialog(theURL,winName,features,iWidth,iHeight)
{
    var  iTop=(window.screen.height-iHeight)/2;
	var  iLeft=(window.screen.width-iWidth)/2;
	if(features != ""){
		window.showModelessDialog(theURL,winName,features + ",width=" + iWidth + ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + "");
	}else{
		window.showModelessDialog(theURL,winName,"width=" + iWidth + ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + "");
	}
}

/*--通用列表菜单控制--
页面中声明：
var Handle=new ListButtonHandle(); 
Handle.EditUrl="X.aspx?ID=";
Handle.EditObject="系统";
Handle.tblElement="List";
Handle.EditForm=document.form1;
按钮调用：onclick="Handle.OnEditSubmit()"
*/
function ListButtonHandle()
{
    this.EditUrl="";//修改地址
    this.EditObject="";//操作对象
	this.CopyUrl="";//复制地址
	this.tblElement="";//操作列表ID名称
	this.tblBeginRows=1;//操作列表数据项开始行数	
	this.EditForm="";//表单名称
    this.CheckAll=function(obj)
    {	
	    for (var i=0;i<this.EditForm.elements.length;i++) 
	    { 
	    var e=this.EditForm.elements[i]; 
	    if ((e.name != 'allbox') && (e.type=='checkbox') && (e.disabled==false)) 
	    {  
	    e.checked=obj.checked; 
	    } 	
	    }
    }
    this.OnEditSubmit=function ()
    {    
	    var Url=this.EditUrl;
	    var arr=this.GetChkValue();
	    if(arr.length==0)
	    {
		    alert("未选择"+this.EditObject);	
	    }
	    if(arr.length>1)
	    {
		    alert("只能选择一个"+this.EditObject);	
	    }
	    else if(arr.length==1)
	    {
			window.location.href=Url+arr[0];
	    }
    }
	this.OnCopySubmit=function ()
    {    
	    var Url=this.CopyUrl;
	    var arr=this.GetChkValue();
	    if(arr.length==0)
	    {
		    alert("未选择"+this.EditObject);	
	    }
	    if(arr.length>1)
	    {
		    alert("只能选择一个"+this.EditObject);	
	    }
	    else if(arr.length==1)
	    {
			window.location.href=Url+arr[0];
	    }
    }
    this.OnDeleteSubmit=function ()
    {
	    var arr=this.GetChkValue();
	    if(arr.length==0)
	    {
		    alert("未选择"+this.EditObject);
		    return false;
	    }
	    else
	    {
		    return confirm("您确定要删除此"+this.EditObject+"吗？\n此操作不可恢复");
	    }
    }
	//返回被选中ID数组
	this.GetChkValue=function()
	{
		var obj=document.getElementById(this.tblElement);
		var arr=new Array();
		if(obj == null)
		{
			return arr;
		}
		var tr=obj.childNodes(0).childNodes;		
		for(i=this.tblBeginRows;i<tr.length;i++)   //---注意：这里的i是从2开始的，对应的<td rowspan="2"></td>
		{
			try{
				var chkbox=tr[i].childNodes(0).childNodes(0).childNodes(0)
				var _thisValue=tr[i].childNodes(0).childNodes(0).InnerValue;
				if(chkbox.checked)
				{
					arr.push(_thisValue);
				}
			}
			catch(e){}
		}
		return arr;
	}
}

//以层的形式显示所有的报价等级和客户等级的价格
function ShowMoneyList(obj)
{
obj.parentNode.childNodes(1).style.display = 'block';
}
//隐藏层上所有的报价等级和客户等级的价格
function HidMoneyList(obj)
{
obj.parentNode.childNodes(1).style.display = 'none';
}

//查看订单的游客信息
function AllPeopleNumber(TourId,OrderId)
{
	new Controls.Dialog("/TourAgency/QuoteManage/CoustomerList.aspx?TourId=" + TourId+"&OrderId="+OrderId ,'游客名单',{width:800, height:480, minmize:'no',maximize:'no', scrollbars: 'yes',closebtn: 'yes'});
}

//查看公司信息
function ShowCompanyInfo(CompanyId,TendCompanyId)
{
	new Controls.Dialog("/TourAgency/SalesPromotion/CompanyInfo.aspx?CompanyId=" + CompanyId+"&TendCompanyId="+TendCompanyId ,'公司信息查看',{width:800, height:500, minmize:'no',maximize:'no', scrollbars: 'yes',closebtn: 'no'});
}
//修改话题信息
function ShowEditeTopicWindow(TopicId)
{
	new Controls.Dialog("/YunYing/TopicManage/EditeTopicInfo.aspx?TopicId=" +TopicId ,'修改话题信息',{width:800, height:480, minmize:'no',maximize:'no', scrollbars: 'yes',closebtn: 'yes'});
}
