

document.writeln ("<form name='support' action='http://support2.relax.ru/getform.php' method='POST'>");
document.writeln ("<script> window.ChildCheckValues = function (form){return true;}");


document.writeln (" function drop_clon(el) 	");
document.writeln (" {    ");
document.writeln (" 	while (el.tagName != 'DIV')    ");
document.writeln (" 		el = el.parentNode;    ");
document.writeln (" 	if (el.parentNode.getElementsByTagName('DIV').length > 1)     ");
document.writeln (" 	{        ");
document.writeln (" 		el.parentNode.removeChild( el );    ");
document.writeln (" 	}");
document.writeln (" }");
document.writeln (" function add_clon(el) ");
document.writeln (" {    ");
document.writeln (" 	while (el.tagName != 'DIV')    ");
document.writeln (" 		el = el.parentNode;    ");
document.writeln (" 	if (el.parentNode.getElementsByTagName('DIV').length < 10) ");
document.writeln (" 	{        ");
document.writeln (" 		var newel = el.parentNode.insertBefore(el.cloneNode(true),el.nextSibling);        ");
document.writeln (" 		list = newel.getElementsByTagName('input');        ");
document.writeln (" 		for (i=0; i<list.length; i++) ");
document.writeln (" 		{            ");
document.writeln (" 			if (list[i].type == 'text')");
document.writeln (" 			{list[i].value = '';}        ");
document.writeln (" 		}");
document.writeln (" 	}");
document.writeln (" }");
document.writeln (" function drop_clon_extra(el) 	");
document.writeln (" {    ");
document.writeln (" 	while (el.tagName != 'DIV')    ");
document.writeln (" 		el = el.parentNode;    ");
document.writeln (" 	if (el.parentNode.getElementsByTagName('DIV').length > 2)     ");
document.writeln (" 	{        ");
document.writeln (" 		el.parentNode.removeChild( el );    ");
document.writeln (" 	}");
document.writeln (" }");
document.writeln (" function add_clon_extra(el) ");
document.writeln (" {    ");
document.writeln (" 	while (el.tagName != 'DIV')    ");
document.writeln (" 		el = el.parentNode;    ");
document.writeln (" 	if (el.parentNode.getElementsByTagName('DIV').length < 20) ");
document.writeln (" 	{        ");
document.writeln (" 		var newel = el.parentNode.insertBefore(el.cloneNode(true),el.nextSibling);        ");
document.writeln (" 		list = newel.getElementsByTagName('input');    input_count = 0;    ");
document.writeln (" 		for (i=0; i<list.length; i++) ");
document.writeln (" 		{            ");
document.writeln (" 			if (list[i].type == 'text')");
document.writeln (" 			{ input_count++; if( input_count == 2 ) {list[i].style.display = 'none'; } list[i].value = '';} ");
document.writeln (" 		}");
document.writeln (" 	}");
document.writeln (" }");


document.writeln (" function show_other_field(el) ");
document.writeln (" {   var sel = el; ");
document.writeln ("   	my_id = el.name; el = el.parentNode;");
document.writeln ("   	list = el.getElementsByTagName( 'input' ); input_count = 0;");
document.writeln ("   	for( i = 0; i < list.length; i++ )");
document.writeln ("   	{");
document.writeln ("   	 	if (list[i].type == 'text')");
document.writeln ("   		{ input_count++;");
document.writeln ("   			if( input_count == 2 )");
document.writeln ("   			{");
document.writeln ("   				if( sel.options[ sel.selectedIndex ].value == '' )");
document.writeln ("   				{ list[i].style.display = 'inline'; } ");
document.writeln ("   				else");
document.writeln ("   				{ list[i].value = ''; list[i].style.display = 'none'; }");
document.writeln ("   			}");
document.writeln ("   		}");
document.writeln ("   	}");
document.writeln ("   	list_div = el.getElementsByTagName( 'div' ); ");
document.writeln ("   	for( i = 0; i < list_div.length; i++ )");
document.writeln ("   	{");
document.writeln ("   			if( sel.options[ sel.selectedIndex ].value == '' )");
document.writeln ("   			{ list_div[i].style.display = 'inline'; } ");
document.writeln ("   			else");
document.writeln ("   			{ list_div[i].style.display = 'none'; }");
document.writeln ("   	}");
document.writeln (" } ");


