<!--
var oSelected;

function showHideNodes(divToExpand, imgToChange) {
	//markerad eller inte?
	if( imgToChange != "0" ) {
		var sel;
		if (document.getElementById(imgToChange).src.indexOf("sel") > -1 )
			sel = "_sel";
		else
			sel = "";
	}
	
	// Dölj alla noder!
	var cNode = document.getElementById(divToExpand);
	var allSpans = new Array();
	allSpans = document.getElementsByTagName("span");
	var s;
	for( s = allSpans.length; s>0; s-- ) {
		if( allSpans[s] ) {
			if( allSpans[s].className == "spanMarginSibling" ) {
				allSpans[s].style.display = 'none';
			}
		}
	}
	var allImgs = new Array();
	allImgs = document.getElementsByTagName("img");
	for( s = allImgs.length; s>0; s-- ) {
		if( allImgs[s] ) {
			if( allImgs[s].className == "TreeImage_2" ||
					allImgs[s].className == "TreeImage_3" ||
					allImgs[s].className == "TreeImage_4" ||
					allImgs[s].className == "TreeImage_5" ||
					allImgs[s].className == "TreeImage_6" ) {
						allImgs[s].src = "/wbtree/exp.gif";
			}
		}
	}
	
	// Ta fram söken
	if( document.getElementById( "find" + divToExpand.substring(3)))
		document.getElementById( "find" + divToExpand.substring(3)).style.display = 'block';

	// Ta fram alla noder ovanför current, samt current
	if (cNode.style.display == 'none') {
		cNode.style.display = 'block';
		if( cNode.parentNode.className == "spanMarginSibling" ) {
			cNode.parentNode.style.display = 'block';
		}
		if( cNode.parentNode.parentNode.className == "spanMarginSibling" ) {
			cNode.parentNode.parentNode.style.display = 'block';
		}
		if( cNode.parentNode.parentNode.parentNode.className == "spanMarginSibling" ) {
			cNode.parentNode.parentNode.parentNode.style.display = 'block';
		}
		if( imgToChange != "0" ) {
			var cImg = document.getElementById(imgToChange);
			cImg.src = "/wbtree/coll" + sel + ".gif";
			if( cImg.parentNode.parentNode.childNodes[0].src ) {
				cImg.parentNode.parentNode.childNodes[0].src = "/wbtree/coll.gif";
			}
			if( cImg.parentNode.parentNode.parentNode.childNodes[0].src ) {
				cImg.parentNode.parentNode.parentNode.childNodes[0].src = "/wbtree/coll.gif";
			}
			if( cImg.parentNode.parentNode.parentNode.parentNode.childNodes[0].src ) {
				cImg.parentNode.parentNode.parentNode.parentNode.childNodes[0].src = "/wbtree/coll.gif";
			}
		}
	}
}

