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

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


function fullscreen(pagenr) {
	
	if (Client.Engine.ie) {	
		window.open("fullscreen.php?page="+pagenr,"Rothenberger","fullscreen=yes,scrollbars=no,menubar=no,status=no,toolbar=no,resizable=no");
	}  else {
		window.open("fullscreen.php?page="+pagenr,"Rothenberger","fullscreen=yes,scrollbars=no,menubar=no,status=no,toolbar=no,resizable=yes");
	}
}

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');
}

function closeWindow(){
	self.close();
}

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

	
	if (flashVersion >= flashVersionRequired ){
		$(contentDiv).empty();
		$('center').setStyle('width','auto');
//		$('container').setStyle('width','815px');
//		$('posBox').setStyle('width','815px');
//		$('box').setStyle('padding','0px');
//		$('header').setStyle('width','815px');
			
		/* inject Flash Object */
		var obj = Swiff(swfPath, {
			inject: $(contentDiv),
			width: '100%',
			height: document.documentElement.clientHeight,
//			width: 815,
//			height: 563,
			id: 'FlashBook',
			parameters: {
				wmode: 'transparent',
				quality: 'high'
			},
			vars: {
				ext_page: getThePageName(),
				ext_issue: 'hk2008de',
				ext_fullscreen: 'true'
			}
		});
	} else {
		/* show install flash info */
		
		$('overlay').setStyle('display', 'block');
		$('FlashInfo').setStyle('display', 'block');
	}
	
});

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