<?php 
$parser = parse_publication_data('bookinfo.xml');
if($parser===null){	
	trigger_error("Book Data Not Parsed",E_USER_ERROR);
	die;
}

$arrValue030=$parser->document->value030;
$arrAttrValue030=$arrValue030[0]->tagAttrs;

$_ver = isset($arrAttrValue030['value310']) ? (int) $arrAttrValue030['value310'] : (int)3 ;
define("_3DGENERATORVERSION",$_ver );

if(_3DGENERATORVERSION >= 4){
	$enableContents =  (int) $arrAttrValue030['value034'] > 0 ? TRUE:FALSE;
	$enableSearch = (int) $arrAttrValue030['value038'] > 0 ? TRUE:FALSE;
}else{
	$enableContents =   $arrAttrValue030['value034'] === 'true' ? TRUE:FALSE;
	$enableSearch =  $arrAttrValue030['value038']  === 'true'  ? TRUE:FALSE;
}

$enableCP = true; 


$totalPageCount = $arrAttrValue030['value040'];
if(isset($arrAttrValue030['value213'])){
	$bgColour = $arrAttrValue030['value213']==""?"#f1f1f1":$arrAttrValue030['value213'];
}else
{
	$bgColour = "#f1f1f1";
}

$IS_LANDSCAPE_PUB  = FALSE;
//dimensions
//PORTRAIT
$actualWidth_P =	isset($arrAttrValue030['value028'])?$arrAttrValue030['value028']:-1;
$actualHeight_P =	isset($arrAttrValue030['value029'])?$arrAttrValue030['value029']:-1;
$preZoomWidth_P =	isset($arrAttrValue030['value031p'])?$arrAttrValue030['value031p']:-1;
$preZoomHeight_P =	isset($arrAttrValue030['value032p'])?$arrAttrValue030['value032p']:-1;
//LANDSCAPE
$actualWidth_L =	$actualWidth_P;
$actualHeight_L =	$actualHeight_P;
$preZoomWidth_L =	isset($arrAttrValue030['value031l'])?$arrAttrValue030['value031l']:-1;
$preZoomHeight_L =	isset($arrAttrValue030['value032l'])?$arrAttrValue030['value032l']:-1;

if($actualWidth_L >= $actualHeight_L) {
	$IS_LANDSCAPE_PUB = TRUE;
	$preZoomWidth_P  = 		$preZoomWidth_L;
	$preZoomHeight_P  = 	$preZoomHeight_L;	
}
	 
//Adjust dir for landscape publication
$PREZOOM_IMG_SRC_FOLDER = $IS_LANDSCAPE_PUB  ? PREZOOM_FOLDER . DIRECTORY_SEPARATOR . PREZOOM_L . DIRECTORY_SEPARATOR : PREZOOM_FOLDER . DIRECTORY_SEPARATOR . PREZOOM_P . DIRECTORY_SEPARATOR ;

//THUMBS
$thumbWidth = $arrAttrValue030['value070'];
$thumbHeight = $arrAttrValue030['value071'];

//TRANSLATIONS

define("BRANDING","Powered by 3DIssue");

$arrValue002=$parser->document->value002;
$arrAttrValue002=$arrValue002[0]->tagChildren;

for($j=0;$j<COUNT($arrAttrValue002);$j++){
	if($arrAttrValue002[$j]->tagName == 'value600'){
		$TEXT_CONTENTS = ($arrAttrValue002[$j]->tagData);
	}
	if($arrAttrValue002[$j]->tagName == 'value606'){
		$TEXT_THUMBNAILS = ($arrAttrValue002[$j]->tagData);
	}	
	if($arrAttrValue002[$j]->tagName == 'value603'){
		$TEXT_SEARCH = ($arrAttrValue002[$j]->tagData);
	}	
	if($arrAttrValue002[$j]->tagName == 'value614'){
		$TEXT_PROMPT_AUDIO = ($arrAttrValue002[$j]->tagData);
	}
	if($arrAttrValue002[$j]->tagName == 'value616'){
		$TEXT_PROMPT_VIDEO = ($arrAttrValue002[$j]->tagData);
	}
}
?>