<?php 
//  Copyright:  (C) 03.2008 Templatka.pl. All Rights Reserved.
//  License:	GNU/GPL 
//  Website: 	http://www.templatka.pl

$document = &JFactory::getDocument();
$renderer = $document->loadRenderer( 'module' );
$options = array( 'style' => "raw" );
$module = JModuleHelper::getModule( 'mod_mainmenu' );
$main_menu = false;
$main_submenu = false;

if($menustyle == "1" || $menustyle == "2") :
// $module->params = "menutype=$menu_name\nstartLevel=0\nendLevel=4";               
 $module->params = "menutype=$menu_name\nshowAllChildren=1";
 $main_menu = $renderer->render( $module, $options );

elseif ($menustyle == "3") :
 $module->params	= "menutype=$menu_name\nstartLevel=0\nendLevel=1";
// $module->params = "menutype=$menu_name\nshowAllChildren=1";
 $main_menu = $renderer->render( $module, $options );
 $module = JModuleHelper::getModule( 'mod_mainmenu' );
 $module->params = "menutype=$menu_name\nstartLevel=1\nendLevel=2";
 $options	 = array( 'style' => "submenu");
 $main_submenu = $renderer->render( $module, $options );
endif;
?>