/*YAHOO.namespace('example.container');
YAHOO.util.Event.addListener(window, 'load', init);

function init()
{
	// Инициализация окна
	YAHOO.example.container.info_window	= new YAHOO.widget.Panel("info_window",  { modal: true, fixedcenter: true, visible: false, zindex: 101, width:"500px" } );
	YAHOO.example.container.info_window.render();
}

function show_image(name, image, window_width)
{
	YAHOO.example.container.info_window.setHeader(name);
	YAHOO.example.container.info_window.setBody('<img src="' + image + '" border="0" alt="' + name + '"/>');
	document.getElementById('info_window').style.width = window_width + 'px';
	document.getElementById('info_window_bd').style.padding = '0px';
	YAHOO.example.container.info_window.show();
	YAHOO.example.container.info_window.render();
}*/

function sendForm(form_name)
{
	if (form_name == undefined)
		form_name	= 'frm_main';
	
	document.getElementById(form_name).submit();
}

// Проверить выбрал ли вариант ответа пользователь
function checkVoice()
{
	can_submit	= false;
	
	for (i = 0; i < document.frm_voices.answer_id.length; i++)
	{
		if (document.frm_voices.answer_id[i].checked)
			can_submit	= true;
	}
	
	if (can_submit == false)
		alert('Не выбран вариант ответа на вопрос.');
	
	return can_submit;
}

// Показать результаты голосования
function showResult()
{
	if (document.getElementById('question-voices').style.display == 'none')
	{
		document.getElementById('question-voices').style.display	= 'block';
		document.getElementById('question-results').style.display	= 'none';
		document.getElementById('link_results').innerHTML			= 'Результаты';
	}
	else
	{
		document.getElementById('question-voices').style.display	= 'none';
		document.getElementById('question-results').style.display	= 'block';
		document.getElementById('link_results').innerHTML			= 'Голосовать';
	}
}

var captions_info	= new Array();

captions_info['name']		= 'Имя *';
captions_info['mail']		= 'Е-mail *';
captions_info['message']	= 'Сообщение *';
captions_info['company']	= 'Организация';
captions_info['postal_index']	= 'Почтовый индекс';
captions_info['address']	= 'Адрес';
captions_info['phone']		= 'Телефон';

// Убираем надпись из input'а
function input_focus(element)
{
	if (element.value == captions_info[element.id])
		element.value	= '';
}

// Возвращаем надпись в input
function input_blur(element)
{
	if (element.value == '')
		element.value	= captions_info[element.id];
}

// Посмотреть список телепередач
function load_filter(page)
{
	location.href	= '../../' + page + '/' + document.getElementById('parent_id').value + '.html';
	
	return false;
}

// Начало тестирования
function getCode()
{
	var url			= './docs/code.php';
	
	var request		= YAHOO.util.Connect.asyncRequest('GET', url, {success:function(o){  document.getElementById('code').value = o.responseText; }, failure: null });

	return false;
}

// Процедура замеры подстроки
function replace(search, replace, subject)
{
	var ra = replace instanceof Array,
		sa = subject instanceof Array,
		l = (search = [].concat(search)).length,
		replace = [].concat(replace),
		i = (subject = [].concat(subject)).length;
	while(j = 0, i--)
		while(subject[i] = subject[i].split(search[j]).join(ra ? replace[j] || "" : replace[0]), ++j < l);
	return sa ? subject : subject[0];
 }
 
// После загрузки страницы
function onLoadPage()
{
	document.getElementById('informer1').innerHTML = replace('http://www.gismeteo.RU', 'http://www.gismeteo.ru/city/daily/5093', document.getElementById('informer1').innerHTML);
}