function  isEmpty(value,msg) {
			if(Trim(value)=='') {
				alert("请输入"+msg);
				return true;
			}			
			return false;
}

function  isEmptys(value,msg,inmsg) {
			if(Trim(value)=='') {
				alert("请"+inmsg+msg);
				return true;
			}			
			return false;
}

function open300X350window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=250,top=200,height=300,width=350,resizable=no");
}

function open600X500window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=200,top=50,height=550,width=500,resizable=no");
}
function open600X600window(strFile,strTitle){//开窗(房源信息)
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=200,top=50,height=600,width=600,resizable=no");
}

function open800X700window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,left=200,top=50,height=660,width=700,resizable=no");
}





function open700X800window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=0,top=0,height=715,width=900,resizable=no");
}


function open600X800window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=0,top=0,height=600,width=800,resizable=no");
}

function open650X900window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=yes,toolbar=no,menubar=no,location=no,left=0,top=0,height=650,width=900,resizable=no");
}

function open650X800window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=0,top=0,height=650,width=800,resizable=no");
}
function open800X768window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,left=0,top=0,height=710,width=800,resizable=no");
}
function open600X700window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=0,top=0,height=600,width=700,resizable=no");
}

function open700X600window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=200,top=0,height=700,width=600,resizable=no");
}

function open500X600window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=200,top=100,height=500,width=600,resizable=no");
}

function open450X600window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=0,top=0,height=500,width=600,resizable=no");
}

function open550X700window(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=no,toolbar=no,menubar=no,location=no,left=0,top=0,height=550,width=700,resizable=no");
}


function isValidDecimal(theField)
{


	var inStr=theField;
	var inLen=inStr.length;

	if (inLen == 0)
		return true;
	if (inLen == 1 && inStr==" ")
		return false;
	for(var i=0; i< inLen; i++)
	{
		var ch = inStr.substring(i,i+1)
        if ((ch<"0" || ch>"9") && ch!="." && ch!="-")
		{
			if (ch != "")
				return false;
		}
    }
	return true;
/*
	if (isNaN(theField) || (theField.length == 0)){
	   return false;
	}
	else{
	  return true;
	}
		*/
}

function isPageNumber(msg,value) {	
if (value =="") {
	 alert(msg);
	 return false;	
	}	
if (!parseInt(value))
  {
    alert(msg);
	return false;     
  }
  totalPage = LblTotalPage.innerText;
  if (parseInt(totalPage) <  parseInt(value)) {
	alert('跳转页数不能大于总页数'+totalPage)
	theForm.TxtPage.value = "";
	return false;
  }
   return true;	
}
function popupWindow(strFile,strTitle){//开窗
 window.open(strFile,strTitle,"scrollbars=yes,toolbar=no,menubar=no,location=no,left=300,top=100,height=500,width=500,resizable=no");
}

function selectDate(sField){
/*
日期选择
*/
//var sValue=document.theForm(sField).value;//日期
var sValue= document.all(sField).value;
var sReturn=window.showModalDialog("../inc/calendar.aspx?sValue="+sValue,"asd",'dialogHeight:220px;dialogWidth:260px;status:no;help:no;');
if(sReturn!=""){
 document.all(sField).value=sReturn;
   }
}

function selectProduct(category){
/*
选择产品
*/
var sValue;

var sReturn=window.showModalDialog("../inc/selectProducts.aspx?category="+sValue,window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');
//if(sReturn=="ok"){
//    document.all("TxtCustName").value=window.TxtCustName;
//    document.all("TxtCustID").value=window.TxtCustID;
// }
}


/*
 *选择联系人   
*/
function selectContactList(custid)
{
    var id = document.theForm(custid).value;
    var sReturn=window.showModalDialog("../inc/selectContactList.aspx?id="+id,window,'dialogHeight:600px;dialogWidth:450px;status:no;help:no;');
    if(sReturn=="ok"){
        document.all("txtContactID").value=window.txtContactID;
        document.all("txtContactName").value=window.txtContactName;   
    }
}

function selectProductData()
{
  var sReturn=window.showModalDialog("../inc/selectProduct.aspx",window,'dialogHeight:500px;dialogWidth:600px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('HFProductID')!=null) {
        document.getElementById("HFProductID").value = window.HFProductID;
        }
    if (document.getElementById('ddlProductName')!=null) {
            document.getElementById("ddlProductName").options.length = 0;
            document.getElementById("ddlProductName").options.add(new Option(window.ddlProductName,window.HFProductID));
    }
    if (document.getElementById('HFCategoryID')!=null) {
            document.all("HFCategoryID").value=window.HFCategoryID;
    }
    if (document.getElementById('ddlProductCategory')!=null) {
            document.getElementById("ddlProductCategory").options.length = 0;
    document.getElementById("ddlProductCategory").options.add(new Option(window.ddlProductCategory,window.HFCategoryID));
    }
    if (document.getElementById('txtProductPrice')!=null) {
            document.all("txtProductPrice").innerText=window.txtProductPrice;
    }
 }
}

