/**
 * @projectDescription price.js changes the price after changing the product attribute
 *
 * @author Dipl.-Ing. (FH) Christoph Raschke <raschke@media-fire.de>
 * @copyright 2010 media fire GmbH <http://www.media-fire.de>
 * @license GNU General Public License v3 <http://www.gnu.de/documents/gpl-3.0.de.html>
 * @version 1.0
 *
 * $Id$
 *
 * */

$(document).ready(function() {
  //wählt Deutschland als Standard aus, beim Account anlegen
  $('select[name="country"] option[value="81"]').attr('selected',true);
  $('a[rel*="schrift"]').each(function() {
    this.onclick = function() {
      return hs.expand(this);
    };
 });
//Preisberechnung
   if (typeof(add_to_price)!= 'undefined') { 
   setlocale('LC_ALL', 'de_DE');
   var att=explode(',',ltrim(add_to_price,','));
   var new_price = prod_price;
   $.each(att, function(index,value){
   var foo=price[value][$('select[name="id['+value+']"]').val()];
    if (typeof(foo)!= 'undefined') {
      new_price = new_price + price[value][$('select[name="id['+value+']"]').val()];
          $('.prodPriceInfo2').html(money_format('%i',new_price));
    }
    $('select[name="id['+value+']"]').change(function(evt){
          var sel_opt = $(evt.target).val();
          var change_price = prod_price + price[value][sel_opt];
          $('.prodPriceInfo2').html(money_format('%i',change_price));
       });
   });
 }
});