document.writeln ("function ClearValues(form)");
document.writeln ("{");

	
document.writeln ("   form.contact_email_311.value='';");
	
	
document.writeln ("	form['subtrouble'].value = 0; form['subtrouble'].onchange();");

	
document.writeln ("   form.person_311.value='';");
	
	
document.writeln ("	form['subtrouble'].value = 0; form['subtrouble'].onchange();");

	
	
document.writeln ("	var i; i=0;");
document.writeln ("	str = '';");
document.writeln ("	while( i < form['mail_extra_311[]'].length )");
document.writeln ("	{");
document.writeln ("		form['mail_extra_311[]'][i].value = '';");
document.writeln ("		i++;");
document.writeln ("	}");
	
document.writeln ("	form['subtrouble'].value = 0; form['subtrouble'].onchange();");

	
document.writeln ("   form.messagetext_311.value='';");
	
	
document.writeln ("	form['subtrouble'].value = 0; form['subtrouble'].onchange();");

document.writeln ("}");



document.writeln ("function GetCheckTemplateForField( fieldType )");
document.writeln ("{");
document.writeln ("	if( fieldType == 9 )");
document.writeln ("	{");
document.writeln ("		fieldCountForOneValue = 2; ");
document.writeln ("		return fieldCountForOneValue;");
document.writeln ("	}");
document.writeln ("	if( fieldType == 8 )");
document.writeln ("	{");
document.writeln ("		fieldCountForOneValue = 7; ");
document.writeln ("		return fieldCountForOneValue;");
document.writeln ("	}");
document.writeln ("	if( fieldType == 12 )");
document.writeln ("	{");
document.writeln ("		fieldCountForOneValue = 3; ");
document.writeln ("		return fieldCountForOneValue;");
document.writeln ("	}");
document.writeln ("	return -1;");
document.writeln ("}");



document.writeln ("function CheckValues (form)");
document.writeln ("{ ");
document.writeln ("	var re;");
document.writeln ("	var res = true;");
document.writeln ("	var str = '';");
document.writeln ("	var i; var mes=\"\";");
	
document.writeln ("	re = /^[A-z0-9_\.\-]+\@[A-z0-9_\.\-]+[\.]{1}[a-z]{2,4}$/i; ");
	
document.writeln ("	str = form.contact_email_311.value;");
document.writeln ("	if( document.getElementById( 'fontcontact_email_311' ) != false ){ if( str == '' ){ mes = 'Не заполнено обязательное поле\\n'; res = false; } }");
document.writeln (" str = str.replace( /\\r\\n/g, \"\" );");
document.writeln ("	if (!re.test(str))");
document.writeln ("	{");
document.writeln ("		mes += 'Неверно заполнено поле &quot;Контактный e-mail&quot;\\n';");
document.writeln ("		mes = mes.replace( /&quot;/g, '\"' ); ");
document.writeln ("		res = false;");
document.writeln ("	}");
	
	
	
	
	
	
document.writeln ("	re = /^.+$/; ");
	
document.writeln ("	str = form.person_311.value;");
document.writeln ("	if( document.getElementById( 'fontperson_311' ) != false ){ if( str == '' ){ mes = 'Не заполнено обязательное поле\\n'; res = false; } }");
document.writeln (" str = str.replace( /\\r\\n/g, \"\" );");
document.writeln ("	if (!re.test(str))");
document.writeln ("	{");
document.writeln ("		mes += 'Имя отправителя введено неверно\\n';");
document.writeln ("		mes = mes.replace( /&quot;/g, '\"' ); ");
document.writeln ("		res = false;");
document.writeln ("	}");
	
	
	
	
	
	
document.writeln ("	re = /^[A-z0-9_\.\-]+\@[A-z0-9_\.\-]+[\.]{1}[a-z]{2,4}$/i; ");
	
	
	
	
document.writeln ("	b=0 ; i=0 ; ");
document.writeln ("	fields_per_block = GetCheckTemplateForField( 12 );");
document.writeln ("	field_blocks = form['mail_extra_311[]'].length / fields_per_block;");
document.writeln ("	while ( b < field_blocks )");
document.writeln ("	{ 	");
document.writeln ("	 	j = 0; str = '';");
document.writeln ("		while ( j < fields_per_block )");
document.writeln ("		{");
document.writeln ("			str += form['mail_extra_311[]'][ b*fields_per_block + j ].value;");
document.writeln ("			j++;");
document.writeln ("		}");
document.writeln ("		if (!re.test(str) || form['mail_extra_311[]'][ b*fields_per_block + 0 ].value.length == 0  || form['mail_extra_311[]'][ b*fields_per_block + 0 ].value.length == 0 )");
document.writeln ("		{");
document.writeln ("			mes += 'Неверно заполнено поле &quot;Ящик, о котором хотите задать вопрос&quot;\\n';");
document.writeln ("			mes = mes.replace( /&quot;/g, '\"' ); ");
document.writeln ("			res = false;");
document.writeln ("		}");
document.writeln ("		b++;");
document.writeln ("	}");
	
	
	