//选择部门
function selectDepartmentData()
{
  var sReturn=window.showModalDialog("../inc/selectDepartment.aspx",window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');

if(sReturn=="ok"){
    if (document.getElementById('HFDepartment')!=null) {
        document.getElementById("HFDepartment").value = window.HFDepartment;
        }
    if (document.getElementById('HFDepartmentName')!=null) {
        document.getElementById("HFDepartmentName").value = window.ddlDept;
        }
    if (document.getElementById('ddlDept')!=null) {
            document.getElementById("ddlDept").options.length = 0;
            document.getElementById("ddlDept").options.add(new Option(window.ddlDept,window.HFDepartment));
    }
 }
}

//选择部门和用户
function selectDepartmentAndUser()
{
  var sReturn=window.showModalDialog("../inc/SelectDepartmentAndUser.aspx",window,'dialogHeight:500px;dialogWidth:565px;status:no;help:no;');

if(sReturn=="ok"){//HFDepartment   ddlDepartment   HFUser    ddlUser  HFDepartmentName
    if (document.getElementById('HFDepartment')!=null) {
        document.getElementById("HFDepartment").value = window.thisDepartment;
        }
    if (document.getElementById('HFDepartmentName')!=null) {
        document.getElementById("HFDepartmentName").value = window.thisDepartmentName;
        }
    if (document.getElementById('ddlDepartment')!=null) {
            document.getElementById("ddlDepartment").options.length = 0;
            document.getElementById("ddlDepartment").options.add(new Option(window.thisDepartmentName,window.thisDepartmentName));
    }
    if (document.getElementById('HFUser')!=null) {
        document.getElementById("HFUser").value = window.thisUserID;
        }
    if (document.getElementById('HFUserName')!=null) {
        document.getElementById("HFUserName").value = window.thisUserName;
        }
    if (document.getElementById('ddlUser')!=null) {
            document.getElementById("ddlUser").options.length = 0;
            document.getElementById("ddlUser").options.add(new Option(window.thisUserName,window.thisUserName));
    }
 }
}


function selectSystemStyle()
{
  var sReturn=window.showModalDialog("../inc/selectSystemStyle.aspx",window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');

if(sReturn=="ok"){
    if (document.getElementById('HFSystemStyle')!=null) {
        document.getElementById("HFSystemStyle").value = window.systemStyleName;
        }
    if (document.getElementById('HFSystemStyleName')!=null) {
        document.getElementById("HFSystemStyleName").value = window.StyleShowName;
        }
    if (document.getElementById('ddlTheme')!=null) {
            document.getElementById("ddlTheme").options.length = 0;
            document.getElementById("ddlTheme").options.add(new Option(window.StyleShowName,window.systemStyleName));
    }
 }
}

function selectAreaInDropDownList()
{
  var sReturn=window.showModalDialog("../inc/SelectArea.aspx",window,'dialogHeight:500px;dialogWidth:570px;status:no;help:no;');

if(sReturn=="ok"){
    if (document.getElementById('HFProvince')!=null) {
        document.getElementById("HFProvince").value = window.ddlprovince;
        }
    if (document.getElementById('HFCity')!=null) {
        document.getElementById("HFCity").value = window.ddlcity;
        }
    if (document.getElementById('ddlprovince')!=null) {
            document.getElementById("ddlprovince").options.length = 0;
            document.getElementById("ddlprovince").options.add(new Option(window.ddlprovince,window.ddlprovince));
    }
    if (document.getElementById('ddlCity')!=null) {
            document.getElementById("ddlCity").options.length = 0;
            document.getElementById("ddlCity").options.add(new Option(window.ddlcity,window.ddlcity));
    }
 }
}

function selectCategoryData()
{
  var sReturn=window.showModalDialog("../inc/selectCategory.aspx",window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');

if(sReturn=="ok"){
    if (document.getElementById('HFCategory')!=null) {
        document.getElementById("HFCategory").value = window.HFCategory;
        }
    if (document.getElementById('HFCategoryName')!=null) {
        document.getElementById("HFCategoryName").value = window.ddlLastType;
        }
    if (document.getElementById('ddlLastType')!=null) {
            document.getElementById("ddlLastType").options.length = 0;
            document.getElementById("ddlLastType").options.add(new Option(window.ddlLastType,window.HFCategory));
    }
 }
}


function selectCategoryDataNotSelf()
{
  var sReturn=window.showModalDialog("../inc/selectCategoryForSystem.aspx",window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');

if(sReturn=="ok"){
    if (document.getElementById('HFCategory')!=null) {
        document.getElementById("HFCategory").value = window.HFCategory;
        }
    if (document.getElementById('HFCategoryName')!=null) {
        document.getElementById("HFCategoryName").value = window.ddlLastType;
        }
    if (document.getElementById('ddlLastType')!=null) {
            document.getElementById("ddlLastType").options.length = 0;
            document.getElementById("ddlLastType").options.add(new Option(window.ddlLastType,window.HFCategory));
    }
 }
}



function selectCustomerInfo(sField){
/*
客户选择
*/
var sReturn=window.showModalDialog("../inc/selectcustomer.aspx",window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){
document.theForm.txtCustName.value = window.TxtCustName;
document.theForm.txtCustID.value = window.TxtCustID;   
 }
}

function selectCustomerInfoForSentEmail(sField){
/*
客户选择(发通知)
*/
var sReturn=window.showModalDialog("../inc/selectCustomerForSentMail.aspx",window,'dialogHeight:650px;dialogWidth:900px;status:no;help:no;');
if(sReturn=="ok"){
document.getElementById("newShowCustomer").style.display="";//隐藏 
document.getElementById("updateShowCustomer").style.display="none";//隐藏 
var valueIDList = window.pageChooseID
var valueNameList = window.pageChooseName
var valueEmailList = window.pageChooseEmail
var arrID = valueIDList.split(",");
var arrName = valueNameList.split(",");
var arrEmail = valueEmailList.split(",");

var showTable = document.getElementById('ChooseCustomerTable');

for(var r = showTable.length-1;r>0;r--)
{
showTable.deleteRow(r);
}
var changColor = 'false';
for(var i = 0;i<arrID.length - 1;i++)
{
        var theTR = showTable.insertRow();
        theTR.setAttribute("height","22px");
        if(changColor == 'false')
        {
            changColor = 'true';
        }
        else
        {
        theTR.style.backgroundColor="#ffffff";
        changColor = 'false';
        }
        var theTDNameLeft = theTR.insertCell();
        theTDNameLeft.innerText = arrName[i];
        var theTDEmailLeft = theTR.insertCell();
        theTDEmailLeft.innerText = arrEmail[i];
}
showTable.length = arrID.length;
document.theForm.HFCustomerIDList.value = valueIDList;
document.theForm.HFCustomerEmailList.value = valueEmailList;
 }
}

function selectOpp(sField){
/*
相关机会选择选择
*/
var sValue= document.all(sField).value;
var sReturn=window.showModalDialog("../inc/selectOpportunity.aspx",window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){
    document.all("txtOpp").value=window.txtOpp;
    document.all("txtOppID").value=window.txtOppID;
 }
}



function selectContact(sField){
/*
联系人选择
*/
var sValue=document.theForm(sField).value;
var sReturn=window.showModalDialog("../inc/selectContact.aspx?sValue="+sValue,"contactWindow",'dialogHeight:580px;dialogWidth:550px;status:no;help:no;edge: Raised;');
//   window.open("../inc/selectContact.aspx","theForm","height=580px,width=550px,resizable = 0,location=no,toolbar = no,menubar = no,status=no,left =400,top = 0");
//alert(sReturn);
if(sReturn!="") {
	execScript(sReturn);
	//document.all(sField).value=sReturn;	
	} 
}



function selectLocation(sField){
/*
地理位置选择
*/
var sValue= document.all(sField).value;
var sReturn=window.showModalDialog("../inc/selectLocation.aspx",window,'dialogHeight:600px;dialogWidth:500px;status:no;help:no;');
if(sReturn=="ok"){
    document.all("txtLocationID").value=window.txtID;
    document.all("txtLocation").value=window.txtCountry;
    document.all("txtAreaNO").value=window.txtAreaNO;
    
}
}
function selectCity(sField){
/*
城市选择
*/
var sValue= document.all(sField).value;
var sReturn=window.showModalDialog("../inc/SelectCity.aspx",window,'dialogHeight:600px;dialogWidth:565px;status:no;help:no;');
if(sReturn=="ok"){
    document.all("txtLocationID").value=window.txtID;
    document.all("txtLocation").value=window.txtCountry;
    document.all("txtAreaNO").value=window.txtAreaNO;
    
}
}

function selectOrder(sField){
/*
相关订单选择
*/
var custID = document.all("TxtCustID").value;
var sValue= document.all(sField).value;
if(custID==null || custID=="")
{
alert('请选择客户');
}
else
{
var sReturn=window.showModalDialog("../inc/selectOrder.aspx?custID="+custID,window,'dialogHeight:600px;dialogWidth:408px;status:no;help:no;');

}
if(sReturn=="ok"){
    document.all("txtOrderID").value=window.txtOrderID;
//    document.all("txtOrderCustName").value = window.txtOrderCustName;
//    document.all("txtOrder").value=window.txtOrder;
    
}
}


///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal300X300(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:300px;dialogWidth:310px;status:no;help:no;edge:Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
window.location.href = unescape(window.location.href);
}
}

///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal500X500(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:500px;dialogWidth:500px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}

///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal450X600(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:450px;dialogWidth:610px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}

///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal600X600(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:600px;dialogWidth:610px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}

///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal800X700(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:800px;dialogWidth:708px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}

///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal600X800(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:600px;dialogWidth:800px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}
///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal500X600(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:500px;dialogWidth:600px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}

///打开一个窗口,sValue指定是否刷新这个源窗口
function showPrinModalPrint(sFile,refreshed){
//var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:800px;dialogWidth:790px;status:no;help:no;edge: Raised;");
window.open(sFile,"","scrollbars=yes,toolbar=no,menubar=no,location=no,left=130,top=10,height=650,width=805,resizable=no");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
//if((refreshed)&&(sReturn=='Refresh')) {
 // window.location.href = unescape(window.location.href);

}
///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal650X900(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:650px;dialogWidth:900px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}


///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal600X700(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:600px;dialogWidth:708px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}

///打开一个窗口,sValue指定是否刷新这个源窗口
function showModal800X768(sFile,refreshed){
var sReturn=window.showModalDialog(sFile,"popUp","dialogHeight:700px;dialogWidth:850px;status:no;help:no;edge: Raised;");
//如果sReturn返回'Refresh'和refreshed为直,刚Refreshpage
if((refreshed)&&(sReturn=='Refresh')) {
  window.location.href = unescape(window.location.href);
}
}

//选择Location，DropDownList形式
    function selectLocationInDropDownList(LocationValues)
    {
        var sourceArray = new Array(3);
        sourceArray = LocationValues.split(',');
        var MyObj = new Object();
        MyObj.sourceCountry = sourceArray[0];
        MyObj.sourceProvince = sourceArray[1];
        MyObj.sourceCity = sourceArray[2];
        var sReturn=window.showModalDialog("../inc/selectLocationInDropDownList.aspx",MyObj,'dialogHeight:200px;dialogWidth:400px;status:no;help:no;');    
        if(sReturn=="ok"){
        document.all("txtCountry").value=MyObj.txtCountry;
        document.all("txtProvince").value=MyObj.txtProvince;
        document.all("txtCity").value=MyObj.txtCity;
        }
    }
    
//选择DeptUser，DropDownList形式
    function selectDeptUserInDropDownList()
    {
        var deptID = document.all("txtDeptID").value;
        var userID = document.all("txtUserID").value;
        var MyObj = new Object();
        var sReturn=window.showModalDialog("../inc/selectDeptUserInDropDownList.aspx?deptID="+deptID + '&userID='+userID,MyObj,'dialogHeight:200px;dialogWidth:400px;status:no;help:no;');    
       
        if(sReturn=="ok"){
        document.all("txtDeptID").value=MyObj.txtDeptID;
        document.all("txtUserID").value=MyObj.txtUserID;
        document.all("txtDept").value=MyObj.txtDept;
        document.all("txtUser").value=MyObj.txtUser;        
        }
    }
    
    //ShortCut For SelectTopic
    function selectTopic(tableName , ctlID)
    {
        var sReturn=window.showModalDialog("../inc/selectTopic.aspx?tableName="+tableName,window,'dialogHeight:300px;dialogWidth:350px;status:no;help:no;');
        if(sReturn=="ok")
        {
            document.getElementById(ctlID).value=window.chosenValue;    
        }
    }
    
    //SelectTimeMode for Analysis
    function SelectTimeMode(mode)
    {
        
        var d = new Date();
        var startdate = "";
        var enddate = "";
        var sCtl = document.getElementById("txtStartDate");
        var eCtl = document.getElementById("txtEndDate");
        
        enddate = d.getYear() + "-";
        if(d.getMonth() < 9)
        {            
            enddate += "0";
        }
        enddate += (d.getMonth()+1) + "-";
        if(d.getDate() < 10)
        {
            enddate += "0";
        }
        enddate += d.getDate();
        
        if(mode=="0") //this Yeah
        {
            startdate = d.getYear() + "-01-01";
           
        }        
        if(mode=="1") // this Month
        {
            startdate = d.getYear() + "-";
            if((d.getMonth() + 1).toString().length == 1)
            {
                startdate += "0";
            }
            startdate += (d.getMonth()+1) + "-01";           
        }
        if(mode=="2" || mode=="3") // All Data & Customer Date
        {
            var enddate = "";
        }
        sCtl.value = startdate;
        eCtl.value = enddate;
    }
    
    
function selectSO(){
/*
选择SO数据
*/
var sReturn=window.showModalDialog("../inc/SelectSOData.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('Tabs_BasicPanel_TxtSONo')!=null) {
        document.getElementById("Tabs_BasicPanel_TxtSONo").value = window.chooseSONO;
        }
    if (document.getElementById('Tabs_BasicPanel_TxtBOM')!=null) {
            document.all("Tabs_BasicPanel_TxtBOM").value=window.chooseBOMNO;
    }
    if (document.getElementById('Tabs_BasicPanel_TxtModelCode')!=null) {
            document.all("Tabs_BasicPanel_TxtModelCode").value=window.chooseMachineTypeDesc;
    }
 }
}


function selectVendor(thisCode){
var sReturn=window.showModalDialog("../inc/SelectVendor.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
        document.getElementById(thisCode).value = window.chooseVendorCode;
 }
}


function SelectPartValue(){
/*
选择零件
*/
var sReturn=window.showModalDialog("../inc/SelectPart.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('theTabCon_theTabPanMat_txtMatInvoiceNO')!=null) {
        document.getElementById("theTabCon_theTabPanMat_txtMatInvoiceNO").value = window.chooseInvoiceCode;
        }
    if (document.getElementById('theTabCon_theTabPanMat_txtMatNO')!=null) {
            document.all("theTabCon_theTabPanMat_txtMatNO").value=window.choosePartCode;
    }
    if (document.getElementById('theTabCon_theTabPanMat_txtSequenceNumber')!=null) {
            document.all("theTabCon_theTabPanMat_txtSequenceNumber").value=window.choosePartSN;
    }
    if (document.getElementById('theTabCon_theTabPanMat_txtMatname')!=null) {
            document.all("theTabCon_theTabPanMat_txtMatname").value=window.choosePartName;
    }
    if (document.getElementById('theTabCon_theTabPanMat_txtMatPrice')!=null) {
            document.all("theTabCon_theTabPanMat_txtMatPrice").value=window.choosePrice;
    }
 }
}

