				var currentSlideShow;
				var slideTimeout;
				

				function getTop()
				{
				   var h = window.pageYOffset ||
				           document.body.scrollTop ||
				           document.documentElement.scrollTop;
				           
				   return h > 150 ? h + 50 : 150;
				}
				
				function changeVisibilityForFlash(doc , Visibility) 
                {
                    var toHide = doc.getElementsByTagName('embed');
                    for(var i=0; i < toHide.length; i++){
                        if (toHide[i].type && toHide[i].type == "application/x-shockwave-flash") 
						{
							toHide[i].height = Visibility == "hidden" ? '0px' : '250px';
						    toHide[i].style.visibility = Visibility;
						} 
                    }
                }
				
				function initOverlay(ifrm)
				{
					var height = document.getElementsByTagName('body')[0].clientHeight;
					var width = document.getElementsByTagName('body')[0].clientWidth;
					 
					document.getElementById('divOverlayBackground').style.height = height + 'px';
					document.getElementById('divOverlayBackground').style.width = width + 'px';
					
					document.getElementById('divOverlayBackground').style.visibility = 'visible'; 
					ifrm.style.visibility = 'visible'; 
					
				}
				
				function closeModalSlideShow()
				{
					parent.document.getElementById('divOverlayBackground').style.visibility = 'hidden'; 
					if (parent.currentSlideShow){
						parent.currentSlideShow.style.visibility = 'hidden'; 
					}
					changeVisibilityForFlash(parent.document, 'visible');
					clearTimeout(slideTimeout);
				}

				function makeDiv() {
					var d = document.createElement('div');
					
					d.setAttribute('id', 'divOverlayBackground');
					d.setAttribute('style', 'width:100%; height: 100%; z-index: 750; background-color: #333333;filter: Alpha(Opacity=40); -moz-opacity:0.4; opacity: 0.4; visibility: hidden' );
					d.style.left = '0px';
					d.style.top = '0px';
					d.style.position = 'absolute';
					d.style.z_index = '800';
					d.style.backgroundColor = '#333333';
					d.style.visibility = 'hidden';
					d.style.filter = 'Alpha(Opacity=40)';
					d.style.opacity = '0.4';
					document.body.appendChild(d);
					document.getElementById('divOverlayBackground').onclick=function() {closeModalSlideShow();};
				} 
				
				function makeFrame(srs) {
					var f = document.createElement("iframe");
					
					f.setAttribute('src', srs);
					f.setAttribute('style', 'visibility: hidden; z-index: 800; left: 45px; position: absolute;  scrolling: no; frameborder: none; border: none;');
					f.width = '866px'; 
					f.height = '724px';
					f.style.left = '45px';
					f.style.top = getTop() + 'px';
					f.style.position = 'absolute';
					f.style.z_index = '850';
					f.style.scrolling = 'no';
					f.scrolling = 'no';
					f.style.frameborder = 'none';
					f.style.border = 'none';
					
					document.body.appendChild(f);
					
					return f;
				} 
				
				function showModalSlideShow(srs)
				{
					makeDiv();
					var f = makeFrame(srs);
					currentSlideShow = f;
					changeVisibilityForFlash(document, 'hidden');
					initOverlay(f);
				}
				



