function checkAll(form,check_name,flag)
{for(i in form[check_name])
form[check_name][i].checked=flag;
}

function showHide(id)
{
if(document.getElementById(id).style.display=='none')
display(id);
else
display(id,'none');
}

function display(id,type)
{
if(type==null)type='block';
document.getElementById(id).style.display=type;
}

//good_card
function recount(mod_id)
{
select_size=document.getElementById('mod_'+mod_id+'_size');
select_amount=document.getElementById('mod_'+mod_id+'_amount');
price=document.getElementById('dinamic_price');
if(discount>0)
{
price_d=document.getElementById('dinamic_price_d');
price_d.title=parseInt(price_d.title)-parseInt(select_size.name)*parseInt(select_amount.name)+parseInt(select_size.value)*parseInt(select_amount.value);
price.title=parseInt(price_d.title)/100*(100-discount);
price_d.innerHTML=to_str(price_d.title);
price.innerHTML=to_str(price.title);
}
else
{
price.title=parseInt(price.title)-parseInt(select_size.name)*parseInt(select_amount.name)+parseInt(select_size.value)*parseInt(select_amount.value);
price.innerHTML=to_str(price.title);
}
select_size.name=select_size.value;
select_amount.name=select_amount.value;
good_mod[mod_id]=select_size.options[select_size.selectedIndex].title+' סל '+select_size.options[select_size.selectedIndex].innerHTML+' '+select_amount.value+' רע.';
//good_mod[mod_id]=mod_id+'_'+select_size.options[select_size.selectedIndex].innerHTML+'_'+select_amount.value;
}

function to_str(price)
{
price=parseInt(price);
ret='';
while(price>1000)
{
ret=' '+price.toString().slice(-3)+ret;
price=parseInt(price/1000);
}
ret=price+ret;
return ret;
}

function getGoodName()
{
good_name='';
for(mod_id in good_mod)
  good_name+=good_mod[mod_id]+', ';
//if(good_name!='')
good_name=good_name.slice(0, -2)+'__'+document.getElementById('dinamic_price').title;
return good_name;
}
//good_card
