/*function popUpMenu(name){
	var stdBrowser = (document.getElementById)?true:false;
	var popUpSub = (stdBrowser)?document.getElementById(name).style:eval("document."+name);
	if(popUpSub.display == "block"){
		popUpSub.display = "none";
	}else{
		popUpSub.display = "block";
	}
}*/

function setBanner(elem){
	var stdBrowser = (document.getElementById)?true:false;
	var banObject = (stdBrowser)?document.getElementById(elem).style:eval("document."+elem);
	var tempSizeBan = parseInt(screen.width)-430;
	var size = (430)+(parseInt(tempSizeBan)/2)-(468/2);
	var errSize = parseInt(size)+468;
	if(parseInt(errSize) > parseInt(screen.width)){
		var size = parseInt(screen.width)-468-22;
	}
	if(document.all){
		banObject.pixelTop = 80;
		banObject.pixelLeft = parseInt(size);
	}else
	if(stdBrowser){
		banObject.top = 80+"px";
		banObject.left = parseInt(size)+"px";
	}else{
		banObject.top = 80;
		banObject.left = parseInt(size);
	}
	
}




function checkForm3(a, b, c, d){
	
	return true;
}

function checkForm4(a, b, c, d, e){
	
	return true;
	
}

function checkForm5f(a, b, c, d, e){
	
	return true;
	
}

function checkForm5(a, b, c, d, e, f){
	
	return true;
	
}

function checkForm6(a, b, c, d, e, f, g){
	
	return true;
	
}

function checkForm9f(a, b, c, d, e, f, g, h, i){
	
	return true;
	
}

function error_user(a){
	alert("Такое объявление уже имеется в списке!\n\r\n\rПожалуйста, не размещайте одинаковые объявления!");
	window.location = a;
}

function checkAdmin(a, b){
	if(a.value == ""){
		alert("Пожалуйста, заполните обязательное поле \"Логин\".");
		a.focus();
		return false;
	}
	if(b.value == ""){
		alert("Пожалуйста, заполните обязательное поле \"Пароль\".");
		b.focus();
		return false;
	}
}

function checkSpwd(a, b, c, d){
	if(a.value == ""){
		alert("Пожалуйста, заполните обязательное поле \"Старый Логин\".");
		a.focus();
		return false;
	}
	if(b.value == ""){
		alert("Пожалуйста, заполните обязательное поле \"Старый Пароль\".");
		b.focus();
		return false;
	}
	if(c.value == ""){
		alert("Пожалуйста, заполните обязательное поле \"Новый Логин\".");
		c.focus();
		return false;
	}
	if(d.value == ""){
		alert("Пожалуйста, заполните обязательное поле \"Новый Пароль\".");
		d.focus();
		return false;
	}
}

function checkSeml(a, b, c){
	if(c != "no"){
		if(a.value == ""){
			alert("Пожалуйста, заполните обязательное поле \"Старый E-mail\".");
			a.focus();
			return false;
		}
	}
	if(b.value == ""){
		alert("Пожалуйста, заполните обязательное поле \"Новый E-mail\".");
		b.focus();
		return false;
	}
}

function helps(a){
	if(a == "B"){
		document.forms.at.ishelp.value = "Жирный текст";
	}else
	if(a == "I"){
		document.forms.at.ishelp.value = "Наклонный текст";
	}else
	if(a == "U"){
		document.forms.at.ishelp.value = "Подчеркнутый текст";
	}else
	if(a == "QUOTE"){
		document.forms.at.ishelp.value = "Вставить цитату";
	}
}

function inserttag(a){
	var myAgent = navigator.userAgent.toLowerCase();
	var myVersion = parseInt(navigator.appVersion);
	var isIe = ((myAgent.indexOf("msie") != -1) && (myAgent.indexOf("opera") == -1));
	var isNav = ((myAgent.indexOf("mozilla") != -1) && (myAgent.indexOf("spoofer") == -1) && (myAgent.indexOf("compatible") == -1) && (myAgent.indexOf("opera") == -1) && (myAgent.indexOf("webtv") == -1) && (myAgent.indexOf("hotjava") == -1));
	var isWin = ((myAgent.indexOf("win") != -1) || (myAgent.indexOf("16bit") != -1));
	var isMac = (myAgent.indexOf("mac") != -1);
	var isObj = document.at.messageu;
	var isDoc = document.forms.at.messageu;
	if(a != "QUOTE"){
		var c = "-4";
	}else{
		var c = "-8";
	}
	if((myVersion >= 4) && isIe && isWin){
		if(isObj.isTextEdit){
			isDoc.focus();
			var sel = document.selection.createRange();
			if(sel.text){
				var oldText = sel.text;
				sel.text = "[" + a + "]" + oldText + "[/" + a + "]";
				var cur = isDoc.createTextRange()
				cur.collapse(false);
				cur.select();
			}else{
				sel.text = "[" + a + "][/" + a + "]";
				sel.moveEnd("character", c);
				sel.select();
			}
		}else{
			isDoc.focus()
			isDoc.value += "[" + a + "][/" + a + "]";
			var t = isDoc.setSelectionStart()
		}
	}else{
		isDoc.focus()
		isDoc.value += "[" + a + "][/" + a + "]";
		var t = isDoc.setSelectionStart()
	}
}

function checkA1(a, b, c, d, e, f){

	return true;
	
}

function checkA2(a, b, d, e, f){
	
	return true;
	
	
}

function delAll(a){
	alert(a.value);
	return false;
}

function openPicture(a, b, c, d){
	var picWidth = parseInt(b)-18;
	var picHeight = c;
	var twidth = screen.width;
	var theight = screen.height;
	if(b > twidth){
		width = parseInt(twidth)-10;
	}else{
		width = b;
	}
	if(c > theight){
		height = parseInt(theight)-100;
	}else{
		height = parseInt(c)-22;
	}
	var picWind = window.open('', "picWin"+d, "toolbar=0, Location=0, Directories=0, Status=0, Menubar=0, Scrollbars=1, Resizable=0, Width="+width+", Height="+height+"'");
	picWind.document.write("<html>\r\n<title>Просмотр фотографии</title>\r\n<head>\r\n<meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>\r\n<style>body{padding: 0; margin: 0;}</style>\r\n<script language='javascript' type='text/javascript' src='script.js'></script>\r\n</head>\r\n<body>\r\n<a href='JavaScript: window.close();' title='Закрыть окно'><img src='"+a+"' width='"+picWidth+"' height='"+picHeight+"' border='0'></a>\r\n</body>\r\n</html>\r\n");
	picWind.focus();
	//alert(a+" end "+b+" end "+c+"\r\n\r\n"+twidth+" and "+theight);
}