<?php
#-------------------------------------------------------------------------
# Project [3d iPad]
# Version: [1]  Alan Ryan www.codecrunchers.ie
# 9:39:35 PM -  Nov 11, 2010
#-------------------------------------------------------------------------#

$arrValue001=$parser->document->value001[0]->tagChildren;


$RELDATAPATH="../";//;.DIRECTORY_SEPARATOR;
$DEPLOYDIR_PATH_AMENDED='';

//Updated Mar 11, Alan - hotspot patch incorrect in virtual dirs
if(isset($zoomed) && $zoomed){ 
	$RELDATAPATH.="../";	
	$DEPLOYDIR_PATH_AMENDED= '../';
}




for ($mapIndx = 1 ; $mapIndx <= $totalPageCount; $mapIndx++) { ?>
 
<div
	id="parts<?php echo $mapIndx  ?>" style="display: none;"
	name="parts<?php echo $mapIndx  ?>" class="mapparts"><!-- Code For Mapping Area Of Page <?php echo $mapIndx ?> -->

<?php
for($k=0;$k<count($arrValue001);$k++){


	$arrAttrValue001=$arrValue001[$k]->tagAttrs;
	$curMapIndex = $arrAttrValue001['value014'];//page no
	$target =	$arrAttrValue001['value020'];

	if( $mapIndx == $curMapIndex  ){
	
		/*----  Code For Hotspot Mapping ----*/
		if(($arrAttrValue001['value013'])	===	'hot')
		{
			
			if( isset($zoomed) && $zoomed) {				
					$x_location	=	$arrAttrValue001['value016'];
					$y_location	=	$arrAttrValue001['value017'];
					$h_width =	$arrAttrValue001['value018'];
					$h_height	=	$arrAttrValue001['value019'];								
				
			}else{
				if(defined(PORTRAIT) && PORTRAIT == TRUE && $IS_LANDSCAPE_PUB == FALSE){
					$x_location	=	$arrAttrValue001['value016p'];
					$y_location	=	$arrAttrValue001['value017p'];
					$h_width =	$arrAttrValue001['value018p'];
					$h_height	=	$arrAttrValue001['value019p'];  
					
				}else { //LANDSCAPE				
					$x_location	=	$arrAttrValue001['value016l'];
					$y_location	=	$arrAttrValue001['value017l'];
					$h_width =	$arrAttrValue001['value018l'];
					$h_height	=	$arrAttrValue001['value019l'];
				}
			}
	
			$posflv=	strpos($target,'flv');
			$posmp4	=	strpos($target,'mp4');
			$posmp3	=	strpos($target,'mp3');
			$posat =	strpos($target,'@') ;
			$poshttp =	strpos($target,'http');
			$posNumber =	$target;
			
			if( isset($posmp4) && $posmp4){
				
				$target = $RELDATAPATH . $target;
				
							
				?>
				
<div class="hs_mp<?php echo $mapIndx ?>"  style="border:1px solid #000; z-index:1800;position: absolute; height:<?php echo $h_height ?>px ; width:<?php echo $h_width ?>px ; top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
<a href="<?php echo $target ?>" rel="shadowbox;width=320;height=256"> <img class="hotspot" height="<?php echo $h_height ?>" width="<?php echo $h_width ?>" src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/onepix.png" />
</a></div>

				<?php } elseif($posmp3) {
					//$target = dirname($target) . DIRECTORY_SEPARATOR . urlencode(basename($target));
					$target = $RELDATAPATH . $target;
				 ?>

<div class="hs_mp<?php echo $mapIndx ?>" style="border:1px solid #000; z-index:1800;position: absolute; height:<?php echo $h_height ?>px ; width:<?php echo $h_width ?>px ; top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
<a href="<?php echo $target ?>" rel="shadowbox;width=250;height=50" title="(touch anywhere to stop)">
<img class="hotspot" height="<?php echo $h_height ?>" width="<?php echo $h_width ?>"
	src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/onepix.png" /> </a></div>

				 <?php } elseif($posat) { ?>

<div class="hs_mp<?php echo $mapIndx ?>"  style="border:1px solid #000; z-index:1800;position: absolute; height:<?php echo $h_height ?>px ; width:<?php echo $h_width ?>px ; top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
<a href="mailto:'<?php echo $target ?>'"> <img height="<?php echo $h_height ?>" width="<?php echo $h_width ?>"
	src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/onepix.png" class="hotspot"/> </a> </div><?php }	elseif($posNumber > 0){ ?>

<div class="hs_mp<?php echo $mapIndx ?>"  style="border:1px solid #000; z-index:1800;position: absolute; height:<?php echo $h_height ?>px ; width:<?php echo $h_width ?>px ; top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
<a href="javascript:goTo(<?php echo $target?>);" > <img class="hotspot" height="<?php echo $h_height ?>" width="<?php echo $h_width ?>"
	src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/onepix.png" /> </a></div>

				 <?php	}	elseif($poshttp === 0)	{ ?>

<div class="hs_mp<?php echo $mapIndx ?>"  style="border:1px solid #000; z-index:1800;position: absolute; height:<?php echo $h_height ?>px ; width:<?php echo $h_width ?>px ; top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
<a href="<?php echo $target?>" target="_blank"> <img class="hotspot" height="<?php echo $h_height ?>" width="<?php echo $h_width ?>"
	src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/onepix.png" /> </a></div>
				 <?php
					}
		}  /*----  Code For Button Mapping ----*/
		else
		{			
						
		if( isset($zoomed) && $zoomed) {
				if(_3DGENERATORVERSION >= 40){
					$x_location	=	$arrAttrValue001['value016'];
					$y_location	=	$arrAttrValue001['value017'];					
				}else{
					$x_location	=	$arrAttrValue001['value018'];
					$y_location	=	$arrAttrValue001['value019'];
				}
			}else{
				if(defined(PORTRAIT) && PORTRAIT == TRUE && $IS_LANDSCAPE_PUB == FALSE){
					$x_location	=	$arrAttrValue001['value018p'];
					$y_location	=	$arrAttrValue001['value019p'];
					
				}else { //LANDSCAPE
					$x_location	=	$arrAttrValue001['value018l'];
					$y_location	=	$arrAttrValue001['value019l'];
									
				}
			}
			$btn				=	$arrAttrValue001['value013'];
			$nowBWidth			=	22;//mapped area width
			$nowBHeight			=	22;//mapped area height

			if($btn === 'em' || $btn === 'com')
			{
			?>
				
			<div class="hs_mp<?php echo $mapIndx ?>" style="z-index:1800;position: absolute;top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
			<a href="mailto: <?php echo $target ?>"> 
				<img src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/email.png" class="hotspot"/> 
			</a></div>			
							
			<?php } elseif($btn === 'wl')	{	?>
				
			<div class="hs_mp<?php echo $mapIndx ?>" style="z-index:1800;position: absolute;top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
			<a href="<?php echo $target?>" target="_blank"> 
				<img src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/link.png" class="hotspot"/> </a></div>

				<?php } elseif($btn === 'pal') 	{
					$target = $RELDATAPATH . $target;
				?>
				<div class="hs_mp<?php echo $mapIndx ?>"  style="z-index:1800;position: absolute;top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
				<a href="<?php echo $target ?>" rel="shadowbox;width=180;height=0" title="(touch anywhere to stop)"> <img class="hotspot" src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/audio.png" />
				</a></div>				

				<?php }	elseif($btn === 'pvl' &&  strpos($target,".flv") === FALSE)	{
					$target = $RELDATAPATH . $target;	
					?>
					
			<div class="hs_mp<?php echo $mapIndx ?>" style="z-index:1800;position: absolute;top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
				<a href="<?php echo $target ?>" rel="shadowbox;width=180;height=180"> <img class="hotspot" src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/video.png" />
				</a></div>

				<?php } 	elseif($btn === 'gtp')	{
					?>
				
			<div class="hs_mp<?php echo $mapIndx ?>" style="z-index:1800;position: absolute;top: <?php echo  $y_location ?>px;left: <?php echo  $x_location ?>px;">
				<a href="javascript:goTo(<?php echo $target?>);" > <img
				src="<?php echo $DEPLOYDIR_PATH_AMENDED ?>images/uiII/jumpto.png" class="hotspot"/> </a></div>

				<?php }  
			}
	}
}
echo '</div>';
}  //end page loop
?>