<?php
#-------------------------------------------------------------------------
# Project [iPad 3D]
# Version: [activeproject_activever]  Alan Ryan www.codecrunchers.ie
# 2:17:50 AM -  Nov 4, 2010
#-------------------------------------------------------------------------
$COLSINROW = 6;
$COLSINROW_LANDSCAPE_MODE = 3;

$cr = chr(13); // 0x0D [\r]
$lf = chr(10); // 0x0A [\n]
define('NEWLINE',  $cr); 

echo '<script type="text/javascript">';
echo NEWLINE;
if((isset($IS_LANDSCAPE_PUB) && $IS_LANDSCAPE_PUB===TRUE)) 
	echo 'var  IS_LANDSCAPE_PUB =  true;'; 
else
	echo  'var  IS_LANDSCAPE_PUB =  false;';
echo NEWLINE;
echo 'var THUMBHEIGHT= '.$thumbHeight.';';
echo NEWLINE;
echo 'var THUMBWIDTH= '.$thumbWidth.';';
echo NEWLINE;
echo 'var COLSINTHUMBROW = IS_LANDSCAPE_PUB ? '.$COLSINROW_LANDSCAPE_MODE.':'.$COLSINROW.';';
echo NEWLINE;
echo 'var IMAGE_PRELOAD_L_COUNT = 5;';
echo NEWLINE;
echo 'var IMAGE_PRELOAD_P_COUNT = 3;';
echo NEWLINE;
echo 'var pSpeed=18; //speed of page transition';
echo NEWLINE;
echo 'var myPageW_L='.$preZoomWidth_L.'; //page width landscape';
echo NEWLINE;
echo 'var myPageH_L='.$preZoomHeight_L.'; //page height landscape';
echo NEWLINE;
echo 'var myPageW_P='.$preZoomWidth_P.'; //page width portrait';
echo NEWLINE;
echo 'var myPageH_P='.$preZoomHeight_P.'; //page height portrait';
echo NEWLINE;
echo 'var pageBorderWidth=1; //adjust border width';
echo NEWLINE;
echo 'var pageBorderColor="#000000"; //border color';
echo NEWLINE;
echo 'var pageBorderStyle="solid"; //border style eg. solid, dashed or dotted.';
echo NEWLINE;
echo 'var totalPageCount = ' . $totalPageCount .';';
echo NEWLINE;
echo 'var CPBACKGROUND = "'  .$bgColour.'";';
echo NEWLINE;
echo 'var THUMBCPBACKGROUND = "#958f81";';
echo NEWLINE;
echo 'var TEXT_CONTENTS= "'.$TEXT_CONTENTS.'";';
echo NEWLINE;
echo 'var TEXT_THUMBNAILS = "'.$TEXT_THUMBNAILS .'";';
echo NEWLINE;
echo 'var TEXT_SEARCH = "'.$TEXT_SEARCH.'";';
echo NEWLINE;
echo 'var TEXT_PROMPT_AUDIO = "'.$TEXT_PROMPT_AUDIO .'";';
echo NEWLINE;
echo 'var TEXT_PROMPT_VIDEO = "'.$TEXT_PROMPT_VIDEO .'";';
echo NEWLINE;

$CPMARGIN = $IS_LANDSCAPE_PUB ? 55 : 75;

echo "$(document).ready(function(){".NEWLINE.
	 //"$('.cpcontrols').css('background-color',CPBACKGROUND);".NEWLINE.
	 //"$('#thumbnailnav').css('background-color',THUMBCPBACKGROUND);".NEWLINE.
	 "$('#cparea').css('width',(THUMBWIDTH * COLSINTHUMBROW) + " . $CPMARGIN  .");".NEWLINE;
	
	if($IS_LANDSCAPE_PUB === TRUE){	 
	 	echo "$('.jcarousel-next-vertical').css('left','150px')".NEWLINE;
	 	echo "$('.jcarousel-prev-vertical').css('left','150px')";
	}
	 
	 if(isset($this_page) && $this_page!='' && $this_page!=1){
		echo NEWLINE;
		echo "$('#ff_panel').show();";				
		echo NEWLINE."goTo($this_page);".NEWLINE;		
		echo "hotSpotTimerLoad($this_page)".NEWLINE;	
	}

echo "});".NEWLINE;

echo "function hotSpotTimerLoad(indexPage){".NEWLINE.
	"if(getPageLoadedCount() < indexPage) {".NEWLINE.
		"setTimeout(hotSpotTimerLoad,200);".NEWLINE.
		"if(consoleLog)  console.log('TO on HotSpot Load');".NEWLINE.
	" } else { ".NEWLINE.
		"activateMap();".NEWLINE.
		//"$('#ff_panel').hide();".NEWLINE.
		"}".NEWLINE.
"}".NEWLINE;


echo "var slideWidth = ". ($preZoomWidth_P). ";//amount to slide for image in PMode". NEWLINE;
echo '</scr'.'ipt>';
?>