var xmlHttp

function showOwner(str, box, thisForm, autoSubmit ,mode)//顯示愛心人士cnr_signup.asp
{
if (str.length==0)
  { 
  document.getElementById("showOwner").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("您的瀏灠器不支援AJAX。");
  return;
  } 
var url="clienthint_owner.asp";
url=url+"?q=" +  encodeURIComponent(str);
url=url+"&mode="+mode;
url=url+"&b="+box;
url=url+"&f="+thisForm;
url=url+"&a="+autoSubmit;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateshowOwner;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateshowOwner() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("showOwner").innerHTML=xmlHttp.responseText;
}
}




function showVet(str, box, thisForm, autoSubmit ,mode)//顯示愛心人士cnr_signup.asp
{
if (str.length==0)
  { 
  document.getElementById("showVet").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("您的瀏灠器不支援AJAX。");
  return;
  } 
var url="clienthint_vet.asp";
url=url+"?q=" +  encodeURIComponent(str);
url=url+"&mode="+mode;
url=url+"&b="+box;
url=url+"&f="+thisForm;
url=url+"&a="+autoSubmit;
url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateshowVet;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function stateshowVet() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("showVet").innerHTML=xmlHttp.responseText;
}
}


function setTextVet(thisText,thisBox,thisForm,autoSubmit,inName,inNickName,CNR_VetHospital){
	document.getElementById(thisBox).value = thisText;
	document.getElementById('showVet').innerHTML='';
	document.getElementById('CNR_VetID').value=thisText;
	document.getElementById('CNR_Vet').value=inName;
	document.getElementById('CNR_VetNick').value=inNickName;
	document.getElementById('CNR_VetHospital').value=CNR_VetHospital;
}


function showHint1(str, box, thisForm, autoSubmit)
{
if (str.length==0)
  { 
  document.getElementById("txtHint1").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("您的瀏灠器不支援AJAX。");
  return;
  } 
var url="clienthint_depart.asp";
url=url+"?q="+str;
url=url+"&b="+box;
url=url+"&f="+thisForm;
url=url+"&a="+autoSubmit;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 

function showHint2(str, box, thisForm, autoSubmit)
{
if (str.length==0)
  { 
  document.getElementById("txtHint2").innerHTML="";
  RRR(str);
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("您的瀏灠器不支援AJAX。");
  return;
  } 
var url="clienthint_topic.asp";
url=url+"?q="+str;
url=url+"&b="+box;
url=url+"&f="+thisForm;
url=url+"&a="+autoSubmit;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
} 


function stateChanged1() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint1").innerHTML=xmlHttp.responseText;
}
}





function stateChanged2() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("txtHint2").innerHTML=xmlHttp.responseText;
}
}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

function setTextBox(thisText,thisBox,thisForm,autoSubmit){
	document.getElementById(thisBox).value = thisText
}

function setTextOwner(thisText,thisID,thisBox,thisForm,autoSubmit,inName,inNickName,inTel,inTel2,inAddress,inMail,inFB,inBirthday,inPS,inlover,inBlack){
	document.getElementById(thisBox).value = thisText;
	//document.getElementById('showOwner').innerHTML='';
	document.getElementById('CNR_Owner_PID').value=thisText;
	document.getElementById('CNR_Owner_ID').value=thisID;
	document.getElementById('CNR_Owner_Name').value=inName;
	document.getElementById('CNR_Owner_NickName').value=inNickName;
	document.getElementById('CNR_Owner_Tel').value=inTel;
	document.getElementById('CNR_Owner_Tel2').value=inTel2;
	document.getElementById('CNR_Owner_Address').value=inAddress;
	document.getElementById('CNR_Owner_Mail').value=inMail;
	document.getElementById('CNR_Owner_FB').value=inFB;
	document.getElementById('CNR_Owner_Birthday').value=inBirthday;
	document.getElementById('CNR_Owner_PS').value=inPS;
	if (inlover==1)
{ 
	document.getElementById('CNR_Owner_Lover').checked=true;
}else
{ 	document.getElementById('CNR_Owner_Lover').checked=false;
}
	if (inBlack==1)
{ 
	document.getElementById('CNR_Owner_Black').checked=true;
}else
{ 	document.getElementById('CNR_Owner_Black').checked=false;
}
}