function selectMachineSN(){
/*
选择机器序列号chooseModelID
*/
var sReturn=window.showModalDialog("../inc/selectMachineSN.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('txtMachineSN')!=null) {
        document.getElementById("txtMachineSN").value = window.chooseMachineSN;
        document.getElementById("txtModelID").value = window.chooseModelID;
        }
 }
}


function selectCustomer(){
/*
客户选择
*/
var sReturn=window.showModalDialog("../inc/selectCustomer.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('txtCustomerCode')!=null) {
        document.getElementById("txtCustomerCode").value = window.chooseCustomerCode;
        }
    if (document.getElementById('txtCustomerName')!=null) {
            document.all("txtCustomerName").value=window.chooseCustomerName;
    }
    if (document.getElementById('txtAgentCode')!=null) {
            document.all("txtAgentCode").value=window.chooseAgentCode;
    }
    if (document.getElementById('txtAgentName')!=null) {
            document.all("txtAgentName").value=window.chooseAgentName;
    }
    if (document.getElementById('txtustomerAddress')!=null) {
            document.all("txtustomerAddress").value=window.chooseAddress;
    }
    if (document.getElementById('txtustomerContact')!=null) {
            document.all("txtustomerContact").value=window.choosecontact;
    }
    if (document.getElementById('txtustomerPhone')!=null) {
            document.all("txtustomerPhone").value=window.choosephone;
    }
    if (document.getElementById('txtustomerFax')!=null) {
            document.all("txtustomerFax").value=window.chooseFax;
    }
      if (document.getElementById('txtustomerPostCode')!=null) {
         document.all("txtustomerPostCode").value=window.choosePostCode;
    }
      if (document.getElementById('txtustomerMachineType')!=null) {
         document.all("txtustomerMachineType").value=window.chooseMachineType;
    }
      if (document.getElementById('txtustomerMachineAmount')!=null) {
         document.all("txtustomerMachineAmount").value=window.chooseMachineAmount;
    }
 }
}



