function resize_Elements() {
	var client_h = document.body.clientHeight;
	var client_w = document.body.clientWidth;
	
	if(document.getElementById("main-page")) {
		if(document.getElementById("main-right")) {
			document.getElementById("main-right").style.width = (client_w - 229);
			document.getElementById("main-right").style.height = (client_h - 142);//143//136
		}
		if(document.getElementById("main-left")) {
			document.getElementById("main-left").style.height = (client_h - 143);
		}
	}
}

function openPopup(p_width, p_height, p_name, p_url, p_scroll, p_resize) {
	var pos_y = (screen.width - p_width) / 2;
	var pos_x = (screen.height - p_height) / 2;
	win_popup = 'width='+p_width+',height='+p_height+',left='+pos_y+',top='+pos_x+',menubar=0,location=0,toolbar=0,personalbar=0,status=0,scrollbars='+p_scroll+',titlebar=0,resizable='+p_resize+''
	win = window.open(p_url, p_name, win_popup)
}

//--------------- product tree
function open_UtopisByUrl(open_url) {
	openPopup(800, 600, "pop_utopis", open_url, 1, 1);
}

//--------------- home
function position_Elements() {
	var client_h = document.body.clientHeight;
	var client_w = document.body.clientWidth;
	
	if(document.getElementById("main-wrapper")) {
		document.getElementById("main-wrapper").style.left = ((client_w - 748) / 2);
		document.getElementById("main-wrapper").style.top = (((client_h - 355) / 2) - 80);
		document.getElementById("main-wrapper").style.display = "block";
	}
}

//--------------- top menu
var tm_base = "";

function over_TopMenu(elem) {
	var rel_src = elem.src.replace("http://"+document.domain+"/", "");
	var cur_img =(rel_src.substring((parseInt(rel_src.lastIndexOf("/"))+1)));
	if(cur_img.indexOf("on_") != -1) {
		elem.src = "upload/" + cur_img.replace("on_", "off_");
	}else{
		elem.src = "upload/" + cur_img.replace("off_", "on_");
	}
}

//--------------- print
function print_Page() {
	if(document.location.href.length) {
		new_url = document.location.href.replace("page.asp", "print.asp");
		openPopup(800, 600, "pop_print", new_url, 1, 1);
	}
}
