/************************************************************************************************************(C) www.dhtmlgoodies.com, November 2005This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.	Terms of use:You are free to use this script as long as the copyright message is kept intact. However, you may notredistribute, sell or repost it without our permission.Thank you!www.dhtmlgoodies.comAlf Magne Kalleland************************************************************************************************************/var dhtmlgoodies_slideSpeed = 20;	// Higher value = fastervar dhtmlgoodies_timer = 5;	// Lower value = fastervar objectIdToSlideDown = false;var b_objectIdToSlideDown = false;var c_objectIdToSlideDown = false;var dhtmlgoodies_activeId = false;var b_dhtmlgoodies_activeId = false;var c_dhtmlgoodies_activeId = false;var dhtmlgoodies_slideInProgress = false;var b_dhtmlgoodies_slideInProgress = false;var c_dhtmlgoodies_slideInProgress = false;var height = 0;var b_height = 0;var c_height = 0;var parentheight = 0;intImage = 2;function swapImage() {switch (intImage) { case 1:   IMG1.src = "http://www.microsoft.com/library/toolbar/images/mslogo.gif"   intImage = 2   return(false);case 2:   IMG1.src = "http://msdn.microsoft.com/msdn-online/start/images/msdn-logo.gif"   intImage = 1   return(false); }}function showHideContent(e,inputId){	// swapImage();	if(dhtmlgoodies_slideInProgress)return;	dhtmlgoodies_slideInProgress = true;	if(!inputId)inputId = this.id;	inputId = inputId + '';	var numericId = inputId.replace(/[^0-9]/g,'');	var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);	objectIdToSlideDown = false;		if(!answerDiv.style.display || answerDiv.style.display=='none'){				if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){						objectIdToSlideDown = numericId;			slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));		}else{						answerDiv.style.display='block';			answerDiv.style.visibility = 'visible';						slideContent(numericId,dhtmlgoodies_slideSpeed);		}	}else{		slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));		dhtmlgoodies_activeId = false;	}	}function b_showHideContent(e,inputId){	if(b_dhtmlgoodies_slideInProgress)return;	b_dhtmlgoodies_slideInProgress = true;	if(!inputId)inputId = this.id;	inputId = inputId + '';	var numericId = inputId.replace(/[^0-9]/g,'');	var b_answerDiv = document.getElementById('b_dhtmlgoodies_a' + numericId);	b_objectIdToSlideDown = false;		if(!b_answerDiv.style.display || b_answerDiv.style.display=='none'){				if(b_dhtmlgoodies_activeId &&  b_dhtmlgoodies_activeId!=numericId){						b_objectIdToSlideDown = numericId;			b_slideContent(b_dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));		}else{						b_answerDiv.style.display='block';			b_answerDiv.style.visibility = 'visible';						b_slideContent(numericId,dhtmlgoodies_slideSpeed);		}	}else{		b_slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));		b_dhtmlgoodies_activeId = false;	}	}function c_showHideContent(e,inputId){	if(c_dhtmlgoodies_slideInProgress)return;	c_dhtmlgoodies_slideInProgress = true;	if(!inputId)inputId = this.id;	inputId = inputId + '';	var numericId = inputId.replace(/[^0-9]/g,'');	var c_answerDiv = document.getElementById('c_dhtmlgoodies_a' + numericId);	c_objectIdToSlideDown = false;		if(!c_answerDiv.style.display || c_answerDiv.style.display=='none'){				if(c_dhtmlgoodies_activeId &&  c_dhtmlgoodies_activeId!=numericId){						c_objectIdToSlideDown = numericId;			c_slideContent(c_dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));		}else{						c_answerDiv.style.display='block';			c_answerDiv.style.visibility = 'visible';						c_slideContent(numericId,dhtmlgoodies_slideSpeed);		}	}else{		c_slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));		c_dhtmlgoodies_activeId = false;	}	}function slideContent(inputId,direction){		obj =document.getElementById('dhtmlgoodies_a' + inputId);	var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);	height = obj.clientHeight;	if(height==0)height = obj.offsetHeight;	height = height + direction;	rerunFunction = true;	if(height>contentObj.offsetHeight){		height = contentObj.offsetHeight;		rerunFunction = false;	}	if(height<=1){		height = 1;		rerunFunction = false;	}	obj.style.height = height + 'px';	var topPos = height - contentObj.offsetHeight;	if(topPos>0)topPos=0;	contentObj.style.top = topPos + 'px';	if(rerunFunction){		setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);	}else{		if(height<=1){			obj.style.display='none'; 			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';				slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);							}else{				parentheight=height;				dhtmlgoodies_slideInProgress = false;			}		}else{			parentheight=height;			dhtmlgoodies_activeId = inputId;			dhtmlgoodies_slideInProgress = false;		}			}}function b_slideContent(inputId,direction){	var b_obj =document.getElementById('b_dhtmlgoodies_a' + inputId);	var contentObj = document.getElementById('b_dhtmlgoodies_ac' + inputId);	b_height = b_obj.clientHeight;	if(b_height==0)b_height = b_obj.offsetHeight;	b_height = b_height + direction;	b_rerunFunction = true;	if(b_height>contentObj.offsetHeight){		b_height = contentObj.offsetHeight;		b_rerunFunction = false;	}	if(b_height<=1){		b_height = 1;		b_rerunFunction = false;	}	//obj.style.height = parentheight + 'px';	b_obj.style.height = b_height+ 'px';	var topPos = b_height - contentObj.offsetHeight;	if(topPos>0)topPos=0;	contentObj.style.top = topPos + 'px';	if(b_rerunFunction){		setTimeout('b_slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);	}else{		if(b_height<=1){			b_obj.style.display='none'; 			if(b_objectIdToSlideDown && b_objectIdToSlideDown!=inputId){				document.getElementById('b_dhtmlgoodies_a' + b_objectIdToSlideDown).style.display='block';				document.getElementById('b_dhtmlgoodies_a' + b_objectIdToSlideDown).style.visibility='visible';				b_slideContent(b_objectIdToSlideDown,dhtmlgoodies_slideSpeed);							}else{				b_dhtmlgoodies_slideInProgress = false;			}		}else{			b_dhtmlgoodies_activeId = inputId;			b_dhtmlgoodies_slideInProgress = false;		}	}}function c_slideContent(inputId,direction){	var c_obj =document.getElementById('c_dhtmlgoodies_a' + inputId);	var contentObj = document.getElementById('c_dhtmlgoodies_ac' + inputId);	c_height = c_obj.clientHeight;	if(c_height==0)c_height = c_obj.offsetHeight;	c_height = c_height + direction;	c_rerunFunction = true;	if(c_height>contentObj.offsetHeight){		c_height = contentObj.offsetHeight;		c_rerunFunction = false;	}	if(c_height<=1){		c_height = 1;		c_rerunFunction = false;	}	obj.style.height = c_height + parentheight + 'px';	c_obj.style.height = c_height + 'px';	var topPos = c_height - contentObj.offsetHeight;	if(topPos>0)topPos=0;	contentObj.style.top = topPos + 'px';	if(c_rerunFunction){		setTimeout('c_slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);	}else{		if(c_height<=1){			c_obj.style.display='none'; 			if(c_objectIdToSlideDown && c_objectIdToSlideDown!=inputId){				document.getElementById('c_dhtmlgoodies_a' + c_objectIdToSlideDown).style.display='block';				document.getElementById('c_dhtmlgoodies_a' + c_objectIdToSlideDown).style.visibility='visible';				c_slideContent(c_objectIdToSlideDown,dhtmlgoodies_slideSpeed);							}else{				c_dhtmlgoodies_slideInProgress = false;			}		}else{			c_dhtmlgoodies_activeId = inputId;			c_dhtmlgoodies_slideInProgress = false;		}	}}function initShowHideDivs(){	var divs = document.getElementsByTagName('DIV');	var divCounter = 1;	for(var no=0;no<divs.length;no++){		if(divs[no].className=='dhtmlgoodies_question'){			divs[no].onclick = showHideContent;			divs[no].id = 'dhtmlgoodies_q'+divCounter;			var answer = divs[no+2].nextSibling;			while(answer && answer.tagName!='DIV'){				answer = answer.nextSibling;			}			answer.id = 'dhtmlgoodies_a'+divCounter;				contentDiv = answer.getElementsByTagName('DIV')[0];			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 				contentDiv.className='dhtmlgoodies_answer_content';			contentDiv.id = 'dhtmlgoodies_ac' + divCounter;			answer.style.display='none';			answer.style.height='1px';			divCounter++;		} 	}		var b_divs = document.getElementsByTagName('DIV');	var b_divCounter = 1;	for(var no=0;no<b_divs.length;no++){		if(b_divs[no].className=='b_dhtmlgoodies_question'){			b_divs[no].onclick = b_showHideContent;			b_divs[no].id = 'b_dhtmlgoodies_q'+b_divCounter;			var b_answer = b_divs[no].nextSibling;			while(b_answer && b_answer.tagName!='DIV'){				b_answer = b_answer.nextSibling;			}			b_answer.id = 'b_dhtmlgoodies_a'+b_divCounter;				b_contentDiv = b_answer.getElementsByTagName('DIV')[0];			b_contentDiv.style.top = 0 - b_contentDiv.offsetHeight + 'px'; 				b_contentDiv.className='b_dhtmlgoodies_answer_content';			b_contentDiv.id = 'b_dhtmlgoodies_ac' + b_divCounter;			b_answer.style.display='none';			b_answer.style.height='1px';			b_divCounter++;		}	}		var c_divs = document.getElementsByTagName('DIV');	var c_divCounter = 1;	for(var no=0;no<c_divs.length;no++){		if(c_divs[no].className=='c_dhtmlgoodies_question'){			c_divs[no].onclick = c_showHideContent;			c_divs[no].id = 'c_dhtmlgoodies_q'+c_divCounter;			var c_answer = c_divs[no].nextSibling;			while(c_answer && c_answer.tagName!='DIV'){				c_answer = c_answer.nextSibling;			}			c_answer.id = 'c_dhtmlgoodies_a'+c_divCounter;				c_contentDiv = c_answer.getElementsByTagName('DIV')[0];			c_contentDiv.style.top = 0 - c_contentDiv.offsetHeight + 'px'; 				c_contentDiv.className='c_dhtmlgoodies_answer_content';			c_contentDiv.id = 'c_dhtmlgoodies_ac' + c_divCounter;			c_answer.style.display='none';			c_answer.style.height='1px';			c_divCounter++;		}	}	}window.onload = initShowHideDivs;