<?php
# HD-DropDownDiv          	          	          	              
# Copyright (C) 2012 by Hyde-Design  	   	   	   	   
# Homepage   : www.hyde-design.co.uk		   	   	   
# Author     : Hyde-Design    		   	   	   	   
# Email      : rich@hyde-design.co.uk 	   	   	   
# Version    : 1.0                        	   	    	
# License    : http://www.gnu.org/copyleft/gpl.html GNU/GPL    

// no direct access
defined('_JEXEC') or die('Restricted access');

//get the article pulling function
require_once (dirname(__FILE__).DS.'helper.php');

//get the param

$ddd_1heading   = $params->get("ddd1-heading", "");
$ddd_1link    	= $params->get("ddd1-link", "");
$ddd_1activate  = $params->get("ddd1-activate", "");
$ddd_1width     = $params->get("ddd1-width", "");
$ddd_1bgcolor   = $params->get("ddd1-bgcolor", "");

$ddd_2heading   = $params->get("ddd2-heading", "");
$ddd_2link    	= $params->get("ddd2-link", "");
$ddd_2activate  = $params->get("ddd2-activate", "");
$ddd_2width     = $params->get("ddd2-width", "");
$ddd_2bgcolor   = $params->get("ddd2-bgcolor", "");

$ddd_3heading   = $params->get("ddd3-heading", "");
$ddd_3link    	= $params->get("ddd3-link", "");
$ddd_3activate  = $params->get("ddd3-activate", "");
$ddd_3width     = $params->get("ddd3-width", "auto");
$ddd_3bgcolor   = $params->get("ddd3-bgcolor", "");

$ddd_4heading   = $params->get("ddd4-heading", "");
$ddd_4link    	= $params->get("ddd4-link", "");
$ddd_4activate  = $params->get("ddd4-activate", "");
$ddd_4width     = $params->get("ddd4-width", "auto");
$ddd_4bgcolor   = $params->get("ddd4-bgcolor", "");

$ddd_5heading   = $params->get("ddd5-heading", "");
$ddd_5link    	= $params->get("ddd5-link", "");
$ddd_5activate  = $params->get("ddd5-activate", "");
$ddd_5width     = $params->get("ddd5-width", "auto");
$ddd_5bgcolor   = $params->get("ddd5-bgcolor", "");

$ddd_6heading   = $params->get("ddd6-heading", "");
$ddd_6link    	= $params->get("ddd6-link", "");
$ddd_6activate  = $params->get("ddd6-activate", "");
$ddd_6width     = $params->get("ddd6-width", "auto");
$ddd_6bgcolor   = $params->get("ddd6-bgcolor", "");

$ddd_7heading   = $params->get("ddd7-heading", "");
$ddd_7link    	= $params->get("ddd7-link", "");
$ddd_7activate  = $params->get("ddd7-activate", "");
$ddd_7width     = $params->get("ddd7-width", "auto");
$ddd_7bgcolor   = $params->get("ddd7-bgcolor", "");

$ddd_8heading   = $params->get("ddd8-heading", "");
$ddd_8link    	= $params->get("ddd8-link", "");
$ddd_8activate  = $params->get("ddd8-activate", "");
$ddd_8width     = $params->get("ddd8-width", "auto");
$ddd_8bgcolor   = $params->get("ddd8-bgcolor", "");

$ddd_9heading   = $params->get("ddd9-heading", "");
$ddd_9link    	= $params->get("ddd9-link", "");
$ddd_9activate  = $params->get("ddd9-activate", "");
$ddd_9width     = $params->get("ddd9-width", "auto");
$ddd_9bgcolor   = $params->get("ddd9-bgcolor", "");

$ddd_10heading   = $params->get("ddd10-heading", "");
$ddd_10link    	= $params->get("ddd10-link", "");
$ddd_10activate  = $params->get("ddd10-activate", "");
$ddd_10width     = $params->get("ddd10-width", "auto");
$ddd_10bgcolor   = $params->get("ddd10-bgcolor", "");

$ddd_height     = $params->get("ddd-height", "30px");
$ddd_padding    = $params->get("ddd-padding", "10px");
$ddd_css_link   = $params->get("ddd-css-link", "");
$ddd_css_hover   = $params->get("ddd-css-hover", "");
$ddd_css_active   = $params->get("ddd-css-active", "");
$ddd_css   = $params->get("ddd-css", "");