function selectMachineInfo(){
/*
选择机器信息(包括客户信息)
*/
var sReturn=window.showModalDialog("../inc/selectMachineInfo.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('theTabCon_theTabPanBasic_txtMachineSN')!=null) {
        document.getElementById("theTabCon_theTabPanBasic_txtMachineSN").value = window.chooseMachineSN;
        }
    if (document.getElementById('theTabCon_theTabPanBasic_txtMachineSN')!=null) {
        document.getElementById("theTabCon_theTabPanBasic_txtModelID").value = window.chooseModelID;
        }
    if (document.getElementById('theTabCon_theTabPanBasic_txtBOMNo')!=null) {
            document.all("theTabCon_theTabPanBasic_txtBOMNo").value=window.chooseBOMNO;
    }
    if (document.getElementById('theTabCon_theTabPanBasic_txtOriEngineNO')!=null) {
            document.all("theTabCon_theTabPanBasic_txtOriEngineNO").value=window.chooseEngineNO;
    }
    if (document.getElementById('theTabCon_theTabPanBasic_txtOriEngineSN')!=null) {
            document.all("theTabCon_theTabPanBasic_txtOriEngineSN").value=window.chooseEngineSN;
    }
    if (document.getElementById('theTabCon_theTabPanBasic_txtCustomerCode')!=null) {
            document.all("theTabCon_theTabPanBasic_txtCustomerCode").value=window.choosecustCode;
    }
    if (document.getElementById('theTabCon_theTabPanBasic_txtCustomerName')!=null) {
            document.all("theTabCon_theTabPanBasic_txtCustomerName").value=window.choosecustName;
    }
      if (document.getElementById('theTabCon_theTabPanBasic_txtRcvContact')!=null) {
         document.all("theTabCon_theTabPanBasic_txtRcvContact").value=window.choosecontact;
    }
      if (document.getElementById('theTabCon_theTabPanBasic_txtRcvPhone')!=null) {
         document.all("theTabCon_theTabPanBasic_txtRcvPhone").value=window.choosephone;
    }
      if (document.getElementById('theTabCon_theTabPanBasic_txtAddress')!=null) {
         document.all("theTabCon_theTabPanBasic_txtAddress").value=window.chooseAddress;
    }
      if (document.getElementById('theTabCon_theTabPanBasic_txtRcvPostCode')!=null) {
         document.all("theTabCon_theTabPanBasic_txtRcvPostCode").value=window.choosePostCode;
    }
      if (document.getElementById('theTabCon_theTabPanBasic_txtAgentCode')!=null) {
         document.all("theTabCon_theTabPanBasic_txtAgentCode").value=window.chooseagentCode;
    }
      if (document.getElementById('theTabCon_theTabPanBasic_txtAgentName')!=null) {
         document.all("theTabCon_theTabPanBasic_txtAgentName").value=window.chooseagentName;
    }
      if (document.getElementById('txtCustomerName')!=null) {
         document.all("txtCustomerName").value=window.choosecustName;
    }
    if (document.getElementById('txtMachineSN')!=null) {
        document.getElementById("txtMachineSN").value = window.chooseMachineSN;
        }
 }
}



