function submitsSearch() {
	document.search_form.submit();
}

function winopen(url, w, h) {
	var x = (screen.width-w)/2;
	var y = (screen.height-h)/2;
	w = window.open(url,'node_props','resizable=yes,toolbar=no,location=no,directories=no,status=no,menubar=yes,width='+w+', height='+h+',scrollbars=yes,fullscreen=no,top='+x+', left='+y);
	w.focus();
}

function go()
{
	box = document.forms[0].navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}
function sh(form){
	if (form=='emp'){
		document.getElementById('hide_form').innerHTML=form_employer();
		form_show('hide_form');
	}
	if(form=='see'){
		document.getElementById('hide_form_see').innerHTML=form_seeker();
		form_show('hide_form_see');
	}
}

function form_show(form){
	elem = document.getElementById(form);
	elem.style.display = "block";
}

function form_hide(form)
{
	elem = document.getElementById(form);
	document.getElementById(form).innerHTML=''
}

function form_employer(){
	var form =
	'<table width="100%" align="center" cellpadding="3" cellspacing="3">\
<tr align="right">\
	<td>&nbsp;</td><td align="right"><font color="red"><a onclick="form_hide(\'hide_form\');">скрыть</a></font></td></tr>\
<tr>\
	<td  align="left">Название компании:</td>\
	<td  align="left"><input style="width:271px;" name="NameCompany_emp" value="Название компании:" class="inputtype_my"></td>\
</tr>\
<tr>\
	<td  align="left">Адрес:</td>\
	<td  align="left"><input style="width:271px;" name="Adress_emp" value="dqwdqwdqwdqwd" class="inputtype_my"></td>\
</tr>\
<tr>\
	<td  align="left">Телефон:</td>\
	<td  align="left"><input style="width:271px;" name="Telephone_emp" value="Телефон:" class="inputtype_my"></td>\
</tr>\
<tr>\
	<td  align="left">Вебсайт:</td>\
	<td  align="left"><input style="width:271px;" name="WebSite_emp" value="Вебсайт:" class="inputtype_my"></td>\
</tr>\
<tr>\
	<td  align="left">ICQ:</td>\
	<td  align="left"><input style="width:271px;" name="ICQ_emp" value="ICQ:" class="inputtype_my"></td>\
</tr>\
<tr>\
	<td valign="top">О компании: (до 3000 символов)</td>\
	<td><textarea name="About_emp" rows="8" class="textareatype" style="width:271px;">О компании: (до 3000 символов)</textarea></td>\
</tr>\
</table>\
<br>\
<center>\
<input type="hidden" value="employer" name="reg_emp">\
<input type="hidden" value="emp" name="sh_emp">\
</center>\
';

	return form;
}

function form_seeker(){
	var form =
	'<table width="100%" align="center" cellpadding="3" cellspacing="3">\
<tr align="right"><td>&nbsp;</td><td align="right"><font color="red"><a onclick="form_hide(\'hide_form_see\');">скрыть</a></font></td></tr>\
\
<tr>\
	<td  align="left">Телефон:</td>\
	<td  align="left"><input style="width:271px;" name="Telephone_see" value="Телефон:" class="inputtype_my"></td>\
</tr>\
<tr>\
	<td  align="left">ICQ:</td>\
	<td  align="left"><input style="width:271px;" name="ICQ_see" value="qwdqwdqwd" class="inputtype_my"></td>\
</tr>\
<tr>\
	<td valign="top">Дополнительно:</td>\
	<td><textarea name="About_see" rows="8" class="textareatype" style="width:271px;">Дополнительно: 	</textarea></td>\
</tr>\
</table>\
<br>\
<center>\
<input type="hidden" value="seeker" name="reg_see">\
<input type="hidden" value="see" name="sh_see">\
';

	return form;
}





function comment(count,rId){
	document.getElementById('add-comm'+count).innerHTML=form(rId);
	elem.style.display = "block";
}

function form_hide(count)
{
	document.getElementById('add-comm'+count).innerHTML='';
	elem.style.display = "block";

}

