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()
{
document.getElementById('good_price').innerHTML=to_str(document.getElementById('dinamic_price').title*Math.ceil(document.getElementById('good_count').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 GoodMod(id,name,image,price,img_b)
{this['id']=id;
this['name']=name;
this['image']=image;
this['price']=price;
this['img_b']=img_b;
this.selectMod=selectMod;
}

function selectMod()
{document.getElementById('good_mod').innerHTML=this.name;document.getElementById('good_image').src=this.image;document.getElementById('dinamic_price').title=this.price;
document.getElementById('good_show_img').href='/showimg.php?img='+this.img_b; /*for ie only*/
document.getElementById('good_show_img').name=this.img_b;
recount();
good_name=this.id;
}

//good_card
