	var request = false;
	try {
	  request = new XMLHttpRequest();
	} catch (trymicrosoft) {
	  try {
	    request = new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (othermicrosoft) {
	    try {
	      request = new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (failed) {
	      request = false;
	    }
	  }
	}
	if (!request)
	  alert("Error initializing XMLHttpRequest!");
function SendRequest () {		
	request.open ( "POST", "/feedback/index.php?send=1", true );
	request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	request.onreadystatechange = SubmitSuccess;
	var obj = document.getElementById ( "feedback-form" );
	var n = document.getElementById ( "from" ).value;
	var c = document.getElementById ( "contacts" ).value;
	var h = document.getElementById ( "headline" ).value;
	var t = obj.mail.value;
	if ( !n || !c || !h || !t ) {
		alert ( "Пожалуйста, заполните все поля!" );
		return;
	}
	if ( n.length < 3 || c.length < 3 || h.length < 3 || t.length < 3 ) {
		alert ( "Пожалуйста, используйте более длинные слова.") ;
		return;
	}
	var contacts = c.replace ( / /g, '' );
	if ( contacts == '' ) {
		alert ( "Пожалуйста, введите правильную контактную информацию.") ;
		return;
	}
	
	var st = "name=" + n + "&message=" + t + "&email=" + c + "&subject=" + h;
	request.send( st );
	obj.style.display = "none";
}
function SubmitSuccess () {
	 if (request.readyState == 4) {
		if (request.status == 200) {
			alert ( "Сообщение успешно отправлено." );
		}
		else {
			alert ( "Не удалось отправить сообщение!" );
		}
	 }
}
//--------------------------------------- base scripts ---------------------------------------------
function validateEmail(form) {
	if ( !form.email.value || form.email.value == "ваш e-mail") {
		alert ("Пожалуйста, введите e-mail");
		return false;
	}
	else if ( !form.name.value || form.name.value == "ваше e-mail") {
		return false;
	}
	else {
		return true;
	}
}
function ysearch ( str ) {
	/*
	if( document.search_form.type.value == 7 ) {
		//open("http://yandex.ru/yandsearch?text=" + str);
		//var adr = "http://yandex.ru/yandsearch?text=" + str;
	}
	else {
		document.search_form.action = "/search/";
		document.search_form.submit();		
	}
	*/
	document.search_form.action = "/search/";
	document.search_form.submit();	
}

function getEmail ( login, server ) { 	
	eml = login +  "@" + server;
	return eml;
}

function mailTo (login, server) {
	eml = "mailto:" + getEmail(login, server);	
	window.location.href = eml;
}

function email ( login, server ) {
	document.write ( getEmail ( login, server ) );
}

function toSite ( site ) {
	var st = site.substring ( 0, 7 );
	if ( st != "http://" )
		s = "http://" + site;
	else
		s = site;
	window.open ( s );
}

function site ( site ) {
	document.write ( site );
}
function gTime ( h, m, s, day, mon, wday ) {	
	
	var d = new Date ();
	//var h = d.getHours ();
	//var m = d.getMinutes ();
	
	//var s = d.getSeconds ();
	s = s - 0;
	s = s + 1;
	if ( s > 59 ) {
		s = '00';
		m = m - 0;
		m = m + 1;
		if ( m > 59 ) {
			m = '00';
			h = h - 0;
			h = h + 1;
			if ( h > 24 ) {
				h = 0;
				h = h + 1;
				wday = wday + 1;
			}
		}			
	}
	s = s.toString ();
	if ( s.length < 2 )
		s = '0' + s;
	m = m.toString ();
	if ( m.length < 2 )
		m = '0' + m;
	h = h.toString ();
	if ( h.length < 2 )
		h = '0' + h;
	//var day = d.getDate ();
	//if ( day < 10 )
		//day = '0' + day;
	day = day.toString ();
	if ( day.length < 2 )
		day = '0' + day;
	mon = mon.toString ();
	if ( mon.length < 2 )
		mon = '0' + mon;
	//var mon = d.getMonth ();
	//if ( mon < 10 )
	//	mon = '0' + mon;
	//var wday = d.getDay ();
	if ( wday == 8 )
		wday = 1;
	switch ( wday )
	{
		case 1:
			wdayt = 'Понедельник';
		break;
		case 2:
			wdayt = 'Вторник';
		break;
		case 3:
			wdayt = 'Среда';
		break;
		case 4:
			wdayt = 'Четверг';
		break;
		case 5:
			wdayt = 'Пятница';
		break;
		case 6:
			wdayt = 'Суббота';
		break;
		case 7:
			wdayt = 'Воскресенье';
		break;
	
	}
	var year = d.getFullYear ();
	var xxx = document.getElementById ( "timedate" );
	if ( xxx )
		xxx.innerHTML = h+':'+m+':'+s + ' - ' + day+'.'+mon+'.'+year+' г. - '+wdayt;
	//var func = 'gTime(' + h + ', ' + m + ', ' + s + ');';
	setTimeout ( function(){gTime(h,m,s,day,mon, wday)}, 1000 );	
}
 function kadabra (zap) {
    if (document.getElementById) {
        var abra = document.getElementById (zap).style;
        if (abra.display == "block") {
            abra.display = "none";
            } else {
            abra.display = "block";
        }
        return false;
        } else {
        return true;
    }
}
//-------------- overlabel ------------------------------------
function initOverLabels () {
  if (!document.getElementById) return;      

  var labels, id, field;

  // Set focus and blur handlers to hide and show 
  // labels with 'overlabel' class names.
  labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {

    if (labels[i].className == 'overlabel') {

      // Skip labels that do not have a named association
      // with another field.
      id = labels[i].htmlFor || labels[i].getAttribute('for');
      if (!id || !(field = document.getElementById(id))) {
        continue;
      } 

      // Change the applied class to hover the label 
      // over the form field.
      labels[i].className = 'overlabel-apply';

      // Hide any fields having an initial value.
      if (field.value !== '') {
        hideLabel(field.getAttribute('id'), true);
      }

      // Set handlers to show and hide labels.
      field.onfocus = function () {
        hideLabel(this.getAttribute('id'), true);
      };
      field.onblur = function () {
        if (this.value === '') {
          hideLabel(this.getAttribute('id'), false);
        }
      };

      // Handle clicks to label elements (for Safari).
      labels[i].onclick = function () {
        var id, field;
        id = this.getAttribute('for');
        if (id && (field = document.getElementById(id))) {
          field.focus();
        }
      };

    }
  }
};

function hideLabel (field_id, hide) {
  var field_for;
  var labels = document.getElementsByTagName('label');
  for (var i = 0; i < labels.length; i++) {
    field_for = labels[i].htmlFor || labels[i]. getAttribute('for');
    if (field_for == field_id) {
      labels[i].style.textIndent = (hide) ? '-10000px' : '0px';
      return true;
    }
  }
}

window.onload = function () {
  setTimeout(initOverLabels, 50);
};

function getObj (block_id)
{
    return document.getElementById (block_id);
}

function pullDown (block_id)
{
     var block = getObj(block_id);

     if (block.className == 'specialShort'){
          block.className = 'specialFull' 
     }
     else{
          block.className = 'specialShort'  
     }     
}

