/*------------ LOGIN -----------------*/
function LoginProcess(){	var login = document.getElementById('login_').value;
	var pass = document.getElementById('pass_').value;
	if (login=='' || pass==''){		alert('заполните все поля.');
	}else{		document.getElementById('login_form').submit();
	}
}

function LogoutProcess(){	document.getElementById('logout_form').submit();
}
/*------------ /LOGIN -----------------*/


/*------------ office page photo scroll	-------------*/

function ScrollPicList(pcount_,act_){
	var page_width = 100;

	var pl_ = document.getElementById('pic_list');
	pl_margin = parseFloat(pl_.style.marginLeft);
	if (!pl_margin) pl_margin = 0;

    var c_page = Math.abs(pl_margin) / page_width;
    c_page = Math.ceil(c_page) + 1;

	var p_max = pcount_-1;
	if ( (act_ == 'up') && (c_page<=p_max) ) {		var val_ = pl_margin - page_width;
		pl_.style.marginLeft = val_ + 'px';
	}

	if ( (act_ == 'down') && (c_page>1) ) {
		var val_ = pl_margin + page_width;
		pl_.style.marginLeft = val_ + 'px';
	}

}

function SetPrevPic(src_,href_){	document.getElementById('prev_pic').src = src_;
	document.getElementById('prev_pic_href').href = href_;}

/*------------ /office page photo scroll  -------------*/

/*------------ office page agent data  -------------*/
function ShowAgentData(id_){ 	if(document.getElementById('agent_' + id_).style.display=='none'){ 		document.getElementById('agent_' + id_).style.display='block';
 	}else{		document.getElementById('agent_' + id_).style.display='none';
 	}
}
/*------------ /office page agent data  -------------*/


/*------------ Town Select Form	-------------*/
function ShowTList(){	if (document.getElementById('city_list').style.display=='none' || document.getElementById('city_list').style.display==''){
		document.getElementById('city_list').style.display='block';
	}else{		document.getElementById('city_list').style.display='none';
	}
}

function SetCity(tr_){	var name_ = tr_.innerHTML;
	var id_ = tr_.id.substr(2,tr_.id.length);
	document.getElementById('city_id').value = id_;
	document.getElementById('sel_city').innerHTML=name_;
	document.getElementById('city_list').style.display='none';

}
/*------------ /Town Select Form	-------------*/


/*----------- WINDOW ONLOAD ---------------------*/
  function womOn(){  window.onload = womGo;}
  function womGo(){  for(var i = 0;i < woms.length;i++)    eval(woms[i]);}
  function womAdd(func){  woms[woms.length] = func;}
  var woms = new Array();
/*----------- /WINDOW ONLOAD ---------------------*/

/*----------- SITE FUNCTION ---------------------*/
function MOver(tr_){
	tr_.style.backgroundPosition = 'left bottom';
}

function MOut(tr_){
	tr_.style.backgroundPosition = 'left top';
}

function SHT(tr_){
	var id_ = tr_.id;
	var i_ = id_.substring(3,id_.length);
	var htt_ = document.getElementById('htt'+i_);
	var htr_ = document.getElementById('htr'+i_);
	if (htt_.style.display=='block'){
		htt_.style.display='none';
		htr_.style.display='inline';
	}else{
		htt_.style.display='block';
		htr_.style.display='none';
	}

}
/*----------- /SITE FUNCTION ---------------------*/
