/* *********************************************************************
 *                                                                     *
 *                                                                     *
 *  (c)2007 d.k.d Internet Service GmbH - Nils Dehl               	   *
 *                                                                     *
 ********************************************************************* */

/* *** Main Function *** ********************************************* */

function getThePageName() {
	var currentUrl = location.href;
	var positionOfLastSlash = currentUrl.lastIndexOf('/');
	var positionOfLastPoint = currentUrl.lastIndexOf('.');
	var pageName = currentUrl.substring(positionOfLastSlash+1, positionOfLastPoint);
	return pageName;
}

function hiddePopup(){
	$('overlay').setStyle('display', 'none');
	$('FlashInfo').setStyle('display', 'none');
}

window.addEvent('domready', function(){	
	/* Config begin */
	var flashVersionRequired = 8;
	var swfPath = "../swf/shell.swf";
	var contentDiv = 'center';
	/* Config end */
	
	
	var flashVersion = Swiff.getVersion();

	
	if (flashVersion >= flashVersionRequired ){
		$(contentDiv).empty();
			
		/* inject Flash Object */
		var obj = Swiff(swfPath, {
			inject: $(contentDiv),
			width: '100%',
			height: document.documentElement.clientHeight,
			id: 'FlashBook',
			parameters: {
				wmode: 'transparent',
				quality: 'high'
			},
			vars: {
				ext_page: getThePageName(),
				ext_issue: 'test'
			}
		});
	} else {
		/* show install flash info */
		
		$('overlay').setStyle('display', 'block');
		$('FlashInfo').setStyle('display', 'block');
	}
	
});

/* *** EOF *** ******************************************************* */