function SelectClaimsInfo(){
/*
选择理赔单信息chooseAgentCode  chooseCustomerCode
*/
var sReturn=window.showModalDialog("../inc/SelectClaimsInfo.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('theTabCon_TabPanBasic_txtClaimsNO')!=null) {
        document.getElementById("theTabCon_TabPanBasic_txtClaimsNO").value = window.chooseClaimsNO;
        }
    if (document.getElementById('theTabCon_TabPanBasic_txtCustomerCode')!=null) {
        document.getElementById("theTabCon_TabPanBasic_txtCustomerCode").value = window.chooseCustomerCode;
        }
    if (document.getElementById('theTabCon_TabPanBasic_txtCustomer')!=null) {
        document.getElementById("theTabCon_TabPanBasic_txtCustomer").value = window.chooseCustomerName;
        }
    if (document.getElementById('theTabCon_TabPanBasic_txtAgentCode')!=null) {
        document.getElementById("theTabCon_TabPanBasic_txtAgentCode").value = window.chooseAgentCode;
        }
    if (document.getElementById('theTabCon_TabPanBasic_txtAgentName')!=null) {
        document.getElementById("theTabCon_TabPanBasic_txtAgentName").value = window.chooseAgentName;
        }
    if (document.getElementById('theTabCon_TabPanBasic_txtMachineSN')!=null) {
        document.getElementById("theTabCon_TabPanBasic_txtMachineSN").value = window.chooseMachineSN;
        }
    if (document.getElementById('theTabCon_TabPanBasic_txtMachineNo')!=null) {
        document.getElementById("theTabCon_TabPanBasic_txtMachineNo").value = window.chooseModelID;
        }
 }
}

