
function addPro(){
var required_n=new Array('内含话费','价格','号码');
var required=new Array('txtMoney','txtPrice','txtMobiles');
for(i=0;i<required.length;i++){
if(g(required[i]).value.Trim()==''){
alert(required_n[i]+' 不能为空！');
g(required[i]).focus();
return;}}
if(!chkInt(getTextValue('txtMoney'))){
alert('话费只能输入0或正整数');
return;}
if(!chkInt(getTextValue('txtPrice'))){
alert('价格只能输入0或正整数');
return;}
var a=new Array();
//a=getTextValue('txtMobiles').split('\r\n');
var b=getTextValue('txtMobiles').replace(/\r\n/ig,',');
	b=b.replace(/\n/ig,',');
	b=b.replace(/\r/ig,',');	
	a=b.split(',');
for(i=0;i<a.length;i++){
if(!chkTel(a[i].Trim())){
var r=i+1;
alert('第'+r+'行的号码('+a[i]+')不正确！\n\r请输入11位手机号码或不含区号的7至8位固话号码,每行一个.');
return;}}
showObj('div_bt',0);showObj('div_loading',1);
var city=g('City').value;
var brand=g('selBrand').value;
var money=getTextValue('txtMoney');
var price=getTextValue('txtPrice');
var mobiles=new Array();
mobiles=a;//getTextValue('txtMobiles').split('\r\n');
var intro=getTextValue('txtIntro').replace(/\r\n/g,'<br/>');
var redo=getRadioValue('rbtType');
var province=g('Province').value;
var provinceName=getSelectedText('Province');
var cityName=getSelectedText('City');
var catName=getSelectedText('selBrand');
var re=COM._addPro(city,brand,money,price,mobiles,intro,redo,cityName,province,provinceName,catName).value;
var re0="<div class='re_bt'><input type='button' value='继续添加>>' class='formTable_submitBt' onclick='reAdd();' /></div>";
re=re0+"<div class='re_detail'><span><img src='/images/right_03.jpg'/>发布完成！</span><br/>"+re+"</div>";
g('txtMobiles').value="";
showObj('addTb',0);showObj('addResult',1);
g('addResult').innerHTML=re;}
function reAdd(){
showObj('div_bt',1);showObj('div_loading',0);
showObj('addTb',1);showObj('addResult',0);}
function txtHi(value){
if(value=="down"){
g('txtMobiles').rows=g('txtMobiles').rows+5;}
else{
if(g('txtMobiles').rows>=10){
g('txtMobiles').rows=g('txtMobiles').rows-5;}}}
function importPro(){
if(g('file').value.Trim()==""){alert('请选择文件');return;}
g("import_status").innerHTML=g('loadingImg').innerHTML;
showObj('import_form',0);showObj('import_status',1);
g('uploadform').submit();}
function callback(msg){
g("file").outerHTML=g("file").outerHTML;
var str="<div class='re_bt'><input type='button' value='再次导入>>' class='formTable_submitBt' onclick='redoImport();' /></div>";
g("import_status").innerHTML=str+msg;}
function redoImport(){
showObj('import_form',1);showObj('import_status',0);}
