// Пути к кнопкам

var IMGQuestionSRC_close='/images/vopr_o.gif';
var IMGQuestionSRC_open='/images/vopr.gif';
var IMGInputSRC_close='/images/personal_office_c.gif';
var IMGInputSRC_open='/images/personal_office.gif';

// Объекты

var formQuestion=xGetElementById('ask_a_question');
var btnFormQuestion=xGetElementById('btn_online_questions');
var btnInput=xGetElementById('btn_input');
var inputDiv=xGetElementById('input_div');

if(formQuestion){
	btnFormQuestion.parentNode.onclick=function(){return false};
	btnFormQuestion.onclick=function(){moveLFormQuestion();}
}
if(inputDiv){
	inputDiv.style.left='226px';
	btnInput.parentNode.onclick=function(){return false};
	btnInput.onclick=function(){moveLFormInput();}
	inputDiv.onmouseout=function(){
		var timeOutI=window.setTimeout('moveRFormInput()',800);
		inputDiv.onmouseover=function(){window.clearTimeout(timeOutI);}
	}
}
function moveLFormQuestion(){
	var e=xGetElementById('ask_a_question');
	var btn=xGetElementById('btn_online_questions');
	e.style.left=e.offsetLeft+10+'px';
	e.onmouseout=function(){return false;}
	e.onmouseover=e.onmousemove=function(){return false;}
	if(e.offsetLeft<0) window.setTimeout('moveLFormQuestion()',10);
	else {
		btn.src=IMGQuestionSRC_close;
		e.style.left='0px';
		btn.onclick=function(){moveRFormQuestion();}
		e.onmouseout=function(){
			var timeOutQ=window.setTimeout('moveRFormQuestion()',800);
			e.onmouseover=e.onmousemove=function(){window.clearTimeout(timeOutQ);}
		}
	}
}
function moveRFormQuestion(){
	var e=xGetElementById('ask_a_question');
	var btn=xGetElementById('btn_online_questions');
	e.style.left=e.offsetLeft-10+'px';
	if(e.offsetLeft>-225) window.setTimeout('moveRFormQuestion()',10);
	else {
		btn.src=IMGQuestionSRC_open;
		e.style.left='-225px';
		btn.onclick=function(){moveLFormQuestion();}
	}
}
function moveLFormInput(){
	var btn=xGetElementById('btn_input');
	inputDiv.style.left=parseInt(inputDiv.style.left)-10+'px';
	if(parseInt(inputDiv.style.left)>0) window.setTimeout('moveLFormInput()',10);
	else {
		inputDiv.style.left='0px';
		btn.src=IMGInputSRC_close;
		btn.onclick=function(){moveRFormInput();}
	}
}
function moveRFormInput(){
	var btn=xGetElementById('btn_input');
	inputDiv.style.left=parseInt(inputDiv.style.left)+10+'px';
	if(parseInt(inputDiv.style.left)<226) window.setTimeout('moveRFormInput()',10);
	else {
		inputDiv.style.left='226px';
		btn.src=IMGInputSRC_open;
		btn.onclick=function(){moveLFormInput();}
	}
}
