<?php echo $header; ?>
<div class="box">
  <div class="title_left_3"><div class="title_right_3"><div class="title_middle_3"></div></div></div>
  <div class="box-content-2">
	<div id="breadcrumbs">
	  <?php foreach ($breadcrumbs as $breadcrumb) { ?>
		<div id="bread"><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a><span></span></div>
	  <?php } ?>
	</div>
  </div>
  <div class="bottom_left_2"><div class="bottom_right_2"><div class="bottom_middle_2"> </div></div></div>
</div>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div class="box">
 <div class="title_left"><div class="title_right"><div class="title_middle_3"><h1><?php echo $heading_title; ?></h1></div></div></div>
  <div class="box-content">
  <?php if ($news) { ?>
  <div class="title_left_3"><div class="title_right_3"><div class="title_middle_3"></div></div></div>
  <div class="product-filter">
    <div class="display"><?php echo $text_display; ?></div>
    <div class="limit"><b><?php echo $text_limit; ?></b>
      <select onchange="location = this.value;">
        <?php foreach ($limits as $limits) { ?>
        <?php if ($limits['value'] == $limit) { ?>
        <option value="<?php echo $limits['href']; ?>" selected="selected"><?php echo $limits['text']; ?></option>
        <?php } else { ?>
        <option value="<?php echo $limits['href']; ?>"><?php echo $limits['text']; ?></option>
        <?php } ?>
        <?php } ?>
      </select>
    </div>
  </div>
  <div class="bottom_left_2"><div class="bottom_right_2"><div class="bottom_middle_2"> </div></div></div>
  <br />
  <div class="product-list">
    <?php foreach ($news as $article) { ?>
    <div>
      <div class="name"><a href="<?php echo $article['href']; ?>"><?php echo $article['name']; ?></a></div>
	  <?php if ($article['thumb']) { ?>
        <div class="image"><a href="<?php echo $article['href']; ?>"><img src="<?php echo $article['thumb']; ?>" title="<?php echo $article['name']; ?>" alt="<?php echo $article['name']; ?>" /></a></div>
      <?php } else { ?>
	    <div class="image"><a href="<?php echo $article['href']; ?>"><img src="<?php echo $article['no_image']; ?>" title="<?php echo $article['name']; ?>" alt="<?php echo $article['name']; ?>" /></a></div>
      <?php } ?>
	  <div class="description-list"><?php echo $article['description_list']; ?></div>
	  <div class="description-grid"><?php echo $article['description_grid']; ?></div>
	  <div class="cart">
	    <div class="date-available"><?php echo $article['date_available']; ?></div>
		<div class="comments"><?php echo $article['news_comments']; ?></div>
		<div class="viewed"><?php echo $article['viewed']; ?></div>
		<div class="more"><a href="<?php echo $article['href']; ?>" class="button"><?php echo $button_more; ?></a></div>
      </div>
	</div>
    <?php } ?>
  </div>
  <div class="title_left_3"><div class="title_right_3"><div class="title_middle_3"></div></div></div>
  <div class="pagination-product"><?php echo $pagination; ?></div>
  <div class="bottom_left_2"><div class="bottom_right_2"><div class="bottom_middle_2"> </div></div></div>
  <?php } ?>
  <?php if ( !$news) { ?>
  <div class="content"><?php echo $text_empty; ?></div>
  <div class="buttons">
    <div class="right"><a href="<?php echo $continue; ?>" class="button"><?php echo $button_continue; ?></a></div>
  </div>
  <?php } ?>
  </div>
  <div class="bottom_left"><div class="bottom_right"><div class="bottom_middle"> </div></div></div>
  </div>
  <?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
function display(view) {
	if (view == 'list') {
		$('.product-grid').attr('class', 'product-list');
		
		$('.product-list > div').each(function(index, element) {
			html  = '<div class="right">';
			html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';			
			html += '</div>';

			html += '<div class="left">';
			
			var image = $(element).find('.image').html();
			
			if (image != null) { 
				html += '<div class="image">' + image + '</div>';
			}
			
			html += '  <div class="name">' + $(element).find('.name').html() + '</div>';
			html += '  <div class="description-list">' + $(element).find('.description-list').html() + '</div>';
			html += '  <div class="description-grid">' + $(element).find('.description-grid').html() + '</div>';
			html += '</div>';
						
			$(element).html(html);
		});	
		
		$('.poshytips').poshytip({
			className: 'tip-twitter',
			showTimeout: 1,
			alignTo: 'target',
			alignX: 'center',
			offsetY: 5,
			allowTipHover: false
		});
		
		$('.display').html('<?php echo $text_display; ?>&nbsp;<img align="absmiddle" src="catalog/view/theme/elegant/image/product-list-active.png">&nbsp;<a onclick="display(\'grid\');"><img align="absmiddle" src="catalog/view/theme/elegant/image/product-grid.png" title="<?php echo $text_grid; ?>"></a>');
		
		$.totalStorage('display', 'list'); 
	} else {
		$('.product-list').attr('class', 'product-grid');
		
		$('.product-grid > div').each(function(index, element) {
			html = '';
			
			html += '<div class="name">' + $(element).find('.name').html() + '</div>';
			
			var image = $(element).find('.image').html();
			
			if (image != null) {
				html += '<div class="image">' + image + '</div>';
			}
			
			html += '  <div class="description-list">' + $(element).find('.description-list').html() + '</div>';
			html += '  <div class="description-grid">' + $(element).find('.description-grid').html() + '</div>';
			html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';
			
			$(element).html(html);
		});	
		
		$('.poshytips').poshytip({
			className: 'tip-twitter',
			showTimeout: 1,
			alignTo: 'target',
			alignX: 'center',
			offsetY: 5,
			allowTipHover: false
		});
					
		$('.display').html('<?php echo $text_display; ?>&nbsp;<a onclick="display(\'list\');"><img align="absmiddle" src="catalog/view/theme/elegant/image/product-list.png" title="<?php echo $text_list; ?>"></a>&nbsp;<img align="absmiddle" src="catalog/view/theme/elegant/image/product-grid-active.png">');

		$.totalStorage('display', 'grid');
	}
}

view = $.totalStorage('display');

if (view) {
	display(view);
} else {
	display('list');
}
//--></script> 
<?php echo $footer; ?>