function js_core_ConfirmDeleteEnable(aId)
{
   if (aId)
   {
      document.getElementById(aId).value=1;
   }
   else
   {
      document.getElementById("aid_confirmdelete").value=1;
   }
   
}
function js_core_ConfirmDelete(aId)
{
   if (aId)
   {
      rId=aId;
   }
   else
   {
      rId="aid_confirmdelete";
   }
      
    if (document.getElementById(rId).value==1)
    {
      if (document.getElementById(rId + "_text").value)
      {
         rText=document.getElementById(rId + "_text").value;
      }
      else
      {
         rText="Chcete tuto položku opravdu smazat ?";
      }
      
      if (confirm(rText))
      {
         return true;
      }
      else
      {
         document.getElementById(rId).value=0;
         return false;
      }
    }
}

function ajs_ShowPannel (aId, aN, aCount)
{
   for (rI=1;rI<=aCount;rI++)
   {
      rId=aId + rI;
      rId2=aId + "Switch" + rI;
      rC=document.getElementById(rId2).className;
      if (rC=="Core_PannelSwitch Core_PannelSwitch_Normal" || rC=="Core_PannelSwitch Core_PannelSwitch_Active")
      { 
         if (rI==aN)
         {
            document.getElementById(rId).className="Core_Pannel Core_Pannel_Active";
            document.getElementById(rId2).className="Core_PannelSwitch Core_PannelSwitch_Active";
         }
         else
         {
            document.getElementById(rId).className="Core_Pannel Core_Pannel_Normal";
            document.getElementById(rId2).className="Core_PannelSwitch Core_PannelSwitch_Normal";
         }
      }
   }
}

function ajs_eshop_pricebez(aId1,aId2,aId3)
{
   if (document.getElementById(aId1) && document.getElementById(aId2) && document.getElementById(aId3))
   {
      document.getElementById(aId1).value=Math.floor(document.getElementById(aId2).value/(1+document.getElementById(aId3).value/100)*1000)/1000;
   }
}
function ajs_eshop_pricedph(aId1,aId2,aId3)
{
   if (document.getElementById(aId1) && document.getElementById(aId2) && document.getElementById(aId3))
   {
      document.getElementById(aId2).value=Math.floor(document.getElementById(aId1).value*(1+document.getElementById(aId3).value/100)*1000)/1000;
   }
}

function ajs_eshop_pricebez2(aId)
{
   aId1="pricebez_" + aId;
   aId2="pricedph_" + aId;
   aId3="dphk_" + aId;
   if (document.getElementById(aId1) && document.getElementById(aId2) && document.getElementById(aId3))
   {
      document.getElementById(aId1).value=Math.round(document.getElementById(aId2).value/(1+document.getElementById(aId3).value/100)*1000)/1000;
   }
}
function ajs_eshop_pricedph2(aId)
{
   aId1="pricebez_" + aId;
   aId2="pricedph_" + aId;
   aId3="dphk_" + aId;
   if (document.getElementById(aId1) && document.getElementById(aId2) && document.getElementById(aId3))
   {
      document.getElementById(aId2).value=Math.round(document.getElementById(aId1).value*(1+document.getElementById(aId3).value/100)*1000)/1000;
   }
}

function ajs_core_value(aId,aDt)
{
   document.getElementById(aId).value=aDt;
}


