function link(lnk){
	window.location.href='layout.asp?page=' + lnk;
}

		function ChangeImages(node, imgpath, imgMain, imgPlusMinusPrefix, imgPlusMinus)
		{
		imgPlusMinus='No';
			bSetMainImage = (imgMain != ""); //don't set main image in text modes
			if (node.children.length > 0)
			{
				if (node.children.item(0).tagName == "IMG")
				{
					if (imgPlusMinus != "No") //"No" indicates that it is not needed Plus or Minus image
						node.children.item(0).src = imgpath + imgPlusMinusPrefix + imgPlusMinus + ".gif";
					else //if is not needed Plus/Minus image
					{
						if (bSetMainImage) //if node has image that must be changed
						{
							node.children.item(0).src = imgpath + imgMain;
							bSetMainImage = false;
						}
					}									
				}			
			}
			
			// process situation <A..><Checkbox><needed image></A>
			if (bSetMainImage && node.children.length > 1)
			{
				if (node.children.item(0).tagName == "INPUT" && node.children.item(1).tagName == "IMG")
				{
					node.children.item(1).src = imgpath + imgMain;
					bSetMainImage = false;
				}
			}
			
			//process next tag
			if (bSetMainImage)
			{
				nextNode = node.nextSibling;
				if (nextNode.tagName == "INPUT") //skip checkbox
					nextNode = nextNode.nextSibling;

				if (nextNode.tagName == "IMG") //next tag is needed image
					nextNode.src = imgpath + imgMain;
				else //next tag is <A...>
					if (nextNode.children.length > 0)
					{
						pos = 0;
						if (nextNode.children.item(0).tagName == "INPUT" && nextNode.children.length > 1)	
							pos = 1; // <A..> <Checkbox> <needed image>

						if (nextNode.children.item(pos).tagName == "IMG")							
							nextNode.children.item(pos).src = imgpath + imgMain;
					}
			}		
		}
		function ExpCol(node, imgpath, imgPlusMinus, imgCollapsed, imgExpanded, nodekey)
		{
			if (node != null)
			{
				nextNode = node.nextSibling;
				bFinded = false;
				
				while (nextNode != null && bFinded == false)
				{					
					if (nextNode.tagName == "DIV")
						bFinded = true;	
					else			
					    nextNode = nextNode.nextSibling;	
				}
				
				if (nextNode != null && bFinded)
				{						
					if (nextNode.style.display == 'none')
					{
						nextNode.style.display = '';
						ChangeImages(node, imgpath, imgExpanded, 'grey_arrow_off', imgPlusMinus);
					}
					else
					{
						nextNode.style.display = 'none';
						ChangeImages(node, imgpath, imgCollapsed, 'grey_arrow_on', imgPlusMinus);
					}
				}				
			}
		}

