	/* ==================================== */
	/* PRODUCT PORTLET 						*/
	/* ==================================== */
	function showPanel(id)
	{
		for (i = 1; i <= 4; i++) {
			document.getElementById("panel" + i + "_li").className = '';
				
			document.getElementById("panel" + i).style.display = 'none';
		}
			
		document.getElementById("panel" + id + "_li").className = 'active';
		document.getElementById("panel" + id).style.display = 'block';
	}
	
	function activateLi(id, n)
	{
		for (i = 1; i <= n; i++) {
			document.getElementById("panel" + i + "_li").className = '';
		}
			
		document.getElementById("panel" + id + "_li").className = 'active';
	}

	function swapImage(normal_url, detailed_url, id_old, id) {
		var old_detailed = document.getElementById(id_old).href;
		
		for (var i=0; i<document.images.length; i++) {
			if (document.images[i].src.indexOf (old_detailed) != -1) {
				document.images[i].src = detailed_url;
				
				document.getElementById(id_old).href = detailed_url;
			}
		}
		
		document.getElementById(id).src = normal_url;
	}

	function changeProductPanel(option, video) {
		if (option == 'video')
		{
			flashembed("productDetailsVideo",
					   {
				   			src:"/quicklivecore/swf/QuickLivePlayerDark.swf",
				   			width: 270,
				   			height: 400
				   		},
				   		{config: {   
							loop: true,
							autoPlay: true,
							controlBarBackgroundColor: '-1',
							initialScale: 'fit',
							videoFile: video,
							controlBarGloss:'none',
							showStopButton: false,
							showMuteVolumeButton: false,
							showFullScreenButton: false,
							showVolumeSlider: false,
							showMenu: false,
							controlsOverVideo: 'ease'
								}
						});
			
			document.getElementById('productDetailsImage').style.display = 'none';
			document.getElementById('productDetailsVideo').style.display = 'block';
			document.getElementById('productDetailsThumbs').style.display = 'none';
			
			document.getElementById('productDetailsOptions').innerHTML = "<h3 class=\"videos\"><a onclick=\"javascript:changeProductPanel('images', '" + video + "')\" href=\"#\">Images</a></h3>"
		}
		else if (option == 'images')
		{
			document.getElementById('productDetailsVideo').innerHTML = '';
			document.getElementById('productDetailsImage').style.display = 'block';
			document.getElementById('productDetailsVideo').style.display = 'none';
			document.getElementById('productDetailsThumbs').style.display = 'block';
			
			document.getElementById('productDetailsOptions').innerHTML = "<h3 class=\"text\"> Roll over image to zoom </h3><h3 class=\"videos\"><a onclick=\"javascript:changeProductPanel('video', '" + video + "')\" href=\"#\">Video</a></h3>";
		}
	}
	