<?php
/*------------------------------------------------------------------------
# JA Rochea for Joomla 1.5 - Version 1.4 - Licence Owner JA98521
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites:  http://www.joomlart.com -  http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
include_once (dirname(__FILE__).DS.'ja_templatetools.php');
//include (dirname(__FILE__).DS."ja_module/ja_module_template.php");

$tmpTools = new JA_Tools($this);
$tmpTools->setColorThemes(array('default','dark','red'));

# Auto Collapse Divs Functions ##########
# Auto Collapse Divs Functions ##########
$ja_left = $this->CountModules('left') || $this->CountModules('user4');
$ja_right = $this->CountModules('right');

if ( $ja_left && $ja_right ) {
	$divid = '';
	} elseif ( $ja_left ) {
	$divid = '-fr';
	} elseif ( $ja_right ) {
	$divid = '-fl';
	} else {
	$divid = '-f';
}

//Main navigation
$japarams = new JParameter('');
$japarams->set( 'menu_images_align', 'left' );
$japarams->set( 'menutype', 'mainmenu' );
$japarams->set( 'menupath', $tmpTools->templateurl() .'/ja_menus');
$menu = '';
switch ($tmpTools->getParam(JA_TOOL_MENU)) {
	case 2:
		$menu = "CSSmenu";
		include_once( dirname(__FILE__).DS.'ja_menus/'.$menu.'.class.php' );
		break;
	
	case 3:
		$menu = "Transmenu";
		include_once( dirname(__FILE__).DS.'ja_menus/'.$menu.'.class.php' );
		break;
	case 1:
	default:
		$menu = "Splitmenu";
		include_once( dirname(__FILE__).DS.'ja_menus/'.$menu.'.class.php' );
		break;
}
$menuclass = "JA_$menu";
$jamenu = new $menuclass ($japarams);

$hasSubnav = false;
if ($jamenu->hasSubMenu (1) && $jamenu->showSeparatedSub ) 
	$hasSubnav = true;
//End for main navigation

//#Header images: you can add more subheader images. Please refer to User Guide for full information
$ja_header_images = array('sh01','sh02','sh03','sh04','sh05','sh06'); // Each sub header image will be assigned to each menu
//####################################

//# Header background image
$ja_header_type = 1; // 0: no header image; 1: header image for each menu item; 2: random header


$ja_headerimg = "";
if ($ja_header_type == 1) {
	$ja_headerimg = $ja_header_images [$tmpTools->getCurrentMenuIndex() % count($ja_header_images)];
	if (!is_file(dirname(__FILE__)."/images/headers/$ja_headerimg-bg1.jpg")) $ja_headerimg = $ja_header_images [0];
}
if ($ja_header_type == 2) {
	$ja_headerimg = $ja_header_images[rand (0, count($ja_header_images)-1)];
	if (!is_file(dirname(__FILE__)."/images/headers/$ja_headerimg-bg1.jpg")) $ja_headerimg = $ja_header_images [0];
}
//echo 'aaa'.$ja_headerimg;
$ja_tool_left = 0;
switch ($tmpTools->getParam(JA_TOOL_USER)) {
	case 0: $ja_tool_left = 0; break;
	case 1: $ja_tool_left = -30; break;
	case 2: $ja_tool_left = -30; break;
	case 3: $ja_tool_left = -80; break;
	case 4: $ja_tool_left = -30; break;
	case 5: $ja_tool_left = -80; break;
	case 6: $ja_tool_left = -100; break;
	case 7: $ja_tool_left = -130; break;
	}

?>