global $mainframe;

//render the primary CSS and load the javascript
echo '<style type="text/css">';
echo ".chromestyle {width: 99%; font-weight: normal;}
.chromestyle:after {content: '.'; display: block; height: 0; clear: both; visibility: hidden; }
.dropmenudiv-one {position: absolute !important; z-index:999; background-color: ".$ddd_1bgcolor."; width: ".$ddd_1width."; visibility: hidden;}
.dropmenudiv-two {position: absolute !important; z-index:999; background-color: ".$ddd_2bgcolor."; width: ".$ddd_2width."; visibility: hidden;}
.dropmenudiv-three {position: absolute !important; z-index:999; background-color: ".$ddd_3bgcolor."; width: ".$ddd_3width."; visibility: hidden;}
.dropmenudiv-four {position: absolute !important; z-index:999; background-color: ".$ddd_4bgcolor."; width: ".$ddd_4width."; visibility: hidden;}
.dropmenudiv-five {position: absolute !important; z-index:999; background-color: ".$ddd_5bgcolor."; width: ".$ddd_5width."; visibility: hidden;}
.dropmenudiv-six {position: absolute !important; z-index:999; background-color: ".$ddd_6bgcolor."; width: ".$ddd_6width."; visibility: hidden;}
.dropmenudiv-seven {position: absolute !important; z-index:999; background-color: ".$ddd_7bgcolor."; width: ".$ddd_7width."; visibility: hidden;}
.dropmenudiv-eight {position: absolute !important; z-index:999; background-color: ".$ddd_8bgcolor."; width: ".$ddd_8width."; visibility: hidden;}
.dropmenudiv-nine {position: absolute !important; z-index:999; background-color: ".$ddd_9bgcolor."; width: ".$ddd_9width."; visibility: hidden;}
.dropmenudiv-ten {position: absolute !important; z-index:999; background-color: ".$ddd_10bgcolor."; width: ".$ddd_10width."; visibility: hidden;}
* html .dropmenudiv-one a{ width: 100%; }
a.ddd1, a.ddd2, a.ddd3, a.ddd4, a.ddd5, a.ddd6, a.ddd7, a.ddd8, a.ddd9, a.ddd10{".$ddd_css_link.";}
a:hover.ddd1, a:hover.ddd2, a:hover.ddd3, a:hover.ddd4, a:hover.ddd5, a:hover.ddd6, a:hover.ddd7, a:hover.ddd8, a:hover.ddd9, a:hover.ddd10, .ddd1.selected, .ddd2.selected, .ddd3.selected, .ddd4.selected, .ddd5.selected, .ddd6.selected, .ddd7.selected, .ddd8.selected, .ddd9.selected, .ddd10.selected {".$ddd_css_hover.";}
".$ddd_css."
</style>";

//add the custom CSS and load the javascript
echo '<script type="text/javascript" src="modules/mod_dropdowndiv/mod_dropdowndiv.js"></script>';

