var TotalSendPriceSefareshi;
var TotalSendPricePishtaz;
function GetsendPrice(Weight ,numExtraPrice ,strBuyerCityPreTelCode ,strBuyerPostCenter,numKhadamatPrice)
{
   var numBaseSendPriceSefareshi ;
   var numBaseSendPricePishtaz ;
   var numCODPrice ;
   var numBimehPrice ;
   var numMagharPrice ;
   var numListPrice ;
   var NMagarPrice ;
   var NSabtPrice ;
   var ZaribPrice ;
   var tmpAllPrice ;
   var Zarib ;
   var tmpWeight ;
   var numGRListPrice ;
   var KharejAzAbadSefareshi ;
   var KharejAzAbadPishtaz ;
   var HazineCodePishtaz ;
   var PostLoc;
 
   if(strBuyerCityPreTelCode =="210001")
   {
      PostLoc = "inCity";
   }
   else
   {
      var strSalesRoomPostCenter ;
      strSalesRoomPostCenter="O30";
      if(!(strBuyerPostCenter.indexOf("T")== -1))
      {
         strBuyerPostCenter ="O30";
         PostLoc = "inState";
      }
      else if(strBuyerPostCenter=="O12" || strBuyerPostCenter=="O2" || strBuyerPostCenter=="O21" || strBuyerPostCenter=="O29"|| strBuyerPostCenter=="O31")
      {
         PostLoc = "inAdjoining";
      }
      else
      {
         PostLoc = "OutAdjoining";
      }
   }
   
   NMagarPrice = 0;
   numCODPrice = Math.round((numExtraPrice * 3) /100,0);
   
   if(numCODPrice < 4000)
   {
       numCODPrice  = 4000;
   }
   
   numBimehPrice=1000;
   if(PostLoc == "inCity")
   {
      if(Weight <=250)
      {
          numBaseSendPriceSefareshi = 5000;
          numBaseSendPricePishtaz =18500;
      }
      else if(Weight >=251 && Weight <=500)
      {
         numBaseSendPriceSefareshi = 6100;
         numBaseSendPricePishtaz =22100;
      }
      else if(Weight >=501 && Weight <=1000 )
      {
          numBaseSendPriceSefareshi = 7400;
          numBaseSendPricePishtaz =26800;
      }
      else if(Weight >=1001 && Weight <=2000 )
      {
         numBaseSendPriceSefareshi = 9800;
         numBaseSendPricePishtaz =35000;
      }
      else if(Weight >=2001)
      {
         numBaseSendPriceSefareshi = 9800 + Math.floor((Weight - 2000)/1000)* 3200;
         numBaseSendPricePishtaz =35000 + Math.floor((Weight - 2000)/1000)* 8800;
      }
   }
   else if(PostLoc == "inState")
   {
      if(Weight <=250)
      {
         numBaseSendPriceSefareshi = 5500;
         numBaseSendPricePishtaz =19600;
      }
      else if(Weight >=251 && Weight <=500)
      {
         numBaseSendPriceSefareshi = 6600 ;
         numBaseSendPricePishtaz =23400;
      }
      else if(Weight >=501 && Weight <=1000 )
      {
         numBaseSendPriceSefareshi = 8100;
         numBaseSendPricePishtaz =28400;
      }
      else if(Weight >=1001 && Weight <=2000 )
      {
         numBaseSendPriceSefareshi = 10800;
         numBaseSendPricePishtaz =37000;
      }
      else if(Weight >=2001)
      {
         numBaseSendPriceSefareshi = 10800 + Math.floor((Weight - 2000)/1000)* 3900;
         numBaseSendPricePishtaz =37000 + Math.floor((Weight - 2000)/1000)* 10000;
      }
   }
   else if(PostLoc == "inAdjoining")
   {
      if(Weight <=250)
      {
         numBaseSendPriceSefareshi = 5800;
         numBaseSendPricePishtaz =20500;
      }
      else if(Weight >=251 && Weight <=500)
      {
         numBaseSendPriceSefareshi = 7000 ;
         numBaseSendPricePishtaz =24400;
      }
      else if(Weight >=501 && Weight <=1000 )
      {
         numBaseSendPriceSefareshi = 8600;
         numBaseSendPricePishtaz =29500;
      }
      else if(Weight >=1001 && Weight <=2000 )
      {
         numBaseSendPriceSefareshi = 11400;
         numBaseSendPricePishtaz =38400;
      }
      else if(Weight >=2001)
      {
         numBaseSendPriceSefareshi = 11400 + Math.floor((Weight - 2000)/1000)* 4300;
         numBaseSendPricePishtaz =38400 + Math.floor((Weight - 2000)/1000)* 11300;
      }
   }
   else if(PostLoc == "OutAdjoining")
   {
      if(Weight <=250)
      {
         numBaseSendPriceSefareshi = 6400;
         numBaseSendPricePishtaz =25900;
      }
      else if(Weight >=251 && Weight <=500)
      {
         numBaseSendPriceSefareshi = 7700 ;
         numBaseSendPricePishtaz =31600;
      }
      else if(Weight >=501 && Weight <=1000 )
      {
         numBaseSendPriceSefareshi = 9500;
         numBaseSendPricePishtaz =38800;
      }
      else if(Weight >=1001 && Weight <=2000 )
      {
         numBaseSendPriceSefareshi = 12600;
         numBaseSendPricePishtaz =51800;
      }
      else if(Weight >=2001)
      {
         numBaseSendPriceSefareshi = 12600 + Math.floor((Weight - 2000)/1000)* 5200;
         numBaseSendPricePishtaz =51800 + Math.floor((Weight - 2000)/1000)* 13800;
      }
   }

   KharejAzAbadSefareshi = 0;// Math.round((numBaseSendPriceSefareshi * 25) / 100,0);
   HazineCodeSefareshi = 0;// 2000;
   numSendPriceSefareshi = numBaseSendPriceSefareshi + NMagarPrice + numCODPrice + numBimehPrice + KharejAzAbadSefareshi + HazineCodeSefareshi ;
   MaliyatSefareshi = Math.round((numSendPriceSefareshi * 4) / 100,0);
   TotalSendPriceSefareshi = parseInt(numSendPriceSefareshi) + parseInt(MaliyatSefareshi) + parseInt(numKhadamatPrice);
   KharejAzAbadPishtaz = 0;// Math.round((numBaseSendPricePishtaz * 25) / 100,0);
   HazineCodePishtaz = 0;// 2000;
   numSendPricePishtaz =numBaseSendPricePishtaz + NMagarPrice + numCODPrice + numBimehPrice + KharejAzAbadPishtaz + HazineCodePishtaz;
   MaliyatPishtaz = Math.round((numSendPricePishtaz * 4) / 100,0);
   TotalSendPricePishtaz = parseInt(numSendPricePishtaz) + parseInt(MaliyatPishtaz) + parseInt(numKhadamatPrice);

}

