function printOrder(_url)
{/*   version 1.4.0.00 */
   printWindow = window.open(_url,
                       "printWindow","toolbar=0, location=0, status=1, resizable=1, menubar=1, "+
                       "scrollbars=1, width=750, height=540");
   printWindow.focus();
}


// shop:
var cart_control = {
   reduce: function(id, allowDecimals) {
      if (document.forms['addForm_'+id]) {
         reduceBy = allowDecimals ? .1 : 1
         val = parseFloat(document.forms['addForm_'+id].elements['shop_cart_qty'].value.toString())
         if (val - reduceBy > 0)
            res = val - reduceBy
         else
            res = 0
         if (res != parseInt(res))
            res = res.toFixed(2)
         document.forms['addForm_'+id].elements['shop_cart_qty'].value = res
         this.activateBtn(id)
      }
   },
   add: function(id, allowDecimals) {
      if (document.forms['addForm_'+id]) {
         val = parseFloat(document.forms['addForm_'+id].elements['shop_cart_qty'].value.toString())
         res = val + (allowDecimals ? .1 : 1)
         if (res != parseInt(res))
            res = res.toFixed(2)
         document.forms['addForm_'+id].elements['shop_cart_qty'].value = res
         this.activateBtn(id)
      }
   },
   activateBtn: function(id) {
      if (document.getElementById('btnAdd_'+id)) {
         document.getElementById('btnAdd_'+id).src = 'UI/Images/Shop/btn_add.png'
         document.getElementById('btnAdd_'+id).className = 'btnAdd'
         document.getElementById('btnAdd_'+id).disabled = false
      } else if (document.getElementById('btnSave_'+id)) {
         document.getElementById('btnSave_'+id).src = 'UI/Images/Shop/btn_save.png'
         document.getElementById('btnSave_'+id).className = 'btnSave'
         document.getElementById('btnSave_'+id).disabled = false
      }
   },
   checkQty: function(field, allowDec, min) {
      var anum = allowDec ? /^\d+([\.\,]\d{1,3})?$/ : /^\d+$/
      if (anum.test(field.value)) {
         field.value = field.value.toString().replace(",", ".");
         if (parseFloat(min) && parseFloat(min) > parseFloat(field.value)) {
            alert("Minimalna količina za naručivanje je "+min);
            return false;
         } else
            return true;
      }
      else {
         alert("Molimo unesite ispravnu količinu")
         return false
      }
   }
}