document.writeln ("	re = /^(.){0,700}$/im; ");
	
document.writeln ("	str = form.messagetext_311.value;");
document.writeln ("	if( document.getElementById( 'fontmessagetext_311' ) != false ){ if( str == '' ){ mes = 'Не заполнено обязательное поле\\n'; res = false; } }");
document.writeln (" str = str.replace( /\\r\\n/g, \"\" );");
document.writeln ("	if (!re.test(str))");
document.writeln ("	{");
document.writeln ("		mes += 'Текст сообщения введен неверно. Размер текста не должен превышать 700 символов.\\n';");
document.writeln ("		mes = mes.replace( /&quot;/g, '\"' ); ");
document.writeln ("		res = false;");
document.writeln ("	}");
	
	
	
	
	
	
	
document.writeln ("	if ( form.subtrouble.value == 0)");
document.writeln ("	{");
document.writeln ("		mes += 'Не выбрана тема сообщения\\n';");
document.writeln ("		res = false;");
document.writeln ("	}");

document.writeln ("	if(!ChildCheckValues(form)) {res = false;} if (res == false && mes != '') alert(mes); return res;");
document.writeln ("} ");
document.writeln ("</script>");
document.writeln ("<table id=\"megaTable\" cellpadding='0' cellspacing='0' border='0' class='support_table_class' >");






document.writeln ("<tr><td class='support_field_titles' >Контактный e-mail");
document.writeln ("</td><td class='support_field_values' ><font class='support_marker' id='fontcontact_email_311' >*</font><input type='text' id='contact_email_311' name='contact_email_311' value='' class='support_text'></td></tr>");






document.writeln ("<tr><td class='support_field_titles' >Имя отправителя");
document.writeln ("</td><td class='support_field_values' ><font class='support_marker' id='fontperson_311' >*</font><input type='text' id='person_311' name='person_311' value='' class='support_text'></td></tr>");






document.writeln ("<tr><td class='support_field_titles' >Ящик, о котором хотите задать вопрос");
document.writeln ("</td><td class='support_field_values' ><font class='support_marker' id='fontmail_extra_311' >*</font><DIV class='support_site_extra_DIV' ><DIV><nobr><input type='text' id='mail_extra_311[]'  name='mail_extra_311[]' value='' class='support_site_extra'> <select name='mail_extra_311[]' onchange='show_other_field(this)' class='support_site_extra'><option value=''>-----</option><option value='@pochta.ru'>@pochta.ru</option><option value='@fromru.com'>@fromru.com</option><option value='@front.ru'>@front.ru</option><option value='@hotbox.ru'>@hotbox.ru</option><option value='@krovatka.net'>@krovatka.net</option><option value='@land.ru'>@land.ru</option><option value='@mail15.com'>@mail15.com</option><option value='@mail333.com'>@mail333.com</option><option value='@pisem.net'>@pisem.net</option><option value='@pochtamt.ru'>@pochtamt.ru</option><option value='@pop3.ru'>@pop3.ru</option><option value='@rbcmail.ru'>@rbcmail.ru</option><option value='@smtp.ru'>@smtp.ru</option><option value='@newmail.ru'>@newmail.ru</option><option value='@nightmail.ru'>@nightmail.ru</option><option value='@nm.ru'>@nm.ru</option><option value='@hotmail.ru'>@hotmail.ru</option><option value='' >другой домен</option></select> <input type='button' class='support_site_extra_button' value='+' onclick='add_clon_extra(this);'> <input type='button' class='support_site_extra_button' value='&#8211;' onclick='drop_clon_extra(this);'><br/><div id='support_site_extra_titlemail_extra_311[]' style='display:none' class='support_site_extra_title' >другой домен </div><input type='text' style='display:none' id='mail_extra_311[]' name='mail_extra_311[]' value='' class='support_site_extra_field' ></nobr></DIV></DIV></td></tr>");