function selectAgentData(){
/*
选择代理商
*/
var sReturn=window.showModalDialog("../inc/selectAgentData.aspx",window,'dialogHeight:650px;dialogWidth:860px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('txtAgentCode')!=null) {
        document.getElementById("txtAgentCode").value = window.chooseAgentCode;
        }
    if (document.getElementById('txtAgentName')!=null) {
        document.getElementById("txtAgentName").value = window.chooseAgentName;
        }
    if (document.getElementById('txtArea')!=null) {
        document.getElementById("txtArea").value = window.chooseArea;
        }
 }
}




function selectCountySectionFromBG(){
/*
后台管理使用
选择城市，区县，片区
*/
var sReturn=window.showModalDialog("../../inc/selectCountySection.aspx",window,'dialogHeight:480px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('HFCity')!=null) {
        document.getElementById("HFCity").value = window.chooseCityID;
        }
    if (document.getElementById('HFCityName')!=null) {
        document.getElementById("HFCityName").value = window.chooseCityName;
        }  
    if (document.getElementById('HFCounty')!=null) {
        document.getElementById("HFCounty").value = window.chooseCountyID;
        }
    if (document.getElementById('HFCountyName')!=null) {
        document.getElementById("HFCountyName").value = window.chooseCountyName;
        }  
    if (document.getElementById('HFCountySection')!=null) {
        document.getElementById("HFCountySection").value = window.chooseCountySectionID;
        }  
    if (document.getElementById('HFCountySectionName')!=null) {
        document.getElementById("HFCountySectionName").value = window.chooseCountySectionName;
        }        
    /*
    显示城市+区县+片区
    */
    if (document.getElementById('txtArea')!=null) {
        document.getElementById("txtArea").value = chooseAllName;
        }
 }
}

