window.onload = function() {

    window.focus();
	//var uls = document.getElementsByTagName("ul");
	//for (i=0; i<uls.length; i++) {
	//	uls[i].style.display = "block";
	//}
}

function displayLevel(id, contextRoot) {

	var menu = document.getElementById(id);
	var display = menu.style.display;
	menu.style.display = (display == "block") ? "none" : "block";
}


function closePopup() {

	var clear = "";
	opener.document.contentform.categoryIdList.value=clear;
	opener.document.contentform.categoryNameList.value=clear;

	opener.document.contentform.categoryNameListSelect.options.length = 0;

 	var arrayCheckbox = document.getElementsByName("checkbox");
 	var arrayLabel = document.getElementsByName("label");
		
	for (i=0;i<arrayCheckbox.length;i++){

 		if (arrayCheckbox[i].checked == true){			
			opener.document.contentform.categoryIdList.value = opener.document.contentform.categoryIdList.value + arrayCheckbox[i].value + ";";
			opener.document.contentform.categoryNameList.value = opener.document.contentform.categoryNameList.value + arrayLabel[i].alt + ";";							
			var option = opener.document.createElement("option"); 
			option.text = arrayLabel[i].alt; 
			option.value=i;
			var lung = opener.document.contentform.categoryNameListSelect.options.length;
			opener.document.contentform.categoryNameListSelect.options[lung]=option;
		}		 		
	}

	window.close();
	opener.window.focus();
	var mods = opener.document.getElementById("quick_mods");
	mods.style.display = "block";
}

function openPopup(URL, windowName, features, ckeckedCategories, categoriesLanguageId) {

	window.open(URL+'?ckeckedCategories='+ckeckedCategories+'&categoriesLanguageId='+categoriesLanguageId, windowName, features);
}

