<?php
/**
 * @version		$Id: view.feed.php 10381 2008-06-01 03:35:53Z pasamio $
* @package		Contact_Enhanced
 * @subpackage	Contact
 * @copyright	Copyright (C) 2006 - 2010 Ideal Custom Software Development
 * @author     Douglas Machado {@link http://ideal.fok.com.br}
 * @author     Created on 28-Jul-09
 * @license		GNU/GPL, see license.txt
 * Contact Enhanced  is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses. 
 */
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<?php if ( ( $this->contact->params->get( 'address_check' ) > 0 ) 
		&&  ( $this->contact->address || $this->contact->suburb  || $this->contact->state || $this->contact->country || $this->contact->postcode ) ) : ?>
<a name="address" ></a>
<div class="ce-address-container">

<?php if ( $this->contact->params->get( 'address_check' ) > 0 ){
	$style= 'style="background: url('.$this->contact->params->get( 'marker_address' ).') no-repeat"'; 
}else{
	$style='';
} ?>
<ul <?php echo $style; ?> class="ce-address-list">
<?php if ( $this->contact->address && $this->contact->params->get( 'show_street_address' ) ) : ?>
	<li>
		<?php
			if ($this->contact->params->get('contact_icons') == 1 ) {
				echo '<span class="ce-text-marker">'.$this->contact->params->get( 'marker_address' ).'</span>';
			} 
			echo nl2br($this->contact->address); ?>
	</li>
<?php endif; ?>
<?php if ( 
			($this->contact->suburb && $this->contact->params->get( 'show_suburb' ))
			OR ($this->contact->state && $this->contact->params->get( 'show_state' ))
			OR ( $this->contact->postcode && $this->contact->params->get( 'show_postcode' ) )
			OR ( $this->contact->country && $this->contact->params->get( 'show_country' ) ) 
		) :

		$address	= array( 	$this->contact->suburb,
								//$this->contact->postcode,
								$this->contact->state,
								$this->contact->postcode,
								$this->contact->country
							);
			
			foreach ($address as $key => $value) {
				if (is_null($value) OR $value == '') {
					unset($address[$key]);
				}
			}
	?>
	<li>
		<?php
			if ($this->contact->params->get('contact_icons') == 1 ) {
				echo '<span class="ce-text-marker"></span>';
			} 
			echo implode(', ',$address); ?>
	</li>
	<?php 
	/*if(trim($this->contact->country)){
		echo '<li>'.$this->contact->country.'</li>';
	}*/
	?>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>


<?php if ( ($this->contact->email_to && $this->contact->params->get( 'show_email' )) || $this->contact->telephone  || $this->contact->fax || $this->contact->mobile || $this->contact->webpage ) : ?>
<div class="ce-phone-container">
<ul  class="ce-phone-list">
<?php if ( $this->contact->email_to && $this->contact->params->get( 'show_email' ) ) : 
	$style= 'style="background: url('.$this->contact->params->get( 'marker_email' ).') no-repeat"';
	?>
	<li <?php echo $style; ?> >
		<?php
			 if ($this->contact->params->get('contact_icons') == 1 ) {
				echo '<span class="ce-text-marker">'.$this->contact->params->get( 'marker_email' ).'</span>';
			} 
			 echo $this->contact->email_to; ?>
	</li>
<?php endif; ?>
<?php if ( $this->contact->telephone && $this->contact->params->get( 'show_telephone' ) ) : 
	
	$style= 'style="background: url('.$this->contact->params->get( 'marker_telephone' ).') no-repeat"';
	?>
	<li <?php echo $style; ?> >
		<?php
			 if ($this->contact->params->get('contact_icons') == 1 ) {
				echo '<span class="ce-text-marker">'.$this->contact->params->get( 'marker_telephone' ).'</span>';
			} 
			echo  nl2br($this->contact->telephone); ?>
	</li>
<?php endif; ?>
<?php if ( $this->contact->fax && $this->contact->params->get( 'show_fax' ) ) : 
	$style= 'style="background: url('.$this->contact->params->get( 'marker_fax' ).') no-repeat"';
	?>
	<li <?php echo $style; ?> >
		<?php 
			 if ($this->contact->params->get('contact_icons') == 1 ) {
				echo '<span class="ce-text-marker">'.$this->contact->params->get( 'marker_fax' ).'</span>';
			} 
			echo nl2br($this->contact->fax); ?>
	</li>
<?php endif; ?>
<?php if ( $this->contact->mobile && $this->contact->params->get( 'show_mobile' ) ) :
	$style= 'style="background: url('.$this->contact->params->get( 'marker_mobile' ).') no-repeat"';
	?>
	<li <?php echo $style; ?> >
		<?php  
			 if ($this->contact->params->get('contact_icons') == 1 ) {
				echo '<span class="ce-text-marker">'.$this->contact->params->get( 'marker_mobile' ).'</span>';
			} 
			echo nl2br($this->contact->mobile); ?>
	</li>
<?php endif; ?>
<?php if ( $this->contact->skype && $this->contact->params->get( 'show_skype' ) ) :
	$style= 'style="background: url('.$this->contact->params->get( 'marker_skype' ).') no-repeat"';
	?>
	<li <?php echo $style; ?> >
		<?php  
			 if ($this->contact->params->get('contact_icons') == 1 ) {
				echo '<span class="ce-text-marker">'.$this->contact->params->get( 'marker_skype' ).'</span>';
			}
			echo JHTML::_('link','skype:'.$this->contact->skype.'?call',$this->contact->skype,array('title'=> JText::_('CE_CONTACT_SKYPE_DESC')));
		?>
	</li>
<?php endif; ?>
<?php if ( $this->contact->webpage && $this->contact->params->get( 'show_webpage' )) : 
	
	?>
	<li>
		<a href="<?php echo $this->contact->webpage; ?>" target="_blank">
			<?php echo $this->contact->webpage; ?></a>
	</li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>