

function manageLeftMenuDisplay(id){
var object = $("#"+id);
	if(object != null){
		//alert('Zapodano id left' + id + '  ' + object.size());
		object.addClass("selected-element");
		//alert('Test ' +object.parent().attr('id'));
	}
}

function manageTopMenuDisplay(id){
var object = $("#"+id);
	if(object != null){
		//alert('Zapodano id top ' + id + '  id ' + object.attr("id"));
		object.addClass("selected");
		
		
	}
}

function openImageWindow(href,pictureId) {
    window.open("/pages/show_image.jsf?path="+href+"&pictureId="+pictureId, "image", "width=1, height=1, menubar=false, status=false, toolbar=false");
}

//function openFlashPlayerWindow(href, width, height, pictureId) {
//	var windowHeight = height+20;

//	var browser = detectBrowser();
//	if(browser.browser == 'Internet Explorer' && browser.version == 7){
//		windowHeight += 20;
//	} else if (browser.browser == 'Safari'){
//		windowHeight +=20;
//		width += 5;
//	}
//    window.open("/pages/show_flash.jsf?path="+href+"&width="+width+"&height="+height+"&pictureId="+pictureId, "image", 
//    		"width="+(width+22)+", height="+windowHeight+ ",menubar=false, status=false, toolbar=false");
//}


function openFlashPlayerWindow(href, width, height, pictureId) {
	
	var windowHeight = height+20;

	var browser = detectBrowser();
	if(browser.browser == 'Internet Explorer' && browser.version == 7){
		windowHeight += 20;
	} else if (browser.browser == 'Safari'){
		windowHeight +=20;
		width += 5;
	}
    window.open("/pages/show_flv.jsf?videoPath="+href+"&width="+width+"&height="+height+"&pictureId="+pictureId, "image", 
    		"width="+(width+22)+", height="+windowHeight+ ",menubar=false, status=false, toolbar=false");
}



function setHeaderImage(id, imgId){
	
        	//ale slaby kod
		
        	changeImage(id, 24 , imgId, '1.jpg')
        	changeImage(id, 34 , imgId, '2.jpg')
        	changeImage(id, 3 , imgId, '3.jpg')
        	changeImage(id, 18 , imgId, '4.jpg')
        	changeImage(id, 21 , imgId, '5.jpg')
        	changeImage(id, 24 , imgId, '6.jpg')
        	changeImage(id, 12 , imgId, '7.jpg')
		
}

function changeImage(id, targetId, imageId, imageFilename){

		 var li = $("#limenu"+id);
			if(li.size() != 0 && id == targetId){
						$("#" + imageId).attr("src","/header_img/" + imageFilename);
					return
			}
		var object = $("#menu"+id);
		if(object.size() != 0 && object.parent().attr("id") == 'menu' + targetId){
				$("#" + imageId).attr("src","/header_img/" + imageFilename);
				return
			
		}
		
		}
