function updateCheckbox(img, id){
	var el = document.getElementById(id);
	if(el){
		el.checked = !el.checked;
		if(el.checked){
			img.src = '/image/selectbox_active.gif';
			if(id != "selectionAll"){
				var inputTags = document.getElementById("productList");
				var allProducts = true;
				inputTags = inputTags.getElementsByTagName('input');
				for(var x = 0; x < inputTags.length; x++){
					if(!inputTags[x].checked){
						allProducts = false;
					}
				}
				if(allProducts){
					el = document.getElementById('selectionAll');
					el.checked = true;
					el = document.getElementById('imgselectionAll');
					el.src = '/image/selectbox_active.gif';
				}
			}
		}else{
			img.src = '/image/selectbox.gif';
			if(id != "selectionAll"){
				el = document.getElementById('selectionAll');
				el.checked = false;
				el = document.getElementById('imgselectionAll');
				el.src = '/image/selectbox.gif';
			}
		}
		if(id == "selectionAll"){
			var inputTags = document.getElementById("productList");
			inputTags = inputTags.getElementsByTagName('input');
			for(var x = 0; x < inputTags.length; x++){
				inputTags[x].checked = el.checked;
			}
			var inputTags = document.getElementById("productList");
			inputTags = inputTags.getElementsByTagName('img');
			for(var x = 0; x < inputTags.length; x++){
				if(el.checked){
					inputTags[x].src = inputTags[x].src.replace('x.gif', 'x_active.gif');
				}else{
					inputTags[x].src = inputTags[x].src.replace('_active.gif', '.gif');
				}
			}
		}
	}
}

var showedLayer;
window.onresize = init;
	
function init(){
	var el = document.getElementById('languages');
	//var map = document.getElementById('worldmap');
	//var x = getOffsetLeft(map);
	//var y = getOffsetTop(map);
	//el.style.top = (y+150);
	//el.style.left = (x+270);
	showLayer();
}

function showLayer(id)
{
	if(typeof id == "object" || typeof id == "undefined")
	{
		id = showedLayer;
	}
	if(typeof showedLayer != "undefined")
	{
		document.getElementById('div' + showedLayer).style.display = 'none';
		document.getElementById('link' + showedLayer).className = '';
	}
	var submenu = document.getElementById('div' + id);
	if(submenu)
	{
		submenu.style.display = 'block';
		showedLayer = id;	
		var lnk = document.getElementById('link' + id);
		if(lnk)
		{
			var x = getOffsetLeft(lnk);
			var y = getOffsetTop(lnk);
			submenu.style.position = "absolute";	
			submenu.style.top = (y-28);
			submenu.style.left = (x+90);
			lnk.className = 'active';
		}
	}
}

function getOffsetLeft (el) 
{ 
	var ol = el.offsetLeft; 
	while ((el = el.offsetParent) != null) 
	{
		ol += el.offsetLeft; 
	}
	return ol; 
} 

function getOffsetTop (el) 
{ 
	var ot = el.offsetTop; 
	while((el = el.offsetParent) != null)
	{ 
		ot += el.offsetTop; 
	}
	return ot; 
}
sfHover = function() {
	var navobj = document.getElementById("langswitch");
	if (navobj) {
		var sfEls = navobj.getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);