function show(id){	
	var box = document.getElementById(id);
	if (box != null)
	{
		box.style.display = 'block';
	}
}
function hide(id){
	var box = document.getElementById(id);
	if (box != null)
	{
		box.style.display = 'none';
	}
}
function showBox(id, num){
	i = 1;
	while(box = document.getElementById(id+"_"+i)){
		box.style.display = 'none';
		i++;
	}
	var box = document.getElementById(id+'_'+num);

	box.style.display = 'block';
}
function hideBox(id, num){
	i = 1;
	while(box = document.getElementById(id+"_"+i)){
		box.style.display = 'none';
		i++;
	}
	var box = document.getElementById(id+'_'+num);
	
	box.style.display = 'none';
}

function changeBG(element, url){
	var test = document.getElementById(element); 
	test.style.backgroundImage="url('"+url+"')";		
}
function changeImage(element, url){
	var test = document.getElementById(element); 
	test.src=url;		
}
function Box(id){
	var box = document.getElementById(id);
	if(box.style.display == 'block'){
		box.style.display = 'none';
	}else{
		box.style.display = 'block';
	}
}
function resetThird(el){
	i = 1;
	while(box = document.getElementById(el+"_"+i)){
		box.style.display = 'none';
		i++;
	}
}
function doPrint(url){
	 window.open (url,"PrintWindow","location=0, status=1, scrollbars=1, toolbar=0, width=825, height=630"); 
}
function swapImage(id, sImage1, sImage2)
{
	var img = document.getElementById(id);
	if (img!=null)
	{
	    var bExpand = img.src.indexOf(sImage1) >= 0;
		if (!bExpand)
			img.src = sImage1;
		else
			img.src = sImage2;
	}
}
function swapTree(oParent, sActiveClass)
{
	var oChild = oParent.nextSibling
	if (oChild != null)
	{
		oChild = oChild.nextSibling;
	}
	if (oChild != null)
	{
		switch (getCurrentStyle(oChild, 'display'))
		{
			case 'block':
				oChild.style.display = 'none';
				oParent.className = '';
				break;
			case 'none':
				oChild.style.display = 'block';
				oParent.className = sActiveClass;
				break;
		}
		
	}
}
function showFeedback(sId)
{
	//Show feedback / tell-a-friend form
	show(sId);
	//Hide the links
	hide('feedbacklinks');
	//Hide section 'further info'
	hide('furtherinfo');
}
function hideFeedback(oHideLink)
{
	var oFeedback = oHideLink.parentNode.parentNode.parentNode;
	if (oFeedback != null)
	{
		//Hide feedback / tell-a-friend form
		oFeedback.style.display = 'none';
		//Show the links
		show('feedbacklinks');
		//Show section 'further info'
		show('furtherinfo');
	}
}
function getCurrentStyle(oElm, strCssRule){
	var strValue = "";
	if(document.defaultView && document.defaultView.getComputedStyle){
		strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
	}
	else if(oElm.currentStyle){
		strCssRule = strCssRule.replace(/-(w)/g, function (strMatch, p1){
			return p1.toUpperCase();
		});
		strValue = oElm.currentStyle[strCssRule];
	}
	return strValue;
}

//Image preload: 
im1 = new Image();
im1.src = "/_layouts/images/KCH/pht_1_hover.jpg";

im2 = new Image();
im2.src = "/_layouts/images/KCH/pht_2_hover.jpg";

im3 = new Image();
im3.src = "/_layouts/images/KCH/pht_3_hover.jpg";
/*
im4 = new Image();
im4.src = "/_layouts/images/KCH/pht_4_hover.jpg";
*/
im5 = new Image();
im5.src = "/_layouts/images/KCH/pht_5_hover.jpg";

im6 = new Image();
im6.src = "/_layouts/images/KCH/pht_6_hover.jpg";

im7 = new Image();
im7.src = "/_layouts/images/KCH/pht_7_hover.jpg";

im8 = new Image();
im8.src = "/_layouts/images/KCH/pht_8_hover.jpg";