var qswhU2GB=[];//Unicode和GB的对应表，略
var qswhSpell=[];//拼音的对照表，略

function UrlEncode(str){
 var i,c,ret="",strSpecial="!\"#$%&'()*+,/:;<=>?@[\]^`{|}~%";
 for(i=0;i<str.length;i++){
  if(str.charCodeAt(i)>=0x4e00){
   c=qswhU2GB[str.charCodeAt(i)-0x4e00];
   ret+="%"+c.slice(0,2)+"%"+c.slice(-2);
  }
  else{
   c=str.charAt(i);
   if(c==" ")
    ret+="+";
   else if(strSpecial.indexOf(c)!=-1)
    ret+="%"+str.charCodeAt(i).toString(16);
   else
    ret+=c;
  }
 }
 return ret;
}

function getSpell(str,sp){
 var i,c,t,ret="";
 if(sp==null)sp="";
 for(i=0;i<str.length;i++){
  if(str.charCodeAt(i)>=0x4e00){
   c=parseInt(qswhU2GB[str.charCodeAt(i)-0x4e00],16);
   if(c<55290){
    for(t=qswhSpell.length-1;t>0;t=t-2)if(qswhSpell[t]<=c)break;
    if(t>0)ret+=qswhSpell[t-1]+sp;
   }
  }
 }
 return ret.substr(0,ret.length-sp.length);
}
function PostQuestion(){
	cid=document.getElementById("Q_class");
	title=document.getElementById("Q_title");
	Qname=document.getElementById("Q_name");
	telphone=document.getElementById("Q_telphone");
	company=document.getElementById("Q_company");
	note=document.getElementById("Q_note");
	if(title.value==""){alert("录入错误");title.focus();}
	else{
	Url=""
	//
	var DIV1="#DivQuestion";
	var URL1=Server+"remote/Question.aspx?cid="+cid.value+"&title="+encodeURIComponent(title.value)+"&name="+encodeURIComponent(Qname.value)+"&telphone="+encodeURIComponent(telphone.value)+"&company="+encodeURIComponent(company.value)+"&note="+encodeURIComponent(note.value);
	REQUEST(URL1,DIV1);
	title.value="";
	Qname.value="";
	telphone.value="";
	company.value="";
	note.value="";
	//
	var DIV2="#DivArticleList";
	var URL2=Server+"remote/QuestionList.aspx";
	REQUEST(URL2,DIV2);
	//
	}
}
function closeQ(){
	Div=document.getElementById("DivQuest");
	Div.style.display='none';
	}
