<!--

lastObj = '';
lastObjTitle = '';
lastSubcontentObj = '1';
lastContactsID = 1;

function openLink(obj, chapter) {

	globalChapter = chapter;

	var div_content = document.all['content_' + chapter];

	document.all.page_title.innerHTML = div_content.getElementsByTagName('div')[0].innerHTML;

	if (lastObj) {

		document.all['content_' + lastObjTitle].style.display = 'none';

	}

	div_content.style.display = '';

	obj.style.cursor = 'default';
	obj.style.textDecoration = 'none';

	if (document.all[chapter]) {

		document.all[chapter].style.cursor = 'default';
		document.all[chapter].style.textDecoration = 'none';

	}

	if (document.all[lastObjTitle]) {

		document.all[lastObjTitle].style.cursor = 'pointer';
		document.all[lastObjTitle].style.textDecoration = 'underline';

	}


	if (chapter == 'index') {

		document.all.logo.getElementsByTagName('a')[0].style.cursor = 'default';
		document.title = document.all.page_title.innerHTML;
//		document.title = 'РИА «ШАГ»';
		document.all.current_url.innerHTML = '';
		document.all.current_url.parentNode.setAttribute('href', '/');

	}

	else {

		document.all.logo.getElementsByTagName('a')[0].style.cursor = 'pointer';
		document.title = document.all.page_title.innerHTML + ' — РИА «ШАГ»';
		document.all.current_url.innerHTML = '/' + chapter + '/';
		document.all.current_url.parentNode.setAttribute('href', '/' + chapter + '/');

	}



	if (chapter == 'index') {

		document.all.right_bottom.innerHTML = '<a id="result_image" href="/result/" onclick="openLink(this, \'result\'); scrollTo(0, 455); return false"><img src="/img/titles/doubts_1.gif" width="289" height="14" alt="Сомневаетесь? Узнайте о нашем опыте!" title="Сомневаетесь? Узнайте о нашем опыте!"></a><br>';

	}

	else if (chapter == 'guarantee') {

		document.all.right_bottom.innerHTML = '<a id="order_image2" href="/order/" onclick="openLink(this, \'order\'); scrollTo(0, 455); return false"><img src="/img/titles/order_2.gif" width="339" height="18" alt="Заказать поисковое продвижение сайта online!" title="Заказать поисковое продвижение сайта online!"></a><br>';

	}

	else if (chapter == 'result') {

		document.all.right_bottom.innerHTML = '<a id="guarantees_image" href="/guarantee/" onclick="openLink(this, \'guarantee\'); scrollTo(0, 455); return false"><img src="/img/titles/guarantees_1.gif" width="314" height="17" alt="Сомневаетесь? Узнайте о наших гарантиях!" title="Сомневаетесь? Узнайте о наших гарантиях!"></a><br>';

	}

	else if (chapter == 'order') {

		document.all.order_image3.style.visibility = 'hidden';

	}

	else {

		document.all.right_bottom.innerHTML = '';

	}


	if (chapter != 'order') {

		document.all.order_image3.style.visibility = 'visible';

	}


	if (document.all[chapter + '_image']) {

		document.all[chapter + '_image'].style.cursor = 'default';

	}

	if (document.all[chapter + '_image2']) {

		document.all[chapter + '_image2'].style.cursor = 'default';

	}

	if (document.all[chapter + '_image3']) {

		document.all[chapter + '_image3'].style.cursor = 'default';

	}


	if (lastObj && lastObj != obj) {

		lastObj.style.cursor = 'pointer';
		lastObj.style.textDecoration = 'underline';

		if (document.all[lastObjTitle + '_image']) {

			document.all[lastObjTitle + '_image'].style.cursor = 'pointer';

		}

		if (document.all[lastObjTitle + '_image2']) {

			document.all[lastObjTitle + '_image2'].style.cursor = 'pointer';

		}

		if (document.all[lastObjTitle + '_image3']) {

			document.all[lastObjTitle + '_image3'].style.cursor = 'pointer';

		}

	}


	if (document.all.order_image) {

		if (chapter == 'order' || chapter == 'contacts') {

			document.all.order_image.style.display = 'none';

		}

		else {

			document.all.order_image.style.display = '';

		}

	}

	lastObj = obj;
	lastObjTitle = chapter;

}



function loadSubContent(id) {

	if (lastSubcontentObj) {

		document.all['result_subcontent_' + lastSubcontentObj].style.display = 'none';
		document.all['result_subcontent_' + lastSubcontentObj + '_link'].src = '/img/bullets/client_1.gif';
		document.all['result_subcontent_' + lastSubcontentObj + '_link'].style.cursor = 'pointer';
		document.all['result_subcontent_' + lastSubcontentObj + '_link'].className = 'passive';

	}


	if (document.all['result_subcontent_' + id].innerHTML != '') {

		document.all['result_subcontent_' + id].style.display = '';

	}

	else {

		loadRemoteSubcontent(id);

	}

	document.all['result_subcontent_' + id + '_link'].src = '/img/bullets/client_2.gif';
	document.all['result_subcontent_' + id + '_link'].style.cursor = 'default';
	document.all['result_subcontent_' + id + '_link'].className = '';

	document.all.current_url.innerHTML = '/' + globalChapter + '/' + clientsArr[id] + '/';
	document.all.current_url.parentNode.setAttribute('href', '/' + globalChapter + '/' + clientsArr[id] + '/');

	lastSubcontentObj = id;

}



function sendOrder() {

	if (document.all['order[phone]'].value.length < 5 && document.all['order[email]'].value.length < 5) {

		document.all.send_order_error.innerHTML = 'К сожалению, отправляя запрос без указания хотя бы одного из своих контактов,<br>Вы лишаете нас возможности ответить на Ваш запрос.';

		return;

	}

	xmlHttp = GetXmlHttpObject();

	var postForm = 'name=' + document.all['order[name]'].value + '&url=' + document.all['order[url]'].value + '&keywords=' + document.all['order[keywords]'].value + '&phone=' + document.all['order[phone]'].value + '&email=' + document.all['order[email]'].value;
	xmlHttp.onreadystatechange = sendOrderSubmit;
	xmlHttp.open('POST', '/send_order.php', true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", postForm.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(postForm);

}



function sendOrderSubmit() {

	if (xmlHttp.readyState == 4) {

		if (xmlHttp.status == 200) {

			if (xmlHttp.responseText == 'limit') {

				var message = 'Извините, но вы не можете отправлять более 5 запросов в минуту. Через полминуты при необходимости Вы снова сможете отправить запрос.';

			}

			else if (xmlHttp.responseText == 'ok') {

				var message = 'Спасибо, информация отправлена.';

			}

			document.all.send_order_error.innerHTML = message;

		}

	}

}



function switchContacts(id) {

	var images1Arr = document.all['contacts_icon_' + id].getElementsByTagName('img');

	if (lastContactsID) {

		var images2Arr = document.all['contacts_icon_' + lastContactsID].getElementsByTagName('img');

		images2Arr[1].style.display = 'none';
		images2Arr[0].style.display = '';
		images2Arr[0].style.cursor = 'pointer';
		document.all['contacts_' + lastContactsID + '_content'].style.display = 'none';
		document.all['contacts_map_' + lastContactsID].style.display = 'none';

	}

	images1Arr[0].style.display = 'none';
	images1Arr[1].style.display = '';
	images1Arr[1].style.cursor = 'default';
	document.all['contacts_' + id + '_content'].style.display = '';
	document.all['contacts_map_' + id].style.display = '';

	lastContactsID = id;

}

//-->