﻿
function CheckUserInput(showba)
{var tbOtherHopes=$(EnglishInputClientIDs.tbWishes);if(tbOtherHopes.value.trim()==HOPE_PROMPT)
{tbOtherHopes.value="";}
var xingShi=$(EnglishInputClientIDs.tbXing).value.trim();var name=$(EnglishInputClientIDs.tbMing).value.trim();if(xingShi!=""&&checkIsChinese(xingShi)==false)
{alert("姓氏必须是中文汉字，请重新输入。");return;}
if(name!=""&&checkIsChinese(name)==false)
{alert("姓名必须是中文汉字，请重新输入。");return;}
if(showba==undefined||showba)
{if(IsModification==false)
{ShowProgressBar_1($("btSubmit"),0);}
else
{try
{ShowProgressBar_1($("btSubmit"),0,"true");}
catch(e)
{}}}
try
{document.getElementById("imgVisitorStat").src=document.getElementById("imgVisitorStat").src+"?rand="+Math.random();}
catch(e)
{}
var postID;var r=/javascript\:__doPostBack\(["|'](.*)["|'],/g;var re=r.exec($(EnglishInputClientIDs.lbtSubmit).href);if(re!=null)
{postID=re[1];}
else
{postID=EnglishInputClientIDs.lbtSubmit.replace(/\_/g,"$");}
__doPostBack(postID,"");}
function AjustIframParentSize()
{try
{if(!IsModification)
{return;}
var bar=parent.$("modiDialog");var barHolder=parent.$("modiHolder");parent.$("iframeModifyParam").height=document.documentElement.scrollHeight+50;parent.$("iframeModifyParam").width=document.documentElement.scrollWidth;bar.height=document.documentElement.scrollHeight+50;bar.width=document.documentElement.scrollWidth;barHolder.height=document.documentElement.scrollHeight+50;barHolder.width=document.documentElement.scrollWidth;}
catch(e)
{}}
function CloseParentWindow()
{try
{parent.$('modiDialog').style.display='none';parent.$('modiAllbody').style.display='none';}
catch(e)
{}}
document.body.onkeydown=function(event)
{if(!event)
{event=window.event;}
var isMSIE=(navigator.appName=="Microsoft Internet Explorer");try
{if(!IsModification)
{return;}
if(isMSIE)
{if(event.keyCode==8)
{if(event.srcElement.tagName.toLowerCase()!="input"&&event.srcElement.tagName.toLowerCase()!="textarea")
{return false;}}}
else
{if(event.keyCode==8)
{if(event.target.tagName.toLowerCase()!="input"&&event.target.tagName.toLowerCase()!="textarea")
{event.preventDefault();event.stopPropagation();}}}}
catch(e)
{}}
var HOPE_PROMPT="请输入表达您愿望的词汇。(50个字符以内)";window.onload=function()
{try
{OnHopesTextBoxBlur();var tbOtherHopes=$(EnglishInputClientIDs.tbWishes);tbOtherHopes.onfocus=function()
{if(tbOtherHopes.value.trim()==HOPE_PROMPT)
{tbOtherHopes.style.color="#000000";tbOtherHopes.value="";}}
tbOtherHopes.onblur=OnHopesTextBoxBlur;if(IsBaiduApp==undefined||!IsBaiduApp)
{$(EnglishInputClientIDs.tbXing).onfocus=PickXingShi;}
if(IsModification)
{AjustIframParentSize();}}
catch(e)
{}}
function OnHopesTextBoxBlur()
{var tbOtherHopes=$(EnglishInputClientIDs.tbWishes);if(tbOtherHopes.value.trim()=="")
{tbOtherHopes.style.color="gray";tbOtherHopes.value=HOPE_PROMPT;}}
function PickXingShi()
{try
{InitQueryCode(EnglishInputClientIDs.tbXing,"PickItemDiv");isXingShi=true;if(curIndex==undefined||curIndex==null||curIndex==-1)
{curIndex="a";showQueryDiv(xingShi["a"],80,1,17);}
else
{showQueryDiv(xingShi[curIndex],80,1,17);}
AjustIframParentSize();}
catch(e)
{}}
try
{var oldBodyClickFunction=document.body.onclick;document.body.onclick=function(event)
{try
{if(oldBodyClickFunction!=undefined&&oldBodyClickFunction!=null)
{oldBodyClickFunction(event);}}
catch(e)
{}
if(!event)
{event=window.event;}
var isMSIE=(navigator.appName=="Microsoft Internet Explorer");try
{if(isMSIE)
{if(event.srcElement.id!=queryField.id&&IsTheSonOf(event.srcElement,"PickItemDiv")==false)
{showDiv(false);}}
else
{if(event.target.id!=queryField.id&&IsTheSonOf(event.target,"PickItemDiv")==false)
{showDiv(false);}}}
catch(e)
{}}}
catch(e)
{}
var needAnalyze=true;function AnalyzeName(name,evt)
{if(needAnalyze==false&&name.length<=2)
{return;}
if(!evt&&window.event)
{evt=window.event;}
if(checkIsChinese(name)==false)
{return false;}
var xing="";var ming="";if(name.length==1)
{return;}
if(name.length>=2&&name.length<=3)
{var maxXing=name.substring(0,2);var minXing=name.substring(0,1);var alpha="abcdefghjklmnopqrstwxyz";var containsMaxXing=false;var containsMinXing=false;for(var i=0;i<alpha.length;++i)
{var temp=xingShi[alpha.charAt(i).toString()];if(temp)
{for(var j=0;j<temp.length;++j)
{if(temp[j]==maxXing)
{containsMaxXing=true;}
if(temp[j]==minXing)
{containsMinXing=true;}
if(containsMaxXing&&containsMinXing)
{break;}}}
if(containsMaxXing&&containsMinXing)
{break;}}
if(containsMaxXing)
{xing=maxXing;ming=name.substring(xing.length,4);}
else
{xing=minXing;ming=name.substring(xing.length,4);}}
else if(name.length==4)
{xing=name.substring(0,2);ming=name.substring(2,4);}
if(xing!="")
{$(EnglishInputClientIDs.tbXing).value=xing;}
if(ming!="")
{$(EnglishInputClientIDs.tbMing).value=ming;needAnalyze=false;}}
function AutoCopyName(name)
{if(checkIsChinese(name)==false)
{return false;}
if(name.length==2)
{$(EnglishInputClientIDs.tbXing).value=name.substring(0,1);$(EnglishInputClientIDs.tbMing).value=name.substring(1,4);}}
function SetSampleWishes(wish)
{var tbOtherHopes=$(EnglishInputClientIDs.tbWishes);tbOtherHopes.style.color="#000000";if(tbOtherHopes.value.trim()==HOPE_PROMPT)
{tbOtherHopes.value="";}
wish=wish.trim();if(tbOtherHopes.value.indexOf(wish)==-1)
{tbOtherHopes.value+=" "+wish;}
tbOtherHopes.value=tbOtherHopes.value.trim();}
