	function ch_tab(id){

		if(document.getElementById('tab_'+id).style.display==''){
document.getElementById('tab_'+id).style.display='none'; 

//
document.getElementById('s_'+id).className=" switch";
//
document.getElementById('img_'+id).src="../images/plus.gif";
document.getElementById('s_'+id).innerHTML='раскрыть список'; 
document.getElementById('td_'+id).style.borderBottom=''; 
document.getElementById('td_'+id).style.borderTop='2px solid #ff6d02'; 
document.getElementById('count_'+id).style.display=''; 
}
else{
document.getElementById('tab_'+id).style.display='';
document.getElementById('td_'+id).style.borderTop=''; 
document.getElementById('td_'+id).style.borderBottom='2px solid #ff6d02'; 

document.getElementById('count_'+id).style.display='none'; 
document.getElementById('img_'+id).src="../images/minus.gif";
document.getElementById('s_'+id).innerHTML='скрыть список'; 
}

}
function ShowWnd(Wnd,width,height) {
	Wnd_window=open(Wnd, 'Wnd', 'fullscreen=no,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+ width +',height='+height);
	Wnd_window.focus();
	return(false);
}

//
function Show_Div(item)
{
	obj = document.getElementById(item);

	if(obj.style.display == 'none')
	{
		obj.style.display = "";
	}
	else
	{
		obj.style.display = "none"; 
	}
}

//
			function set_combo_date(id){
var sel = document.getElementById('id_date_seminar');

for(i=0; i<sel.options.length; i++)
if (sel.options[i].value==id){
sel.selectedIndex=[i];
return true;
}


}

var all_ch=0;

function ch_div(id){

	thisCheckBoxes = document.getElementById('all').getElementsByTagName('div'); 
	for (i = 0; i < thisCheckBoxes.length; i++){	
	
	fo=thisCheckBoxes[i].id;  
if (fo=='div_'+id)	
	if (document.getElementById(fo).style.display=='none'){
		document.getElementById(fo).style.display='block';
		document.getElementById('span_'+id).innerHTML=' «';
		document.getElementById('podr_'+id).style.display='none';

		}else{
		document.getElementById(fo).style.display='none';
		document.getElementById('span_'+id).innerHTML=' »';
	}
	


	}
}


function ch_all_div(){
if (all_ch)
{
all_ch=0;

document.getElementById('poln_rasp').innerHTML='Полное расписание';
display='none';
str=' »';
}else
{
all_ch=1;
document.getElementById('poln_rasp').innerHTML='Скрыть расписание';
display='block';
str=' «';
}

	thisCheckBoxes = document.getElementById('all').getElementsByTagName('div'); 
	
	for (i = 0; i < thisCheckBoxes.length; i++){	
	fo=thisCheckBoxes[i].id;  
if (fo.substr(0,4)=='div_')	{
		
		ig=fo.substr(4) * 1;
		
		document.getElementById(fo).style.display=display;
		//document.getElementById('span_'+ig).innerHTML=str;

}

}
}






function getAbsolutePos(el)
{
 var r = { x: el.offsetLeft, y: el.offsetTop };
   if (el.offsetParent)
   {
       var tmp = getAbsolutePos(el.offsetParent);
       r.x += tmp.x;
       r.y += tmp.y;
   }
   return r;


}

function view_reg(obj, pl, type){
div0=document.getElementById('div_reg');
obj_pos=getAbsolutePos(obj);
div0.style.left=obj_pos.x+'px'; 
div0.style.top=(obj_pos.y+15)+'px'; 
if (pl<=2)
st='color: red;';
else
st='';

if (!type){
div0.innerHTML='идет регистрация...';
if (pl<=9 && pl>0)
div0.innerHTML=div0.innerHTML+'<br><span style="'+st+'">оставшихся мест: '+pl+'</span>';

}
else{
div0.innerHTML=pl;
}

div0.style.display="block";
}


function hide_reg(){
		div0=document.getElementById('div_reg');
		div0.style.display="none";
	}

			//////////////////////
			function key_on(s, o){
					
					if (o.value==s) o.value='';
					}

					function clearForm(phone_code) {
						document.form.phone_code.value = "";
					}
					function clearForm(phone) {
						document.form.phone.value = "";
					}
					
					
                    function checkform(Form)
                    {

                    if (Form.phone.value == "")
                    {
                    alert("Вы не указали телефон!");
                    Form.phone.focus();
                    return (false);
                    }

                    if (Form.email.value == "")
                    {
                    alert("Вы не указали email!");
                    Form.email.focus();
                    return (false);
                    }
					if (Form.address.value == "")
                    {
                    alert("Вы не указали адрес!");
                    Form.address.focus();
                    return (false);
                    }
					
					
               /*     if(Form.phone_code.value == 'код')
                    {
                    	Form.phone_code.value = '';
                    }
				
					
                    if(Form.phone.value == 'номер телефона')
                    {
                    	Form.phone.value = '';
                    }*/
              
                    return (true);
                    }
                    
                    function SetText(item, value)
{
	obj = document.getElementById(item);
	if(obj.value==value)
	{
		obj.value = '';
	}
}


function is_email(str)  {
str=str.toLowerCase();

if (( str. indexOf ( "@mail.ru" ) == -1 )&&( str. indexOf ( "@inbox.ru" ) == -1 )&&( str. indexOf ( "@list.ru" ) == -1 )&&( str. indexOf ( "@bk.ru" ) == -1 )) {

document.getElementById('div_email_info').style.display='none';

}
else{

document.getElementById('div_email_info').style.display='block';
}
}



var kol=0;
function add_fio(){
var parent = document.getElementById('list');

kol=(kol+1);

child =  document.createElement('DIV');
input = parent.appendChild(child);
input.id = 'div_'+kol;
input.innerHTML = '<div style="margin-top: 10px"><label>ФИО * </label><input id="f_fio" name="fio[]" type="text" /><label>должность </label><input id="а_dolgnost" name="dolgnost[]" type="text" /></div>';


}


