/* .......................................................
	Функция преобразования emailoв
....................................................... */
	function mailTo(oHref,atString) {
		if(atString){
			oHref.oldHref = oHref.href;
			oHref.href = oHref.href.replace(atString,"@");
		}else{
			oHref.href = oHref.oldHref;
		}
		return oHref.href;
	}
//----------------------------------------------------------------------------------------------------------------------------------
// Открывает новое окно
//----------------------------------------------------------------------------------------------------------------------------------
	function openWindow(url,target){
		target = (target)?target:"new";
		if(document.all){
			MyWin=window.open(url, target, 'width=530,height=430,titlebar=no,toolbar=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no');
			MyWin.window.focus();
	        //window.location.href=url;
		}else{
			MyWin=window.open(url, target, 'width=530,height=430,titlebar=no,toolbar=no,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no');
	        //window.location.href=url;
		}
	}

//----------------------------------------------------------------------------------------------------------------------------------
// Выставляет размер Input и TextArea в IExplore в два раза шире
//----------------------------------------------------------------------------------------------------------------------------------
	function setInputSize(){
		if(document.all){
			for(i=0;i<document.forms.length;i++){
				for(j=0;j<document.forms[i].all.length;j++){
					if(document.forms[i].all[j].size){
						document.forms[i].all[j].size = document.forms[i].all[j].size * 2;
					}
					if(document.forms[i].all[j].cols){
						document.forms[i].all[j].cols = document.forms[i].all[j].cols * 2 -1;
					}
				}
			}
		}
	}

//----------------------------------------------------------------------------------------------------------------------------------
// Закрыть окно
//----------------------------------------------------------------------------------------------------------------------------------
	function closeWindow(Url,Target){
		if(window.opener){
			if(Url.substring(Url.length-5)!='false'){
				if(Target=="self"){
					window.location = Url;
				}else{
					window.opener.location = Url;
					self.close();
				}
			}else{
				if(Target=="self"){
					window.history.go(0);
				}else{
					window.opener.history.go(0);
					self.close();
				}
			}
		}else{		
			window.location= Url;
		}
	}

//----------------------------------------------------------------------------------------------------------------------------------
// Проверить пароли
//----------------------------------------------------------------------------------------------------------------------------------
	function checkPass(Obj1,Obj2,str){
		if(Obj1.value == Obj2.value){
			return true;
		}else{
			alert(str);
			Obj1.value = "";
			Obj2.value = "";
			return false;
		}
	}
//----------------------------------------------------------------------------------------------------------------------------------
// Показать скрыть блок
//----------------------------------------------------------------------------------------------------------------------------------
	function showBlock(id){
		var block = document.getElementById("node_"+id);
		if(block.style.display!='none'){
			block.style.display='none';
		}else{
			block.style.display='block';
		}
	}
	var blocksClosed = 0;
	function setUserProperties(showtext){
		blocksClosed = (showtext=="checked")*1;
	}
	function showAllBlock(){
		var blocks = document.getElementsByTagName("div");
		if(blocksClosed){
			blocksClosed = 0;
			for(var i=0;i<blocks.length;i++){
				var bid = blocks[i].id;
				if(bid.substr(0,4)=="node")	blocks[i].style.display='block';
			}
		}else{
			blocksClosed = 1;
			for(var i=0;i<blocks.length;i++){
				var bid = blocks[i].id;
				if(bid.substr(0,4)=="node")		blocks[i].style.display='none';
			}
		}
		return false;
	}
//----------------------------------------------------------------------------------------------------------------------------------
// Вставить полный тег
//----------------------------------------------------------------------------------------------------------------------------------
	function addFullTag(ObjName,text){
		var Obj = document.getElementById(ObjName);
		Obj.value += text;
		Obj.focus();
		return false;
	}
	var TagArray = new Array("i","small","center","code");
	var TagArrayClose = new Array(1,1,1,1);
	function addTag(ObjName,tagNum){
		var Obj = document.getElementById(ObjName);
		Obj.value += "["+((TagArrayClose[tagNum])?"":"/")+TagArray[tagNum]+"]";
		TagArrayClose[tagNum]= !TagArrayClose[tagNum]; 
		return false;
	}