function selectCountySection(){
/*
选择城市，区县，片区
*/
var sReturn=window.showModalDialog("../inc/selectCountySection.aspx",window,'dialogHeight:480px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('ctl00$ContentPlaceHolder1$HFCity')!=null) {
        document.getElementById("ctl00$ContentPlaceHolder1$HFCity").value = window.chooseCityID;
        }
    if (document.getElementById('ctl00$ContentPlaceHolder1$HFCityName')!=null) {
        document.getElementById("ctl00$ContentPlaceHolder1$HFCityName").value = window.chooseCityName;
        }  
    if (document.getElementById('ctl00$ContentPlaceHolder1$HFCounty')!=null) {
        document.getElementById("ctl00$ContentPlaceHolder1$HFCounty").value = window.chooseCountyID;
        }
    if (document.getElementById('ctl00$ContentPlaceHolder1$HFCountyName')!=null) {
        document.getElementById("ctl00$ContentPlaceHolder1$HFCountyName").value = window.chooseCountyName;
        }  
    if (document.getElementById('ctl00$ContentPlaceHolder1$HFCountySection')!=null) {
        document.getElementById("ctl00$ContentPlaceHolder1$HFCountySection").value = window.chooseCountySectionID;
        }  
    if (document.getElementById('ctl00$ContentPlaceHolder1$HFCountySectionName')!=null) {
        document.getElementById("ctl00$ContentPlaceHolder1$HFCountySectionName").value = window.chooseCountySectionName;
        }        
    /*
    显示城市+区县+片区
    */
    if (document.getElementById('ctl00$ContentPlaceHolder1$txtArea')!=null) {
        document.getElementById("ctl00$ContentPlaceHolder1$txtArea").value = chooseAllName;
        }
 }
}


