var d = document;

///////////////////////////////////////////////////////////////////////////////////////////
function checkbox(obj, obj2) {
	obj.style.backgroundPosition=obj.style.backgroundPosition=="0px -100px"?"":"0px -100px";
	document.getElementById(obj2).click();
	}
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 shfaq(num, link) {
	if(d.getElementById('otvet'+num).style.display=='none'){
		d.getElementById('otvet'+num).style.display='block';
		d.getElementById('faq'+num).className='open';
		link.innerHTML='Скрыть ответ';
		link.style.backgroundPosition='right bottom';
	} else{
		d.getElementById('otvet'+num).style.display='none';
		d.getElementById('faq'+num).className='';
		link.innerHTML='Посмотреть ответ';
		link.style.backgroundPosition='right top';		
	}
}

var msg='';
	function fonload() {
		d.getElementById('preloader').style.display='none';
		d.getElementById('wr').style.display='block'
		d.getElementById('wr').style.position='static'
		if(msg!=''){alert(msg);}
	}
	
	function slct_itm_click(s_nam,val,item) {
		if(document.getElementById(s_nam+'input') && document.getElementById(s_nam+'crrnt')) {
			document.getElementById(s_nam+'input').value=val;
			document.getElementById(s_nam+'crrnt').innerHTML=item.innerHTML;
			slct_close(s_nam);
		}
	}
	function slct_open(s_nam) {
		if(document.getElementById(s_nam+'itm_list') && document.getElementById(s_nam+'crrnt_wr') ) {
			if(document.getElementById(s_nam+'itm_list').style.display=='block'){
				slct_close(s_nam);
			} else {			
				document.getElementById(s_nam+'itm_list').style.display='block'
				document.getElementById(s_nam+'crrnt_wr').style.backgroundPosition="right top";
			}
		}
	}
	var sTmr;
	function slct_mov(s_nam) {
		sTmr = window.setTimeout('slct_close(\''+s_nam+'\')', 500);
	}
	function slct_mout() {
		window.clearTimeout(sTmr);			
	}
	function slct_close(s_nam) {
		if( document.getElementById(s_nam+'itm_list') && document.getElementById(s_nam+'crrnt_wr')) {
			document.getElementById(s_nam+'itm_list').style.display='none';
			document.getElementById(s_nam+'crrnt_wr').style.backgroundPosition="right bottom";
		}
	}
	function slct_show(s_nam){
		if(document.getElementById(s_nam+'input')) {
			document.getElementById(s_nam+'input').value='';
		}
	}
