    var uid = new Date().getTime();
    var flashProxy = new FlashProxy(uid, 'oppromedia/flippingbook/system/JavaScriptFlashGateway.swf');
    
    // img change vars
    CachedImages = new Array();
    CachedImages['first'] = new Image();
    CachedImages['first'].src = "oppromedia/flippingbook/layout/flippingbook_first.png";
    CachedImages['first_highlight'] = new Image();
    CachedImages['first_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_first_highlight.png";
    CachedImages['previous'] = new Image();
    CachedImages['previous'].src = "oppromedia/flippingbook/layout/flippingbook_previous.png";
    CachedImages['previous_highlight'] = new Image();
    CachedImages['previous_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_previous_highlight.png";
    CachedImages['play'] = new Image();
    CachedImages['play'].src = "oppromedia/flippingbook/layout/flippingbook_play.png";
    CachedImages['play_highlight'] = new Image();
    CachedImages['play_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_play_highlight.png";
    CachedImages['next'] = new Image();
    CachedImages['next'].src = "oppromedia/flippingbook/layout/flippingbook_next.png";
    CachedImages['next_highlight'] = new Image();
    CachedImages['next_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_next_highlight.png";
    CachedImages['last'] = new Image();
    CachedImages['last'].src = "oppromedia/flippingbook/layout/flippingbook_last.png";
    CachedImages['last_highlight'] = new Image();
    CachedImages['last_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_last_highlight.png";
    CachedImages['print'] = new Image();
    CachedImages['print'].src = "oppromedia/flippingbook/layout/flippingbook_print.png";
    CachedImages['print_highlight'] = new Image();
    CachedImages['print_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_print_highlight.png";
    CachedImages['sound'] = new Image();
    CachedImages['sound'].src = "oppromedia/flippingbook/layout/flippingbook_sound.png";
    CachedImages['sound_highlight'] = new Image();
    CachedImages['sound_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_sound_highlight.png";
    CachedImages['close'] = new Image();
    CachedImages['close'].src = "oppromedia/flippingbook/layout/flippingbook_close.png";
    CachedImages['close_highlight'] = new Image();
    CachedImages['close_highlight'].src = "oppromedia/flippingbook/layout/flippingbook_close_highlight.png";
    
    // special vars
    var bSlideShowActive = false;
    var bSoundActive = true;
    var iCurrentSite = 0;

    //call this when you want to call the AS
    function nextPage() {
        flashProxy.call('nextPage'); 
    }
    
    function nextPageEx() {
        flashProxy.call('nextPageEx'); 
    }

    function prevPage() {
        flashProxy.call('prevPage'); 
    }
    
    function firstPage() {
        flashProxy.call('firstPage'); 
    } 
       
    function lastPage() {
        flashProxy.call('lastPage'); 
    }
    
    function toggleSlideShow() {
        if(bSlideShowActive == false) { 
            startSlideShow();
            bSlideShowActive = true;        
        }
        else {
            stopSlideShow();
            bSlideShowActive = false;        
        }    
    }
    
    function startSlideShow() {
        flashProxy.call('startSlideShow'); 
    }
    
    function stopSlideShow() {
        flashProxy.call('stopSlideShow'); 
    }
    
    function toggleSound() {
        if(bSoundActive == false) { 
            activateSound();
            bSoundActive = true;        
        }
        else {
            deactivateSound();
            bSoundActive = false;        
        }    
    }    
    
    function activateSound() {
        flashProxy.call('activateSound');         
    }
    
    function deactivateSound() {
        flashProxy.call('deactivateSound');        
    }
    
    function printLeftPage() {
        flashProxy.call('printLeftPage'); 
    }
    
    function printRightPage() {
        flashProxy.call('printRightPage'); 
    }
    
    function gotoPage() {
        iSite = document.getElementById('select_page').value;
        flashProxy.call('gotoPage', iSite); 
    }
    
    function updateSelected(iSite) {
        document.getElementById('select_page').value = (iSite != undefined) ? iSite : 0 ;
    }
    
    function toggleZoom(iSite) {
        openZoom(ZoomImages[iSite]);
        iCurrentSite = iSite;
    }
    function printPage(sUrl) {
        OpenWindow(sUrl + 'site=' + ZoomImages[iCurrentSite],800,600,10,10);    
    }

