$image_number = count($group['images']);
$thumb_height = $group['thumb_image_height'];
$slide_width = $group['image_width'];
$thumb_width = $group['thumb_image_width'];
$slide_columns = (int)($slide_width / ($thumb_width + 10));
$slide_row = ceil($image_number / $slide_columns);

$nav_spacing = 0; 
if ( $group['slider-controlNav'] == 'true' ) { 
        if ( $group['slider-controlNavThumbs'] == 'true' ) {
                $nav_spacing = ($slide_row * ($thumb_height + 8));
        } else {
                $nav_spacing = 10; 
        }
}

$css .= '#pb_slideshow_slider-' . $this->instance_count . '.nivoSlider {'; 
$css .= '	height: ' . $group['image_height'] . 'px;';
$css .= '       margin-bottom: ' . ($nav_spacing + 10) . 'px;'; 
$css .=	'}';

if ( $group['slider-align'] == 'left' ) {
	$css .= '.nivoSlider { margin-right: auto; }';
} elseif ( $group['slider-align'] == 'center' ) {
	$css .= '.nivoSlider { margin-right: auto; margin-left: auto; }';
} elseif ( $group['slider-align'] == 'right' ) {
	$css .= '.nivoSlider { margin-left: auto; }';
}

$css .= '.nivo-directionNav a {';
$css .= '	background:url(\'' . $this->_pluginURL . '/layouts/slider/default/arrows.png\') no-repeat;';
$css .= '}';
$css .= 'a.nivo-nextNav {
			background-position:-30px 0;
			right:10px;
		}';

$css .= '.nivo-directionNav a {';
$css .= '	top: ' . ( intval( $group['image_height'] / 2 ) - 75 ) . 'px;';
$css .= '}';

if ( $group['slider-shadows'] == 'true' ) {
	$css .= '.nivoSlider {';
	$css .= '	-moz-box-shadow:0px 0px 10px #333;';
	$css .= '	-webkit-box-shadow:0px 0px 10px #333;';
	$css .= '	box-shadow:0px 0px 10px #333;';
	$css .= '}';
}

if ( $group['slider-controlNavThumbs'] == 'true' ) {
	
	$css .= '#pb_slideshow_slider-' . $this->instance_count . ' .nivo-controlNav {';
	$css .= '	width: ' . $group['image_width'] . 'px;';
	$css .= ' 	margin-left: 6px;'; 
	$css .= '	position:absolute;';
	$css .= '	bottom:-' . ( $nav_spacing+10 ) . 'px; /* Put the nav below the slider */';	
	$css .= '	text-align: center;';
	$css .= '}';
	
	$css .= '#pb_slideshow_slider-' . $this->instance_count . ' .nivo-controlNav img {';
	$css .= '	border: 0px;';
	$css .= '	background: none;';
	$css .= '	padding: 0px;';
	$css .= '	cursor: pointer;';
	$css .= '	display:inline; /* Unhide the thumbnails */';
	$css .= '	position:relative;';
	$css .= '	margin-right:10px;';
	if ( $group['slider-shadows'] == 'true' ) {
		$css .= '	-moz-box-shadow:0px 0px 3px #333;';
		$css .= '	-webkit-box-shadow:0px 0px 3px #333;';
		$css .= '	box-shadow:0px 0px 3px #333;';
	}
	$css .= '}';
} else {
	
	$css .= '#pb_slideshow_slider-' . $this->instance_count . ' .nivo-controlNav a {';
	$css .= '	background:url(\'' . $this->_pluginURL . '/layouts/slider/default/bullets.png\') no-repeat;';
	$css .= '}';
	
	$css .= '#pb_slideshow_slider-' . $this->instance_count . ' .nivo-controlNav {';
	$css .= '	position:absolute;';
	$css .= '	left:47%;';
	$css .= '	bottom:-30px;';
	$css .= '}';
	
	$css .= '/* Control nav styles (e.g. 1,2,3...) */';
	$css .= '#pb_slideshow_slider-' . $this->instance_count . ' .nivo-controlNav a {';
	$css .= '	position:relative;';
	$css .= '	z-index:99;';
	$css .= '	cursor:pointer;';
	$css .= '	display:block;';
	$css .= '	width:10px;';
	$css .= '	height:10px;';
	$css .= '	text-indent:-9999px;';
	$css .= '	border:0;';
	$css .= '	margin-right:3px;';
	$css .= '	float:left;';
	$css .= '}';
	
	$css .= '#pb_slideshow_slider-' . $this->instance_count . ' .nivo-controlNav a.active {';
	$css .= '	font-weight:bold;';
	$css .= '	background-position:-10px 0;';
	$css .= '}';
	
}

