

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.person_127.value='';");
	
	
document.writeln ("	form['subtrouble'].value = 0; form['subtrouble'].onchange();");

	
document.writeln ("   form.contact_email_127.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 = /^.+$/; ");
	
document.writeln ("	str = form.person_127.value;");
document.writeln ("	if( document.getElementById( 'fontperson_127' ) != 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 ("	str = form.contact_email_127.value;");
document.writeln ("	if( document.getElementById( 'fontcontact_email_127' ) != 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 ("	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' >Имя отправителя");
document.writeln ("</td><td class='support_field_values' ><font class='support_marker' id='fontperson_127' >*</font><input type='text' id='person_127' name='person_127' value='' class='support_text'></td></tr>");






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_127' >*</font><input type='text' id='contact_email_127' name='contact_email_127' value='' class='support_text'></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' >");
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_127\").innerHTML = \"\"; return false;}; ");
document.writeln ("obj = document.getElementById(\"script_127\"); 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='404'>Разблокировать IP (удалить IP из черного списка)</option>");

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


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



document.writeln ("<tr><td class='support_field_titles' >");
document.writeln ("</td><td class='support_field_values' ></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='127'><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>");
