function popup_forum(forumID,action) {
  if(action=='edit')param_var = 'forumEditID';
  else param_var = 'forumID';
  myWin= open("{/literal}{$smarty.const.URL}{literal}forum_comment.php?"+param_var+"="+forumID, "displayWindow", "width=630,height=340,status=no,toolbar=no,menubar=no");
  myWin.focus();

}

function newWindowOpen(url) {
  	myWin= open(url+"", "displayWindow", "width=800,height=600,status=yes,toolbar=yes,menubar=yes,resizable=yes");
	if (myWin) {
		myWin.focus();
	} else {
		alert('Отключите блокировщик!');
	}
}

function popup_topic_forum(forumID){

  myWin= open("{/literal}{$smarty.const.URL}{literal}topic_edit.php?forumEditID="+forumID, "displayWindow","width=630,height=340,status=no,toolbar=no,menubar=no");
  myWin.focus();
}

function topic(obj){
if(obj.title.value!='' && obj.about.value!='')return true;
else alert("Заполните все поля!");

return false;
}

function setColumnsHeight() {
	var baseheight = document.getElementById("index_main_content").offsetHeight;
	var leftheight = document.getElementById("left_panel_root").offsetHeight;
	
	if (leftheight < baseheight) {
		document.getElementById("index_main_container").style.height = baseheight + "px";
		document.getElementById("left_panel_root").style.height = (baseheight - 19) + "px";
	} else {
		document.getElementById("left_panel_root").style.height = (leftheight - 19) + 'px';
		document.getElementById("index_main_content").style.height = leftheight + 'px';
	}
	
	if (document.getElementById("right_panel_root")) {
		if (document.getElementById("right_panel_root").offsetHeight < baseheight) {
			document.getElementById("index_main_container").style.height = baseheight + "px";
			document.getElementById("right_panel_root").style.height = (baseheight - 19) + "px";
		} else {
			document.getElementById("right_panel_root").style.height = document.getElementById("right_panel_root").offsetHeight + 'px';
		}
	}
}

function del(url){
	if(confirm("Удалить?")){
    	document.location=url;
    	return true;
	}
	return false;
}
   
var xmlDoc = null ;
 
function load() {
	if (typeof window.ActiveXObject != 'undefined' ) {
    	xmlDoc = new ActiveXObject("Microsoft.XMLHTTP");
        xmlDoc.onreadystatechange = process ;
    } else {
		xmlDoc = new XMLHttpRequest();
        xmlDoc.onload = process ;
	}
    xmlDoc.open( "GET", "libs/loadregions.php", true );
    xmlDoc.send( null );
}
  
function process() {
	if ( xmlDoc.readyState != 4 ) return ;
    document.getElementById("region").value = xmlDoc.responseText ;
}
  
function menu(parent,mouse){
 if(mouse=='over')document.getElementById(parent).style.display='block';
 else document.getElementById(parent).style.display='none';
}
