document.write("<script src=\"http://www.allinform.ru/JsHttpRequest.js\" type=\"text/JavaScript\"></script>");
document.write("<div class=\"boxtdiv\"><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"boxtbl\">");
document.write("<tr>");
document.write("<td class=\"box\">");
document.write("<form name=\"searchbox\" method=\"get\" action=\"\" onSubmit=\"if (this.bwhat.value != '' || this.bwhere.value != '') {if (this.bwhat.value == 'компания, ключевые слова') {this.bwhat.value = ''}; if (this.bwhere.value == 'улица, район, метро') {this.bwhere.value = ''}; get_em(this.bwhat.value, this.bwhere.value, 0, aiocnt, aifid_, aifid)}; return false;\">");
document.write("<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" width=\"100%\">");
document.write("<tr>");
if (feed == 1) {
document.write("<td width=\"35\" align=\"right\" class=\"ttd\">Что:</td>");
document.write("<td><input name=\"bwhat\" class=\"allinput\" value=\"компания, ключевые слова\" onFocus=\"if (this.value == 'компания, ключевые слова' || this.value == '') {this.value=''; this.style.color='#000000';}\" onBlur=\"if (this.value == '') {this.value='компания, ключевые слова'; this.style.color='#999999';}\"></td>");
}
else {
document.write("<td width=\"5%\" align=\"right\" class=\"ttd\">Что:</td>");
document.write("<td width=\"40%\"><input name=\"bwhat\" class=\"allinput\" value=\"компания, ключевые слова\" onFocus=\"if (this.value == 'компания, ключевые слова' || this.value == '') {this.value=''; this.style.color='#000000';}\" onBlur=\"if (this.value == '') {this.value='компания, ключевые слова'; this.style.color='#999999';}\"></td>");
}
if (feed == 1) {
document.write("</tr>");
document.write("<tr>");
}
if (feed == 1) {
document.write("<td width=\"35\" align=\"right\" class=\"ttd\">Где:</td>");
document.write("<td><input name=\"bwhere\" class=\"allinput\" value=\"улица, район, метро\" onFocus=\"if (this.value == 'улица, район, метро' || this.value == '') {this.value=''; this.style.color='#000000';}\" onBlur=\"if (this.value == '') {this.value='улица, район, метро'; this.style.color='#999999';}\"></td>");
}
else {
document.write("<td width=\"5%\" align=\"right\" class=\"ttd\">&nbsp;&nbsp;Где:</td>");
document.write("<td width=\"40%\"><input name=\"bwhere\" class=\"allinput\" value=\"улица, район, метро\" onFocus=\"if (this.value == 'улица, район, метро' || this.value == '') {this.value=''; this.style.color='#000000';}\" onBlur=\"if (this.value == '') {this.value='улица, район, метро'; this.style.color='#999999';}\"></td>");
}
if (feed == 1) {
document.write("</tr>");
document.write("<tr>");
document.write("<td colspan=\"2\" height=\"5\"></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=\"left\"><a target=\"_blank\" style=\"font-family: Arial, sans-serif; color: #000099; font-size: 11px; border: none; margin-top: 5px; text-decoration: underline;\" href=\"http://allinform.ru\">allinform.ru</a></td><td align=\"right\"><input type=\"submit\" name=\"search_it\" value=\"Найти\" class=\"allbutton\"></td>");
}
else {
document.write("<td width=\"8\">&nbsp;</td><td align=\"center\"><input type=\"submit\" name=\"search_it\" value=\"Найти\" class=\"allbutton\" style=\"margin: 1px 0 0 5px;\"></td>");
document.write("</tr><tr><td colspan=\"2\" align=\"left\" style=\"padding-top: 5px;\"><a target=\"_blank\" style=\"font-family: Arial, sans-serif; color: #000099; font-size: 11px; border: none; text-decoration: underline;\" href=\"http://allinform.ru\">allinform.ru</a></td>");
}
document.write("</tr>");
document.write("</table></form>");
//document.write("<p class=\"mrg\" align=\"center\">");
//document.write("<a class=\"fnt\" target=\"_blank\" href=\"http://www.allinform.ru\">Телефонный справочник www.allinform.ru</a>");
//document.write("<p class=\"mrg\">");
document.write("</td>");
document.write("</tr>");
document.write("</table>");
document.write("<br><div id=\"reslt\" class=\"rslt\"></div></div>");
function get_em(what,where,page,ocnt,fid_,fid) {
	if (what.replace(/^\s+|\s+$/g,'').length != 0 || where.replace(/^\s+|\s+$/g,'').length != 0) {
		document.getElementById('reslt').innerHTML = 'Идет поиск...';
		//alert(what + '|' + where + '|' + page + '|' + ocnt + '|' + fid_ + '|' + fid);
		JsHttpRequest.query(
			'http://www.allinform.ru/getForeignItems.php',
			{
				'what': what.replace(/^\s+|\s+$/g,''),
				'where': where.replace(/^\s+|\s+$/g,''),
				'page': page,
				'ocnt': ocnt,
				'fid_': fid_,
				'fid': fid,
				'hhost': location.hostname
			},
			function(result, errors) {
				document.getElementById('reslt').innerHTML = result['Content'];
				//if (errors)
					//alert(errors);
			},
			true
		);
	}
}
