<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
//  Copyright:  (C) 03.2008 Templatka.pl. All Rights Reserved.
//  License:	GNU/GPL
//  Website: 	http://www.templatka.pl
?>

<?php
$lewyjest = $this->countModules('left') || $this->countModules('user1');
$prawyjest = $this->countModules('right') || $this->countModules('user2');
$mainmodule = 1;
$centrummodule = 1;

if ($lewyjest && $prawyjest) { $moduly = 3; } 
elseif ($lewyjest) { $moduly = 2; }
elseif ($prawyjest) { $moduly = 1; }
else { $moduly = 0; }

if ($moduly == 3) {$leftwidth = '25%'; $rightwidth = '24.7%'; $mainwidth = '50%';} 
if ($moduly == 2) {$leftwidth = '24.7%'; $mainwidth = '75%';} 
if ( $moduly == 1 ) {$rightwidth = '25%';$mainwidth = '74.7%';} 
if ( $moduly == 0 ) {$mainwidth = '100%';$headerwidth = '100%';} 


$slajdjest = $this->countModules('user20') || $this->countModules('user21') || $this->countModules('user22') || $this->countModules('user23') || $this->countModules('user24');
$m20jest = $this->countModules('user20');
$m21jest = $this->countModules('user21');
$m22jest = $this->countModules('user22');
$m23jest = $this->countModules('user23');
$m24jest = $this->countModules('user24');
$liczba = 0;
if ($m20jest) $liczba++;
if ($m21jest) $liczba++;
if ($m22jest) $liczba++;
if ($m23jest) $liczba++;
if ($m24jest) $liczba++;

$top3module = 0;
if ($this->countModules('header')) $top3module++;
if ($slajdjest) $top3module++;
if ($this->countModules('advert2')) $top3module++;
if ( $top3module == 3 ) {$top3width = '24.9%';$top13width = '49.9%';} 
else if ($top3module == 2) {$top3width = '33.2%';$top13width = '66.8%'; } 
else if ($top3module == 1) {$top3width = '100%';$top13width = '100%';} 

$top14width = '20%'; // 5 slajdow

$top1module = 0;
if ($this->countModules('user4')) $top1module++;
if ($this->countModules('user5')) $top1module++;
if ($this->countModules('user6')) $top1module++;
if ($this->countModules('user7')) $top1module++;
if ( $top1module == 4 ) {$top1width = '24.9%';} 
else if ($top1module == 3) {$top1width = '33.2%';} 
else if ($top1module == 2) {$top1width = '49.8%';} 
else if ($top1module == 1) {$top1width = '100%';} 

$top2module = 0;
if ($this->countModules('user8')) $top2module++;
if ($this->countModules('user9')) $top2module++;
if ($this->countModules('user10')) $top2module++;
if ($this->countModules('user11')) $top2module++;

if ( $top2module == 4 ) {$top2width = '24.9%';} 
else if ($top2module == 3) {$top2width = '33.2%';} 
else if ($top2module == 2) {$top2width = '49.8%';} 
else if ($top2module == 1) {$top2width = '100%';} 

$topjest = $top1module || $top2module || $top3module;

$bottom1module = 0;
if ($this->countModules('user12')) $bottom1module++;
if ($this->countModules('user13')) $bottom1module++;
if ($this->countModules('user14')) $bottom1module++;
if ($this->countModules('user15')) $bottom1module++;
if ( $bottom1module == 4 ) {$bottom1width = '24.9%';} 
else if ($bottom1module == 3) {$bottom1width = '33.2%';} 
else if ($bottom1module == 2) {$bottom1width = '49.8%';} 
else if ($bottom1module == 1) {$bottom1width = '100%';} 

$bottom2module = 0;
if ($this->countModules('user16')) $bottom2module++;
if ($this->countModules('user17')) $bottom2module++;
if ($this->countModules('user18')) $bottom2module++;
if ($this->countModules('user19')) $bottom2module++;
if ($bottom2module == 4 ) {$bottom2width = '24.9%';} 
else if ($bottom2module == 3) {$bottom2width = '33.2%';} 
else if ($bottom2module == 2) {$bottom2width = '49.8%';} 
else if ($bottom2module == 1) {$bottom2width = '100%';} 

?>