function img_over(txt_id, img_id) {
	
	txt_id = eval(txt_id);
	img_id = eval(img_id);

	txt_id.style.color = '#b45325';
	img_id.style.filter = 'alpha(Opacity=80)';		
	}
	
function img_out(txt_id, img_id) {
	
	txt_id = eval(txt_id);
	img_id = eval(img_id);

	txt_id.style.color = '#003000';
	img_id.style.filter = 'alpha(Opacity=100)';
	}
	
	
function openmap() {

  var win;
  win = window.open("","_blank", "width=300,height=300");
  win.document.write("<html><head><title>Схема проезда</title></head><body>");
  win.document.write('<div style="position:absolute;width:300px;height:300px;left:0px;top:0px">');
  win.document.write('<img src="images/map.gif"></div></body></html>');
}


function openwin(page, w, h, alt) {

  var win;
  var prm = "width="+w+",height="+h;
  win = window.open("","_blank",prm);
  win.document.write("<html><head><title>"+alt+"</title></head><body>");
  win.document.write('<div style="position:absolute;width:'+w+'px;height:'+h+'px;left:0px;top:0px">');
  win.document.write("<a href=\"javascript:self.close()\" title=\"Закрыть окно\"><img src="+page+" border=0></a></div></body></html>");
}


var clickFlag = false;

function checkForm() {

	if(clickFlag == true) return false;
	
	var txt = '';
	
	if(document.main.name.value == '')
		txt = txt + ' - Ваше имя\n';

	if(document.main.phone.value == '')
		txt = txt + ' - Контактный телефон\n';
		
	if(txt != '') {
		
		txt = "Укажите, пожалуйста, следующую информацию:\n\n" + txt;
		window.alert(txt);	
		return false;
		}
		
	clickFlag = true;
	
	return true;	
	}
function open_w(id) {

	if (tek) document.getElementById(tek).style.display='none';
	block = document.getElementById(id);
 	block.style.opacity = 0; 
  	block.style.filter='alpha(opacity=0)'; 
	block.style.display='block';

	var from = 0; // Начальная координата X
	var to = 1; // Конечная координата X
	var duration = 400; // Длительность - 1 секунда
	var start = new Date().getTime(); // Время старта

	setTimeout(function fade() {
		var now = (new Date().getTime()) - start; // Текущее время
		var progress = now / duration; // Прогресс анимации
		var result = (to - from) * progress + from;

	 	block.style.opacity = result; 
    		block.style.filter='alpha(opacity='+result*100+')'; 
  
		if (progress < 1) { // Если анимация не закончилась, продолжаем
      			setTimeout(arguments.callee, 10);
		} else {
			block.style.filter='none';
		}

	}, 10);

	document.getElementById('dark').style.display='block';
	tek=id;
}

function close_w(id) {

	var from = 1; // Начальная координата X
	var to = 0; // Конечная координата X
	var duration = 200; // Длительность - 1 секунда
	var start = new Date().getTime(); // Время старта
 
	setTimeout(function fade() {
		var now = (new Date().getTime()) - start; // Текущее время
	    	var progress = now / duration; // Прогресс анимации
 
    		var result = (to - from) * progress + from;

    		block.style.opacity = result; 
    		block.style.filter='alpha(opacity='+result*100+')'; 
 
    		if (progress < 1) { // Если анимация не закончилась, продолжаем
        		setTimeout(arguments.callee, 10);
		} else {
			document.getElementById(id).style.display='none';
		}

	}, 10);
	document.getElementById('dark').style.display='none';
	tek='';
}	