// JavaScript Document
//Функция которая изменяет  цвет  бэкграундовского изображения
function hover(element,flag)
{
	id=element.id;
if(flag==1)
	{
		if(id=='btn_01')
			{
				element.style.background='url(images/bras_nav_iconact.jpg) no-repeat top center';
				element.style.cursor='hand';
				element.firstChild.style.color='#ddbc62';		
			}
		else if(id=='btn_02')
		  {
		  	element.style.background='url(images/ser_nav_iconact.jpg) no-repeat top center';
			element.style.cursor='hand';
			element.firstChild.style.color='#ddbc62';
		  }
		 else if(id=='btn_03')
		 {
		   element.style.background='url(images/kol_nav_iconact.jpg) no-repeat top center';
			element.style.cursor='hand';
			element.firstChild.style.color='#ddbc62';
		 }
		 else if(id=='btn_04')
		 {
		   element.style.background='url(images/podv_nav_iconact.jpg) no-repeat top center';
			element.style.cursor='hand';
			element.firstChild.style.color='#ddbc62';
		 }
		 else if(id=='btn_05')
		 {
		  element.style.background='url(images/kole_nav_iconact.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#ddbc62';
		 }
		 else if(id=='btn_06')
		 {
		  element.style.background='url(images/bus_nav_iconact.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#ddbc62';
		 }
		 else if(id=='btn_07')
		 {
		  element.style.background='url(images/bus2_nav_iconact.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#ddbc62';
		 }
		 else if(id=='btn_08')
		 {
		  element.style.background='url(images/pod_nav_iconact.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#ddbc62';
		 }
	}
else if(flag==2)
{   
      
	   if(id=='btn_01')
			{
				element.style.background='url(images/bras_nav_icon.jpg) no-repeat top center';
				element.style.cursor='hand';
				element.firstChild.style.color='#464646';
			}
		else if(id=='btn_02')
		  {
		  	element.style.background='url(images/ser_nav_icon.jpg) no-repeat top center';
			element.style.cursor='hand';
			element.firstChild.style.color='#464646';
		  }
		 else if(id=='btn_03')
		 {
		   element.style.background='url(images/kol_nav_icon.jpg) no-repeat top center';
			element.style.cursor='hand';
			element.firstChild.style.color='#464646';
		 }
		 else if(id=='btn_04')
		 {
		   element.style.background='url(images/podv_nav_icon.jpg) no-repeat top center';
			element.style.cursor='hand';
			element.firstChild.style.color='#464646';
		 }
		 else if(id=='btn_05')
		 {
		  element.style.background='url(images/kole_nav_icon.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#464646';
		 }
		 else if(id=='btn_06')
		 {
		  element.style.background='url(images/bus_nav_icon.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#464646';
		 }
		 else if(id=='btn_07')
		 {
		  element.style.background='url(images/bus2_nav_icon.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#464646';
		 }
		 else if(id=='btn_08')
		 {
		  element.style.background='url(images/pod_nav_icon.jpg) no-repeat top center';
		  element.style.cursor='hand';
		  element.firstChild.style.color='#464646';
		 }
}
     
}
//Функция для  отображения скрытия объекта
// id_display id элемента который будет отображаться или скрываться
function display_on_off(id_display){
		if(document.getElementById(id_display).style.display=='none'){
				document.getElementById(id_display).style.display='block';
		} 
	    else {
			document.getElementById(id_display).style.display='none';
		}
	}
//Заполненость полей в добавлении нового адресса доставки и вызов функции display_on_off
function add_address () {
 if (document.getElementById('addressee') != null) document.getElementById('addressee').value = '';
 if (document.getElementById('adress') != null) document.getElementById('adress').value = '';
 if (document.getElementById('postal_code') != null) document.getElementById('postal_code').value = '';
 if (document.getElementById('info') != null) document.getElementById('info').value = '';
 if (document.getElementById('phone') != null) document.getElementById('phone').value = '';
 display_on_off('btn_change');
 display_on_off('new_adress');
}