function form(rId){
	var comment_form = '<form method="POST">\
	<table class="add_infa" cellspacing="0" cellpadding="0">\
		<tr>\
			<td class="td_add_infa">Ваше имя<font color="Red">*</font>:</td>\
			<td class="width_100"><span><input style="width:250px" type="text" name="userName" value=""></span></td>\
		</tr>\
		<tr>\
			<td class="td_add_infa">Email:</td>\
			<td class="width_100"><span><input style="width:250px" type="text" name="userEmail" value=""></span></td>\
		</tr>\
		<tr>\
			<td class="td_add_infa">Текст<font color="Red">*</font>:</td>\
			<td class="width_100"><span><textarea style="width:250px" rows="6" name="userContent"></textarea></span></td>\
		</tr>\
		<tr>\
			<td colspan="2"><input type="submit" value="Добавить коментарий"></td>\
		</tr>\
	</table>\
	<input type="hidden" name="coment" value="save">\
	<input type="hidden" name="id_comment" value="'+rId+'">\
</form>\
<br>\
';
	return comment_form;
}

function confirmLink(theLink, theSqlQuery)
{
	var is_confirmed = confirm(theSqlQuery);
	return is_confirmed;
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=0'
	var mywin = window.open(mypage,myname,settings)
	mywin.focus();
}

function iFrameHeight(iframe, rows) {
	var offset;
	if(rows == 0){
		offset = 50;
	}else{
		offset = 0;
	}

	if(document.getElementById && !(document.all)) {
		h = document.getElementById(iframe).contentDocument.body.scrollHeight;
		document.getElementById(iframe).style.height = rows * 80 + offset;
	}else if(document.all) {
		h = document.frames(iframe).document.body.scrollHeight;
		document.frames(iframe).style.height = rows * 80 + offset;
	}
}

function addImg(mes){
	document.getElementById('content').value = document.getElementById('content').value + ' ' + mes;
	return false;
}

function addFile(mes,mes2){
	document.getElementById('content').value = document.getElementById('content').value + ' ((' + mes + ' ' + mes2 + '))';
	return false;
}

function unhide(elementName){
	document.getElementById(elementName).style.display="";
}

function hide(elementName){
	document.getElementById(elementName).style.display="none";
}



function showAll(name){
	if(document.getElementById(name).style.display == 'none'){
		unhide(name);
		unhide('links');
		unhide('props');
		unhide('ads');
		unhide('hideall');
		hide('showall');
	}else{
		hide(name);
		hide('props');
		hide('links');
		hide('ads');
		hide('hideall');
		unhide('showall');
	}
}


function showVersions(){
	hide('noversions');
	unhide('versions');
}


	var bInfo = function () {
		
		var C = true;
		var D = navigator.platform;
		var B = navigator.userAgent;
		var A = {
			gecko: /Gecko/.test(B) && !/like Gecko/.test(B),
			webkit: /WebKit/.test(B),
			aol: /America Online Browser/.test(B),
			camino: /Camino/.test(B),
			firefox: /Firefox/.test(B),
			flock: /Flock/.test(B),
			icab: /iCab/.test(B),
			konqueror: /KDE/.test(B),
			mozilla: /mozilla/.test(B),
			msie: /MSIE/.test(B),
			netscape: /Netscape/.test(B),
			opera: /Opera/.test(B),
			safari: /Safari/.test(B),
			browser: /(MSIE|Firefox|Opera|Safari|KDE|iCab|Flock)/.exec(B)[0],
			win: /Win/.test(D),
			mac: /Mac/.test(D),
			linux: /Linux/.test(D),
			iphone: /iPhone/.test(D),
			OS: /(Win|Mac|Linux|iPhone)/.exec(D)[0],
			platform: D,
			agent: B,
			addSelectors: function () {
				jQuery(arguments[0] || "html").addClass([this.renderer, this.browser, this.browser + this.version.major, this.OS, "js"].join(" ").toLowerCase())
			},
			removeSelectors: function () {
				jQuery(arguments[0] || "html").removeClass([this.renderer, this.browser, this.browser + this.version.major, this.OS, "js"].join(" ").toLowerCase())
			}
		};
		A.renderer = (A.gecko) ? "gecko" : (A.webkit) ? "webkit" : "";
		A.version = {};
		A.version.string = (A.msie) ? /MSIE ([^;]+)/.exec(B)[1] : (A.firefox) ? /Firefox\/(.+)/.exec(B)[1] : (A.safari) ? /Version\/([^\s]+)/.exec(B)[1] : (A.opera) ? /Opera\/([^\s]+)/.exec(B)[1] : "";
	
		A.version.number = parseFloat(A.version.string);
		A.version.major = /([^\.]+)/.exec(A.version.string)[1];
		document.getElementsByTagName("html")[0].className=[A.renderer, A.browser, A.browser + A.version.major, A.OS, "js"].join(" ").toLowerCase();
		//document.getElementById("page").className=[A.renderer, A.browser, A.browser + A.version.major, A.OS, "js"].join(" ").toLowerCase();
		
		
	} ;
	bInfo();
