
/* For mso5, mso13 and mso15 */
function swapHighlightContent(sectionName,contentToShow) {
	var hideElement, hideElementMedia, hideElementButton, showElement, showElementMedia, showElementButton, count = 1;
	while(hideElement = document.getElementById(sectionName + '_content_' + count)){
		hideElement.style.display = 'none';
		hideElementMedia = document.getElementById(sectionName + '_media_' + count)
		hideElementMedia.style.display = 'none';
		hideElementButton = document.getElementById(sectionName + '_button_' + count);
		hideElementButton.className = "";
		count++;
	}
	showElement = document.getElementById(sectionName + '_content_' + contentToShow);
	showElement.style.display = 'block';
	showElementMedia = document.getElementById(sectionName + '_media_' + contentToShow);
	showElementMedia.style.display = 'block';
	showElementButton = document.getElementById(sectionName + '_button_' + contentToShow);
	showElementButton.className = "selected";
}

/* For mso06 and mpr11 */
function showHideExpandableBlock(blockId) {
	openBlock = document.getElementById(blockId+"_open");
	closedBlock = document.getElementById(blockId+"_closed");
		if (openBlock.style.display == "none") {
			openBlock.style.display = "block";
			closedBlock.style.display = "none";
		} else {
			openBlock.style.display = "none";
			closedBlock.style.display = "block";
		}
}

/* for mso10 */
function showHideTabNew(sectionName,tabToShow) {
	var hideElement, showElement, hideElementTab, showElementTab, count = 1;
	while(hideElement = document.getElementById(sectionName + '_content_' + count)){
		hideElement.style.display = 'none';
		hideElementTab = document.getElementById(sectionName + '_tab_' + count);
		hideElementTab.className = '';
		count++;
	}
	showElement = document.getElementById(sectionName + '_content_' + tabToShow);
	showElement.style.display = 'block';
	showElementTab = document.getElementById(sectionName + '_tab_' + tabToShow);
	showElementTab.className = 'selected';

}

/* get highest content height for show / hide modules */
function gethighestMediaElement() {
	/* e.g. gethighestMediaElement('information','content'); */
	var checkElementHeight, count = 1;
	var highestElement = 0;
	while(checkElementHeight = document.getElementById("information_content_" + count)){
		if(checkElementHeight.offsetHeight > highestElement){
			highestElement = checkElementHeight.offsetHeight;
					
		}
		count++;
	}
	document.getElementById("information_content").style.height = highestElement+"px";
	
	var checkElementHeight, count = 1;
	while(checkElementHeight = document.getElementById("information_media_" + count)){
		
		if(checkElementHeight.offsetHeight > highestElement){
			highestElement = checkElementHeight.offsetHeight;
			
		}
		count++;
	}
//	document.getElementById("FirstPageHighlights").style.height = highestElement+40+"px";
document.getElementById("information_media").style.height = highestElement+"px";
	
	
}


/* for mso10 */
function gethighestTabElement(sectionName) {
	/* e.g. gethighestMediaElement('information','content'); */
	var checkElementHeight, count = 1;
	var highestElement = 0;
	// Check heights
	while(checkElementHeight = document.getElementById(sectionName + '_content_' + count)){
		if(checkElementHeight.offsetHeight > highestElement){
			highestElement = checkElementHeight.offsetHeight;

		}
		count++;
	}
	// Set heights
	count = 1;
	while(checkElementHeight = document.getElementById(sectionName + '_content_' + count)){
		checkElementHeight.style.height = highestElement+"px";
		document.getElementById(sectionName + '_content_right_' + count).style.height = (highestElement-20)+"px";
		count++;
	}
}

function setPopupValues(title, descr, articleid, mediaid, props) {
	var s;
	
	s = '<div class="fixed-popup">'
	+ '<div class="container"><div class="bg_shadow_top"><div class="bg_shadow_middle"><div class="column-left"><img src="ShowImage.asp?ImageId='+mediaid+'"  alt="" />'
	+ '</div><div class="column-right"><div class="content"><h1>'+title+'</h1></div><div class="content">'
	+ '<p>'+descr.replace(/&quote;/g,'"')+'</p><div class="more-link"><a href="page.asp?ArticleId='+articleid+'" title="Full product details">Full product details</a></div></div>'
	+ '<div class="content"><h2 class="overview">Product Overview</h2><table width="100%" border="0" cellspacing="0" cellpadding="0" summary="">'+props+'</table>'
	+ '</div><div class="more-link"><a href="#" onClick="showHidePopup(); return false;" title="Close">Close</a></div></div><div class="clearer"></div>'
	+ '</div></div><div class="bg_shadow_bottom" style="background-position: top left;"></div></div></div>';

	document.getElementById("popup").innerHTML = s;
}

function showHidePopup() {
	elem = document.getElementById('popup');
	if(elem.style.display == "none") {

		var windowX,windowY;
		if (self.innerHeight) // all except Explorer
		{
			windowX = self.innerWidth;
			windowY = self.innerHeight;
		}
		else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
		{
			windowX = document.documentElement.clientWidth;
			windowY = document.documentElement.clientHeight;
		}
		else if (document.body) // other Explorers
		{
			windowX = document.body.clientWidth;
			windowY = document.body.clientHeight;
		}

		var scrollX,scrollY;
		if (self.pageYOffset) // all except Explorer
		{
			scrollX = self.pageXOffset;
			scrollY = self.pageYOffset;
		}
		else if (document.documentElement && document.documentElement.scrollTop) // Explorer 6 Strict
		{
			scrollX = document.documentElement.scrollLeft;
			scrollY = document.documentElement.scrollTop;
		}
		else if (document.body) // all other Explorers
		{
			scrollX = document.body.scrollLeft;
			scrollY = document.body.scrollTop;
		}

		popupHeight = 240;
		popupWidth = 540;

		posTop = (scrollY+((windowY)/2)-(popupHeight/2));
		posLeft = ((windowX)/2)-(popupWidth/2);

		elem.style.top = posTop+'px';
		elem.style.left = posLeft+'px';

		elem.style.display = "block";
	} else {
		elem.style.display = "none";
	}
}

function insertFlash(type, link, id) {
	var s;
	link = type == 'Url' ? link : 'ShowImage.asp?ImageId='+link;
	
	s = 	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="221" height="215">'
			+	'	<param name="allowScriptAccess" value="never">'
			+	'	<param name="movie" value="'+link+'">'
			+	'	<embed allowScriptAccess="never" src="'+link+'" width="221" height="215">'
			+	'	</embed>'
			+	'</object>';

	document.write(s);
}

function insertVideo(type, link, id) {
	var s;
	link = type == 'Url' ? link : 'ShowImage.asp?ImageId='+link;
	
	s =		'<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" height="215" width="221">'
			+	'	<param name="fileName" value="'+link+'">'
			+	'	<param name="animationatStart" value="true">'
			+	'	<param name="transparentatStart" value="true">'
			+	'	<param name="autostart" value="false">'
			+	'	<param name="showControls" value="true">'
			+	'	<param name="loop" value="false">'
			+	'	<embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" displaysize="4" autosize="-1" showcontrols="true" showtracker="-1" showdisplay="0" showstatusbar="-1" videoborder3d="-1" src="'+link+'" autostart="false" designtimesp="5311" loop="false" height="215" width="221">'
			+	'</object>';
			
	document.write(s);


}