function edit(id,id2,process,typ) {
	parent.top.action.location.href = "../program/content/edit.php?id="+ id +"&id2="+ id2 +"&process="+ process +"&typ="+ typ;
}

function edit_popup(id,id2,process,typ) {
	opener.top.action.location.href = "../program/content/edit.php?id="+ id +"&id2="+ id2 +"&process="+ process +"&typ="+ typ;
}

function edit_menu(process) {
	cattable = document.getElementById('cat_table').value;
	id = document.getElementById('cat_id').value;
	if (process != "4") {
		editmenu = open("../program/category/category.php?cat_table="+cattable+"&id="+id+"&process="+process, "EDITMENU", "width=700,height=320,dependent=yes");
	} else {
		editmenu = open("../program/category/cat_delete.php?cat_table="+cattable+"&id="+id+"&process="+process, "DELMENU", "width=400,height=325,dependent=yes");
	}
}

function edit_banner(cid, special, rightid) {
	process = document.getElementById('banner_process').value;
	id = document.getElementById('banner_id').value;
	if (special == "") {
		parent.top.action.location.href = "../program/content/edit.php?id="+ id +"&process="+ process +"&typ=banner"+"&rightid="+rightid;
	}
	if (special == "DEL") {
		parent.top.action.location.href = "../program/content/edit.php?id="+ id +"&process="+ special +"&typ=banner"+"&rightid="+rightid;
	}
}

function move_menu(cattable,id,route) {
	parent.top.action.location.href = "../program/category/positions.php?cat_table="+cattable+"&id="+id+"&route="+route;
}

function open_menu_menu1(e) {
	if(!e) e=window.event;
	document.getElementById('menu1').style.visibility = "visible";
	movex2 = event.clientX;
	movey2 = event.clientY;
	
	//movex2 = e.pageX;
	//movey2 = e.pageY;
	document.getElementById('menu1').style.left=movex2;
	document.getElementById('menu1').style.top=movey2;
	return false;
}

function hide_menu_menu1() {
	document.getElementById('menu1').style.visibility = "hidden";
}
function show_menu_menu1() {
	document.getElementById('menu1').style.visibility = "visible";	
}

function open_menu_menu2(e) {
	if(!e) e=window.event;
	document.getElementById('menu2').style.visibility = "visible";
	movex2 = event.clientX;
	movey2 = event.clientY;
	document.getElementById('menu2').style.left=movex2;
	document.getElementById('menu2').style.top=movey2;
	return false;
}

function hide_menu_menu2() {
	document.getElementById('menu2').style.visibility = "hidden";
}
function show_menu_menu2() {
	document.getElementById('menu2').style.visibility = "visible";	
}

function open_menu_menu3(e) {
	if(!e) e=window.event;
	document.getElementById('menu3').style.visibility = "visible";
	movex2 = event.clientX;
	movey2 = event.clientY;
	document.getElementById('menu3').style.left=movex2;
	document.getElementById('menu3').style.top=movey2;
	return false;
}

function hide_menu_menu3() {
	document.getElementById('menu3').style.visibility = "hidden";
}
function show_menu_menu3() {
	document.getElementById('menu3').style.visibility = "visible";	
}

function open_menu_menu4(e) {
	if(!e) e=window.event;
	document.getElementById('menu4').style.visibility = "visible";
	movex2 = event.clientX;
	movey2 = event.clientY;
	document.getElementById('menu4').style.left=movex2;
	document.getElementById('menu4').style.top=movey2;
	return false;
}

function hide_menu_menu4() {
	document.getElementById('menu4').style.visibility = "hidden";
}
function show_menu_menu4() {
	document.getElementById('menu4').style.visibility = "visible";	
}


//BANNER
function hide_banner_menu() {
	document.getElementById('banner_menu').style.visibility = "hidden";	
}
function show_banner_menu() {
	document.getElementById('banner_menu').style.visibility = "visible";	
}

function open_banner_menu(e) {
	if(!e) e=window.event;
	document.getElementById('banner_menu').style.visibility = "visible";
	movex2 = event.clientX;
	movey2 = event.clientY;
	
	//movex2 = e.pageX;
	//movey2 = e.pageY;
	document.getElementById('banner_menu').style.left=movex2;
	document.getElementById('banner_menu').style.top=movey2;
	return false;
}
function search_start(bl) {
	str = document.getElementById('search_str').value;
	grp = document.getElementById('search_grp').value
	document.location.href = "main.php?search="+str+"&sgrp="+grp;
}
