var cssId = 'myCss'; // you could encode the css path itself to generate id.. if (!document.getElementById(cssId)) { var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.id = cssId; link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://www.catholicdirectory.org/C-Publications/C-pageflip.asp?red=0&green=0&blue=0&hoverColour=FFAA00&PageHeight=1100&PageWidth=870'; link.media = 'all'; head.appendChild(link); } var Key = { Copyright: "diocese.cc", Key: "m2qZ0qmxqRSxCCuWCvKC" }; var Key = { Copyright: "diocese.cc", Key: "wgAyjJf7Nrw8WUTQy6EgW7HqilXP" }; //document.write(""); var $pageflip = $('#pageflip'), pageflip = $pageflip.pageflip(); /* MEET PAGEFLIP CUSTOM FUNCTIONS */ var animmode = 1, animbtns = [ "#animateontop", "#animateonvisible" ], loop = false, rot = 0, target, zooming = false, CustomPFEventHandler = { onFlip: function( PN ) { if( PN==18 ) $("#isflipping").addClass("selected"); }, onFlipEnd: function( PN ) { if( PN==18 ) $("#isflipping").removeClass("selected"); }, onTop: function( PN ) { if( PN==21 && animmode==0 ) startLoop(); if( PN==18 ) $("#isontop").addClass("selected"); }, onTopEnd: function( PN ) { if( PN==21 && animmode==0 ) stopLoop(); if( PN==18 ) $("#isontop").removeClass("selected"); }, onLoad: function( PN ) { if( PN==11 ) videoInit(); if( PN==18 ) setZoomFlag(); }, onUnload: function( PN ) { if( PN==21 && animmode==1 ) stopLoop(); }, onHide: function( PN ) { if( PN==21 && animmode==1 ) stopLoop(); if( PN==18 ) $("#isvisible").removeClass("selected"); }, onShow: function( PN ) { if( PN==21 ) { if( animmode==1 ) startLoop(); else setRot(); animation( animmode ); } if( PN==18 ) $("#isvisible").addClass("selected"); }, onZoomIn: function( PN ) { zooming = true; setZoomFlag(); }, onZoomOut: function( PN ) { zooming = false; setZoomFlag(); } }; gotoPage = function( p ) { pageflip.gotoPage( p, true ); } videoPlay = function() { var myVideo = document.getElementById("thevideo"); if (myVideo.paused) myVideo.play(); else myVideo.pause(); } videoInit = function() { //var myVideo = document.getElementById("thevideo"); } selectFeature = function( f ) { $(".features").addClass("off"); $("#feature"+f).removeClass("off"); $("#featurelist ul li").removeClass("selected"); $("#option"+f).addClass("selected"); } animation = function( t ) { animmode = t; $(".animationcontrol").removeClass("selected"); $(animbtns[t]).addClass("selected"); } theLoop = function() { if( loop ) raf2( theLoop ); setRot(); } setRot = function() { $("#spiral").css( { transform: "rotate("+rot+"deg)" } ); rot = ( rot+4 )%360; } startLoop = function() { if( !loop ) { loop = true; theLoop(); } } stopLoop = function() { loop = false; } setZoomFlag = function() { if( zooming ) $("#iszooming").addClass("selected"); else $("#iszooming").removeClass("selected"); } window.raf2 = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function( callback ) { window.setTimeout( callback, 100/6 ); }; })(); //var CustomPFEventHandler = { // onFlip: downloadPDF(11,PublicationID,PubDateID,"ChangePage") {} // } pageflip.setPFEventCallBack( CustomPFEventHandler ); /* END MEET PAGEFLIP CUSTOM FUNCTIONS */ function startPageflipCC(PublicationID, PubDateID) { /* Initialize & Start Pageflip 5 */ $pageflip.pageflipInit( { /* Configuration options */ PageDataFile: "C_Publicationlayout.asp?Publication="+PublicationID+"&Issue="+PubDateID+"&NoOfEditions=", PageWidth: 870, PageHeight: 1100, AutoMaxHeight: true, //SinglePageMode: false, Thumbnails: false, ThumbnailsToFront: false, FullScreenEnabled: true, ThumbnailsHidden: true, ThumbnailWidth: 60, ThumbnailHeight: 80, ThumbnailsAutoHide: 10000, Transparency: true, Margin: 0, MarginBottom: 35, ClickZoom: true, PinchZoom: true, ZoomEnabled: true, HardCover: false, AutoScale: true, FullScale: false, AlwaysOpened: false, AutoFlipLoop: -1, CenterSinglePage: true, DropShadowOpacity: 0.3, FlipTopShadowOpacity: 0.2, FlipShadowOpacity: 0.2, HardFlipOpacity: 0.3, EmbossOpacity: 0.2, SecondaryDragArea: 100, Transparency: true, ControlbarFile: "controlbar_svg.html", GoogleAnalytics: true, HashControl: true, ShareLink: "https://www.ChurchPaper.co.uk/C.asp?P=18&D=315", ShareText: "Leeds Catholic Post - Sept 2011 available online here!", ShareVia: "@ChurchPapers", ShareImageURL: "https://www.diocese.cc/FileSystem/11/Public/Publications/18/315/p1.png", ShowCopyright: false, Copyright: Key.Copyright, Key: Key.Key /* book ID - used as CSS class name */ }, "meetpageflip" ); } function changeFlipCC(PublicationID, PubDateID) { pageflip.closePageflip( function() { startPageflipCC(PublicationID, PubDateID);} ); } startPageflipCC('18', '315');