

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

	
document.writeln ("   form.contact_email_495.value='';");
	
	
document.writeln ("	if( form['subtrouble'] ) { form['subtrouble'].value = 0; form['subtrouble'].onchange(); }");

	
document.writeln ("   form.messagetext_495.value='';");
	
	
document.writeln ("	if( form['subtrouble'] ) { 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_495.value;");
document.writeln ("	if( document.getElementById( 'fontperson_495' ) != 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_495.value;");
document.writeln ("	if( document.getElementById( 'fontcontact_email_495' ) != 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 = /^(.){0,700}$/im; ");
	
document.writeln ("	str = form.messagetext_495.value;");
document.writeln ("	if( document.getElementById( 'fontmessagetext_495' ) != 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' >Имя отправителя");
document.writeln ("</td><td class='support_field_values' ><font class='support_marker' id='fontperson_495' >*</font><input type='text' id='person_495' name='person_495' 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_495' >*</font><input type='text' id='contact_email_495' name='contact_email_495' value='' class='support_text'></td></tr>");




document.writeln ("<tr><td class='support_field_titles' >Выберите тему сообщения");
document.writeln ("</td><td class='support_field_values' ><select name='problem_f_495' class='support_select'><option value='проблема с загрузкой'>проблема с загрузкой</option><option value='авторское право'>авторское право</option><option value='нарушение правил размещения'>нарушение правил размещения</option><option value='пожаловаться на фото'>пожаловаться на фото</option><option value='пожелания'>пожелания</option><option value='другие проблемы'>другие проблемы</option></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_495' >*</font><textarea id='messagetext_495' name='messagetext_495' 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_button' colspan='2' ><div class='support_buttons_DIV' >");
document.writeln ("<input type='hidden' name='project_id' value='25'><input type='hidden' name='lang' value='ru'><input type='hidden' name='request_send' value='1'><input type='hidden' name='trouble_id' value='495'><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>");