function selectCountySectionwithRegister(){
/*
选择城市，区县，片区
*/
var sReturn=window.showModalDialog("../inc/selectCountySection.aspx",window,'dialogHeight:480px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('ctl00$cpMainBody$HFCity')!=null) {
        document.getElementById("ctl00$cpMainBody$HFCity").value = window.chooseCityID;
        }
    if (document.getElementById('ctl00$cpMainBody$HFCityName')!=null) {
        document.getElementById("ctl00$cpMainBody$HFCityName").value = window.chooseCityName;
        }  
    if (document.getElementById('ctl00$cpMainBody$HFCounty')!=null) {
        document.getElementById("ctl00$cpMainBody$HFCounty").value = window.chooseCountyID;
        }
    if (document.getElementById('ctl00$cpMainBody$HFCountyName')!=null) {
        document.getElementById("ctl00$cpMainBody$HFCountyName").value = window.chooseCountyName;
        }  
    if (document.getElementById('ctl00$cpMainBody$HFCountySection')!=null) {
        document.getElementById("ctl00$cpMainBody$HFCountySection").value = window.chooseCountySectionID;
        }  
    if (document.getElementById('ctl00$cpMainBody$HFCountySectionName')!=null) {
        document.getElementById("ctl00$cpMainBody$HFCountySectionName").value = window.chooseCountySectionName;
        }        
    /*
    显示城市+区县+片区
    */
    if (document.getElementById('ctl00$cpMainBody$txtArea')!=null) {
        document.getElementById("ctl00$cpMainBody$txtArea").value = chooseAllName;
        }
 }
}

function selectDectAll(){
/*
选择城市，区县，片区,字段跟名称
*/
var sReturn=window.showModalDialog("../../inc/selectDectAll.aspx",window,'dialogHeight:480px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('HFID')!=null) {
        document.getElementById("HFID").value = window.chooseID;
        }
    if (document.getElementById('txtAreaName')!=null) {
        document.getElementById("txtAreaName").value = window.chooseName;
        }
 }
}


function SelectLoginID(){
/*
联系人
*/
var sReturn=window.showModalDialog("../inc/SelectLoginID.aspx",window,'dialogHeight:480px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){   
    if (document.getElementById('txtSendMen')!=null) {
        document.getElementById("txtSendMen").value = window.checkname;
        }
 }
}



function selectCounty(){
/*
选择城市，区县
*/
var sReturn=window.showModalDialog("../inc/selectCounty.aspx",window,'dialogHeight:480px;dialogWidth:408px;status:no;help:no;');
if(sReturn=="ok"){
    if (document.getElementById('HFCityID')!=null) {
        document.getElementById("HFCityID").value = window.chooseCityID;
        }
    if (document.getElementById('HFCountyID')!=null) {
        document.getElementById("HFCountyID").value = window.chooseCountyID;
        }     
    /*
    显示城市+区县
    */
    if (document.getElementById('txtAreaName')!=null) {
        document.getElementById("txtAreaName").value = chooseCountyName;
        }
 }
}
/*
站内短信
*/
 function newMsg()
 {
  window.open("msg/newMsg.aspx","发送短信","scrollbars=no,toolbar=no,menubar=no,location=no,left=180,top=145,height=400,width=600,resizable=no");
 }

function selectHouseDictionary(){
/*
选择楼盘
*/
var sReturn=window.showModalDialog("../inc/selectHouseDictionary.aspx",window,'dialogHeight:600px;dialogWidth:840px;status:no;help:no;');
if(sReturn=="ok"){

   
    if (document.getElementById('HFCityID')!=null) {
        document.getElementById("HFCityID").value = window.chooseCityID;
        }
    if (document.getElementById('txtCity')!=null) {
        document.getElementById("txtCity").value = window.choosecityName;
        }
    if (document.getElementById('HFCountyID')!=null) {
        document.getElementById("HFCountyID").value = window.chooseCoutryID;
        }
    if (document.getElementById('txtCounty')!=null) {
        document.getElementById("txtCounty").value = window.choosecountyName;
        }
    if (document.getElementById('HFCountySectionID')!=null) {
        document.getElementById("HFCountySectionID").value = window.chooseSectionID;
        }
    if (document.getElementById('txtCountySection')!=null) {
        document.getElementById("txtCountySection").value = window.choosecountySectionName;
        }
    if (document.getElementById('txtHouseName')!=null) {
        document.getElementById("txtHouseName").value = window.chooseNames;
        }
    if (document.getElementById('txtRidgepoleQty')!=null) {
        document.getElementById("txtRidgepoleQty").value = window.chooseRidgepoleQty;
        }
    if (document.getElementById('txtFloorQty')!=null) {
        document.getElementById("txtFloorQty").value = window.chooseFloorQty;
        }
    if (document.getElementById('txtAddress')!=null) {
        document.getElementById("txtAddress").value = window.chooseaddress;
        }
    if (document.getElementById('HFHouseDictionaryID')!=null) {
        document.getElementById("HFHouseDictionaryID").value = window.chooseID;
        }
    if (document.getElementById('txtAreaName')!=null) {
        document.getElementById("txtAreaName").value = window.choosecityName + window.choosecountyName + window.choosecountySectionName;
        }
 }
}