<?php
$gallery_map_flag = get_option('ptthemes_detail_gallery_map_flag');
if($gallery_map_flag=='Hide Both')
{
	
}else
{
	
	if($gallery_map_flag=='')
	{
		$gallery_map_flag = 'Map&Gallery Both - Default Map';	
	}
	?>
	
	<?php
	if($gallery_map_flag=='Map&Gallery Both - Default Map' || $gallery_map_flag=='Map&Gallery Both - Default Gallery')
	{
	?> 
	<script type="text/javascript">
	function show_hide_tabs(type)
	{
		if(type=='map')
		{
			document.getElementById('pikachoose').style.display='none';
			document.getElementById('detail_google_map_id').style.display='block';
			document.getElementById('li_location_map').className='active';
			document.getElementById('li_image_gallery').className='';
		}else if(type=='gallery')
		{
			document.getElementById('pikachoose').style.display='block';
			document.getElementById('detail_google_map_id').style.display='none';
			document.getElementById('li_location_map').className='';
			document.getElementById('li_image_gallery').className='active';
		}
	}
	</script>     
	<div class="tabber">
	 <ul class="tab">
		<li id="li_location_map" <?php if($gallery_map_flag=='Map&Gallery Both - Default Map'){echo 'class="active"';}?>> <a href="javascript:void(0):" onclick="show_hide_tabs('map');"><?php _e('Location Map');?></a></li>
		<li id="li_image_gallery" <?php if($gallery_map_flag=='Map&Gallery Both - Default Gallery'){echo 'class="active"';}?> > <a href="javascript:void(0):" onclick="show_hide_tabs('gallery');"><?php _e('Image Gallery');?></a></li>
		<li class="fr" > <a href="#" onclick="window.print();return false;" class="i_print"><?php _e('Print');?></a></li>
	 </ul>
	</div>
	<?php }?>
	
	<?php
	if($gallery_map_flag=='Map&Gallery Both - Default Map' || $gallery_map_flag=='Map&Gallery Both - Default Gallery' || $gallery_map_flag=='Gallery Only')
	{
	?>        
	<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/library/js/jquery.pikachoose.js"></script>
	
	<script language="javascript" type="text/javascript">
	$(document).ready(
		function (){
			$("#pikame").PikaChoose();
	
		});
	</script>
	<div class="pikachoose" id="pikachoose" <?php if($gallery_map_flag=='Map&Gallery Both - Default Gallery' || $gallery_map_flag=='Gallery Only'){}else{ echo 'style="display:none;"';}?> >
	<?php $post_images = bdw_get_images($post->ID,'large');?>
	<?php if(count($post_images)>0){?>
	<ul id="pikame" class="jcarousel-skin-pika">
	
	<?php
	global $thumb_url;
		for($im=0;$im<count($post_images);$im++)
		{
		?>
	   <li>
			<img src="<?php echo bloginfo('template_url'); ?>/thumb.php?src=<?php echo $post_images[$im];?>&amp;w=570&amp;h=400&amp;zc=1&amp;q=80<?php echo $thumb_url;?>" alt=""    />
		</li>
	<?php }
		?>	
		   </ul>
	<?php }else{
	 _e('No image gallery uploaded');
	}?>        
	</div>
	<?php }?>           
	
	<?php
	if($gallery_map_flag=='Map&Gallery Both - Default Map' || $gallery_map_flag=='Map&Gallery Both - Default Gallery' || $gallery_map_flag=='Map Only')
	{
	?> 
	<div class="google_map" id="detail_google_map_id"   style=" <?php if($gallery_map_flag=='Map Only'){ echo 'width:593px; height:400px;';} if($gallery_map_flag=='Map&Gallery Both - Default Map' || $gallery_map_flag=='Map Only'){ }else{echo ' display:none;';}?>"  > 
	<?php 
	$geo_latitude = get_post_meta($post->ID,'geo_latitude',true);
	$geo_longitude = get_post_meta($post->ID,'geo_longitude',true);
	$map_type = get_post_meta($post->ID,'map_view',true);
	include_once (TEMPLATEPATH . '/library/map/google_map_detail.php');?> 
	</div>  <!-- google map #end -->
	<?php }?>
<?php }?>