//render the toplevel html
echo '<div class="chromestyle" id="chromemenu" style="height: '.$ddd_height.';">';
if (!empty($ddd_1heading)) {if ($ddd_1activate=="1") {echo '<div id="ddd" class="ddd-one" style="float:left;"><a class="ddd1" href="'.$ddd_1link.'" rel="ddd1">'.$ddd_1heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-one" style="float:left;"><a class="ddd1" href="'.$ddd_1link.'" >'.$ddd_1heading.'</a></div>';}};
if (!empty($ddd_2heading)) {if ($ddd_2activate=="1") {echo '<div id="ddd" class="ddd-two" style="float:left;"><a class="ddd2" href="'.$ddd_2link.'" rel="ddd2">'.$ddd_2heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-two" style="float:left;"><a class="ddd2" href="'.$ddd_2link.'" >'.$ddd_2heading.'</a></div>';}};
if (!empty($ddd_3heading)) {if ($ddd_3activate=="1") {echo '<div id="ddd" class="ddd-three" style="float:left;"><a class="ddd3" href="'.$ddd_3link.'" rel="ddd3">'.$ddd_3heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-three" style="float:left;"><a class="ddd3" href="'.$ddd_3link.'" >'.$ddd_3heading.'</a></div>';}};
if (!empty($ddd_4heading)) {if ($ddd_4activate=="1") {echo '<div id="ddd" class="ddd-four" style="float:left;"><a class="ddd4" href="'.$ddd_4link.'" rel="ddd4">'.$ddd_4heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-four" style="float:left;"><a class="ddd4" href="'.$ddd_4link.'" >'.$ddd_4heading.'</a></div>';}};
if (!empty($ddd_5heading)) {if ($ddd_5activate=="1") {echo '<div id="ddd" class="ddd-five" style="float:left;"><a class="ddd5" href="'.$ddd_5link.'" rel="ddd5">'.$ddd_5heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-five" style="float:left;"><a class="ddd5" href="'.$ddd_5link.'" >'.$ddd_5heading.'</a></div>';}};
if (!empty($ddd_6heading)) {if ($ddd_6activate=="1") {echo '<div id="ddd" class="ddd-six" style="float:left;"><a class="ddd6" href="'.$ddd_6link.'" rel="ddd6">'.$ddd_6heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-six" style="float:left;"><a class="ddd6" href="'.$ddd_6link.'" >'.$ddd_6heading.'</a></div>';}};
if (!empty($ddd_7heading)) {if ($ddd_7activate=="1") {echo '<div id="ddd" class="ddd-seven" style="float:left;"><a class="ddd7" href="'.$ddd_7link.'" rel="ddd7">'.$ddd_7heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-seven" style="float:left;"><a class="ddd7" href="'.$ddd_7link.'" >'.$ddd_7heading.'</a></div>';}};
if (!empty($ddd_8heading)) {if ($ddd_8activate=="1") {echo '<div id="ddd" class="ddd-eight" style="float:left;"><a class="ddd8" href="'.$ddd_8link.'" rel="ddd8">'.$ddd_8heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-eight" style="float:left;"><a class="ddd8" href="'.$ddd_8link.'" >'.$ddd_8heading.'</a></div>';}};
if (!empty($ddd_9heading)) {if ($ddd_9activate=="1") {echo '<div id="ddd" class="ddd-nine" style="float:left;"><a class="ddd9" href="'.$ddd_9link.'" rel="ddd9">'.$ddd_9heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-nine" style="float:left;"><a class="ddd9" href="'.$ddd_9link.'" >'.$ddd_9heading.'</a></div>';}};
if (!empty($ddd_10heading)) {if ($ddd_10activate=="1") {echo '<div id="ddd" class="ddd-ten" style="float:left;"><a class="ddd10" href="'.$ddd_10link.'" rel="ddd10">'.$ddd_10heading.'</a></div>';}
	 else {echo '<div id="ddd" class="ddd-ten" style="float:left;"><a class="ddd10" href="'.$ddd_10link.'" >'.$ddd_10heading.'</a></div>';}};
echo '</div> ';

//render the dropdown articles         
if ($ddd_1activate=="1") {echo '<div id="ddd1" class="dropmenudiv-one">'; $item = moddropdowndivHelper::getArticleOne($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_2activate=="1") {echo '<div id="ddd2" class="dropmenudiv-two">'; $item = moddropdowndivHelper::getArticleTwo($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_3activate=="1") {echo '<div id="ddd3" class="dropmenudiv-three">'; $item = moddropdowndivHelper::getArticleThree($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_4activate=="1") {echo '<div id="ddd4" class="dropmenudiv-four">'; $item = moddropdowndivHelper::getArticleFour($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_5activate=="1") {echo '<div id="ddd5" class="dropmenudiv-five">'; $item = moddropdowndivHelper::getArticleFive($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_6activate=="1") {echo '<div id="ddd6" class="dropmenudiv-six">'; $item = moddropdowndivHelper::getArticleSix($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_7activate=="1") {echo '<div id="ddd7" class="dropmenudiv-seven">'; $item = moddropdowndivHelper::getArticleSeven($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_8activate=="1") {echo '<div id="ddd8" class="dropmenudiv-eight">'; $item = moddropdowndivHelper::getArticleEight($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_9activate=="1") {echo '<div id="ddd9" class="dropmenudiv-nine">'; $item = moddropdowndivHelper::getArticleNine($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};
if ($ddd_10activate=="1") {echo '<div id="ddd10" class="dropmenudiv-ten">'; $item = moddropdowndivHelper::getArticleTen($params); require(JModuleHelper::getLayoutPath('mod_dropdowndiv')); echo '</div>';};

echo '<script type="text/javascript">cssdropdown.startchrome("chromemenu")</script>';