var d = document;


function checkbox(obj, obj2) {
	obj.style.backgroundPosition=obj.style.backgroundPosition=="0px -100px"?"":"0px -100px";
	document.getElementById(obj2).click();
	}
	
function radiobtn(obj, obj2, obj3) {
	if (obj3) document.getElementById(obj2+obj3).checked = 1;
	for (n=1; document.getElementById(obj+n); n++) {
		document.getElementById(obj+n).style.backgroundPosition=document.getElementById(obj2+n).checked?"0px -100px":"";
		}
}
function radiobtn_(lbl_group, begin_num, lbl_active_num) {
	for (n=begin_num; document.getElementById(lbl_group+n); n++) {
		document.getElementById(lbl_group+n).style.backgroundPosition="";
		}
	document.getElementById(lbl_group+lbl_active_num).style.backgroundPosition="0px -100px";
}
function fonload(m) {
	i=1;
	while (document.getElementById('main_menu_link'+i)){
		if(document.getElementById('main_menu_div'+i)) {
			

			n=1;
		}
		i++;
	}
	i=0;
	radio=document.getElementsByTagName('input');
	while (radio[i]){
		if(radio[i].type=='radio' || radio[i].type=='checkbox' ) {
			radio[i].checked=false;
		}
		i++;
	}
	if (m) {alert(m);}
	summa();
}

function shFAQ(this_obj, otvet) {
	if (this_obj && d.getElementById(otvet)) {
			this_obj.innerHTML=d.getElementById(otvet).className == 'otvet' ? 'Посмотреть ответ' : 'Скрыть ответ';
			d.getElementById(otvet).className=d.getElementById(otvet).className == 'otvet dn' ? 'otvet' : 'otvet dn';
	}
}

function photo(obj, obj2) {
	i=1;
	while (document.getElementById(obj+i)){
		document.getElementById(obj+i).style.zIndex="100";
		i++;
	}
	document.getElementById(obj+obj2).style.zIndex="1000";
}

	function summa() {
		if (document.getElementById('stoim_0')){
			i=0;
			s=0;
			while(document.getElementById('stoim_'+i)){
				s=s+parseFloat(document.getElementById('stoim_'+i).innerHTML);
				i++;
			}

			if(document.getElementById('summa')){
				document.getElementById('summa').innerHTML="Итоговая сумма: "+s;
			}
		}

	}