document.writeln ("<tr><td class='support_field_titles' >");
var addr = "http://support2.relax.ru/scripts/pochta/ru/trouble_";
document.writeln ("Выберите тему Вашего сообщения</td><td class='support_field_values' ><font class='support_marker' >*</font><select name='subtrouble' id='subtrouble' class='subject_select_class' onchange=' ");
document.writeln ("if(this.value == 0) { document.getElementById(\"script_311\").innerHTML = \"\"; return false;}; ");
document.writeln ("obj = document.getElementById(\"script_311\"); is_createdElement = 0;");
document.writeln ("scriptCollection = document.getElementsByTagName(\"SCRIPT\");  for( i = 0; i < scriptCollection.length; i++ ){ if( scriptCollection[i].src == \""+addr+"\"+this.value+\".js\" ){ is_createdElement = 0; scriptCollection[i].parentNode.removeChild(scriptCollection[i]  ); } } ");
document.writeln (" if( is_createdElement == 0 ) { script0 = document.createElement(\"SCRIPT\"); ");
document.writeln ("script0.src=\""+addr+"\"+this.value+\".js?a=\"+Math.random(); script0.charset=\"UTF-8\"; document.body.appendChild(script0); } ");
document.writeln ("'><option value='0'></option>");


document.writeln ("<option value='327'>Предложения и пожелания по усовершенствованию работы проекта</option>");

document.writeln ("<option value='388'>Почта на своем домене</option>");

document.writeln ("<option value='371'>Пожаловаться на сайт, нарушающий регламент(del)</option>");

document.writeln ("<option value='368'>Проблемы при работе через почтовый клиент</option>");

document.writeln ("<option value='363'>Проблемы с Web-интерфейсом почтового ящика</option>");

document.writeln ("<option value='362'>Регистрация</option>");

document.writeln ("<option value='361'>Ваша Реклама на Нашем сервисе</option>");

document.writeln ("<option value='358'>Спам</option>");

document.writeln ("<option value='354'>Авторизация</option>");

document.writeln ("<option value='349'>Почтовый ящик. Основы работы</option>");

document.writeln ("<option value='328'>Сайт</option>");


document.writeln ("</select></td></tr><tr><td colspan='2' id = 'script_311' class='master_dynamic_select' ></td></tr>");



document.writeln ("<tr><td class='support_field_titles' >Текст сообщения (до 700 символов)");
document.writeln ("</td><td class='support_field_values' ><font class='support_marker' id='fontmessagetext_311' >*</font><textarea id='messagetext_311' name='messagetext_311' class='support_textarea'></textarea></td></tr>");






document.writeln ("<tr><td class='support_field_titles' >Отправить мне копию");
document.writeln ("</td><td class='support_field_values' ><input type='checkbox' name='getacopy' value='1' class='support_checkbox'></td></tr>");






document.writeln ("<tr><td class='support_field_titles' >Если Вы пользуетесь WAP версией сайта, заполните, пожалуйста,следующие поля                     Оператор сотовой связи");
document.writeln ("</td><td class='support_field_values' ><select name='Operator_svyazi_311' class='support_select'><option value='-----'>-----</option><option value='Мегафон'>Мегафон</option><option value='Beeline'>Beeline</option><option value='МТС'>МТС</option><option value='Скай Линк'>Скай Линк</option></select></td></tr>");






document.writeln ("<tr><td class='support_field_titles' >Производитель телефона");
document.writeln ("</td><td class='support_field_values' ><select name='phone_manufacturer_311' class='support_select'><option value='----'>-----</option><option value='LG'>LG</option><option value='Motorola'>Motorola</option><option value='NEC'>NEC</option><option value='Nokia'>Nokia</option><option value='Pantech'>Pantech</option><option value='Philips'>Philips</option><option value='Samsung'>Samsung</option><option value='Siemens'>Siemens</option><option value='Sony-Ericsson'>Sony-Ericsson</option><option value='Другой'>Другой</option></select></td></tr>");





document.writeln ("<tr><td class='support_button' colspan='2' ><div class='support_buttons_DIV' >");
document.writeln ("<input type='hidden' name='project_id' value='9'><input type='hidden' name='lang' value='ru'><input type='hidden' name='request_send' value='1'><input type='hidden' name='trouble_id' value='311'><input type='submit' class='support_send_button_class' value='Отправить' onclick='return CheckValues(this.form);'><input type='button' class='support_clear_button_class' value='Очистить' onclick='return ClearValues(this.form);'>");
document.writeln ("</div></td></tr></table></form>");
