function openPopup(FILE, NAME, HEIGHT, WIDTH)
{
    window.open(FILE, NAME, "menubar=no,scrollbars=yes,toolbar=no,height=" + HEIGHT + ",width=" + WIDTH);
}

function StartGallery(galleryContainerID) {

    var firstLink = document.getElementById(galleryContainerID).getElementsByTagName("a")[0];
    
    if(firstLink) {
        
        myLightbox.start(firstLink);
    }
}

function showVideoLayer() {

	var top = 100 + getCurrentTop();
	document.getElementById("layerVideo").style.top = top + "px";
	
	var content = "";
	content += '<div class="layerVideoTop" >';
	content += '    <img src="/img/videoLayerTop.gif" alt="videoLayerTop" />';
	content += '</div>';
	content += '<div class="layerVideoMiddle" id="layerBoxMiddle">';
	content += '<div class="layerVideoHeadline">Assekurata - Maklerrating</div><div class="layerVideoClose"><a href="javascript:hideVideoLayer();"><img src="/img/videoLayerClose.gif" alt="schließen" /></a></div>';
	content += '<div class="videoPlayer" id="videoPlayer">';
	content += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="640" height="550" id="Imagefilm" align="middle">';
	content += '<param name="allowScriptAccess" value="sameDomain" />';
	content += '<param name="allowFullScreen" value="false" />';
	content += '<param name="movie" value="Imagefilm.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />	<embed src="Imagefilm.swf" quality="high" bgcolor="#000000" width="640" height="550" name="Imagefilm" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />';
	content += '</object>';
    content += '</div>';
	content += '</div>';
	content += '<div class="layerVideoBottom" >';
	content += '    <img src="/img/videoLayerBottom.gif" alt="videoLayerBottom" />';
	content += '</div>';
	
    if(document.getElementById("layerVideo").style.display == "none") {
    
    	document.getElementById("layerVideo").innerHTML = content;
        Effect.Appear($('layerVideo'),{duration:1, from: 0.0, to: 2.0});
    }
    else {
    
    	document.getElementById("layerVideo").innerHTML = content;
    }
}

function hideVideoLayer() {

    Effect.Fade(document.getElementById("layerVideo"),{duration: 1, from: 1.0, to:0.0});
    document.getElementById("videoPlayer").innerHTML = "";
}

function getCurrentTop() {
	  var top = 0;
	  if( typeof( window.pageYOffset ) == 'number' ) {
	    //Netscape compliant
		  top = window.pageYOffset;
	  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
	    //DOM compliant
	    scrOfY = document.body.scrollTop;
	  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	    //IE6 standards compliant mode
		  top = document.documentElement.scrollTop;
	  }
	  return top;
	}