function hideOtherTree(curNode) {
	// Id för hela sortiment = 431194
	// Id för rätt handske = 431193
	var pnode = curNode.parentNode;
	var endS = 10;
	var divToHide;
	var findToHide;
	while( pnode.className != "leftnavSub" && endS > 0 )
	{
		pnode = pnode.parentNode;
		endS --;
	}
	if( pnode.childNodes[1].value == "ratt_hanske_se" ||
			pnode.childNodes[2].value == "ratt_hanske_se" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "ratt_hanske_no" ||
			pnode.childNodes[2].value == "ratt_hanske_no" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "ratt_hanske_en" ||
			pnode.childNodes[2].value == "ratt_hanske_en" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "ratt_hanske_es" ||
			pnode.childNodes[2].value == "ratt_hanske_es" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "ratt_hanske_fi" ||
			pnode.childNodes[2].value == "ratt_hanske_fi" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "ratt_hanske_da" ||
			pnode.childNodes[2].value == "ratt_hanske_da" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "ratt_hanske_it" ||
			pnode.childNodes[2].value == "ratt_hanske_it" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "ratt_hanske_ru" ||
			pnode.childNodes[2].value == "ratt_hanske_ru" ) {
		divToHide = "div431194";
		findToHide = "find431194";
	}
	if( pnode.childNodes[1].value == "hanskar_se" ||
			pnode.childNodes[2].value == "hanskar_se" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	if( pnode.childNodes[1].value == "hanskar_no" ||
			pnode.childNodes[2].value == "hanskar_no" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	if( pnode.childNodes[1].value == "hanskar_en" ||
			pnode.childNodes[2].value == "hanskar_en" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	if( pnode.childNodes[1].value == "hanskar_es" ||
			pnode.childNodes[2].value == "hanskar_es" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	if( pnode.childNodes[1].value == "hanskar_fi" ||
			pnode.childNodes[2].value == "hanskar_fi" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	if( pnode.childNodes[1].value == "hanskar_da" ||
			pnode.childNodes[2].value == "hanskar_da" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	if( pnode.childNodes[1].value == "hanskar_it" ||
			pnode.childNodes[2].value == "hanskar_it" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	if( pnode.childNodes[1].value == "hanskar_ru" ||
			pnode.childNodes[2].value == "hanskar_ru" ) {
		divToHide = "div431193";
		findToHide = "find431193";
	}
	document.getElementById(divToHide).style.display = 'none';
	document.getElementById(findToHide).style.display = 'none';
}

function ChangeClass(CurrentNode) {
	if ((oSelected != null) && (oSelected != CurrentNode)){
		oSelected.className = 'nodeTreeText';
		oSelected.parentNode.firstChild.src = toggleImg(oSelected.parentNode.firstChild.src);
	}
	CurrentNode.parentNode.firstChild.src = toggleImg(CurrentNode.parentNode.firstChild.src);
}

function OpenIntro(pageName) {
	var sLang = document.getElementById("lang").value;
	
	var sLangName = "";
	if( sLang == "1" ) {
		sLangName = "se";
	}
	if( sLang == "2" ) {
		sLangName = "no";
	}
	if( sLang == "3" ) {
		sLangName = "en";
	}
	if( sLang == "5" ) {
		sLangName = "ee";
	}
	if( sLang == "7" ) {
		sLangName = "fi";
	}
	if( sLang == "9" ) {
		sLangName = "dk";
	}
	if( sLang == "10" ) {
		sLangName = "ru";
	}
	if( sLang == "11" ) {
		sLangName = "it";
	}
	
	frames["wbimport"].location = "/" + sLangName + "/produkter/" + pageName;
}

function OpenPage(sNodeId,curNode){
	var pnode = curNode.parentNode;
	var endS = 10;
	while( pnode.className != "leftnavSub" && endS > 0 )
	{
		pnode = pnode.parentNode;
		endS --;
	}
	var sCatName = pnode.childNodes[1].value;
	var sLang = document.getElementById("lang").value;
	
	frames["wbimport"].location =  "/wbtree/productRender.php?NodeId=" + sNodeId + "&catName=" + sCatName + "&lang=" + sLang;
}

function OverView(sNodeId,curNode){
	var pnode = curNode.parentNode;
	var endS = 10;
	while( pnode.className != "leftnavSub" && endS > 0 )
	{
		pnode = pnode.parentNode;
		endS --;
	}
	var fnode = pnode.firstChild;
	var sCatName;
	if( navigator.appName == "Microsoft Internet Explorer" ) {
		sCatName = fnode.nextSibling.value;
	} else {
		sCatName = fnode.nextSibling.nextSibling.value;
	}
	var sLang = document.getElementById("lang").value;
	
	frames["wbimport"].location =  "/wbtree/overViewRender.php?NodeId=" + sNodeId + "&fromTree&catName=" + sCatName;
}

function StoreOpen(oCurrent){
	str = oCurrent.parentNode.firstChild.src;
	if (str.indexOf('_sel') > -1)
		oSelected = oCurrent;
	else
		oSelected = null;
}

function toggleImg(str){
	var index = str.indexOf('_');
	
	if (index > 0)
		str = str.substr(0,index) + ".gif";
	else
		str = str.substr(0,str.indexOf('.gif')) + "_sel.gif";
	
	return str;
}

//-->
