<?php
/**
@version 1.0
Author: Shape 5 - Professional Template Community
Available for download at www.shape5.com
*/

defined('_JEXEC') or die('Direct Access to this location is not allowed.');

$modulewidth = $params->get( 'modulewidth', '' );
$topheight = $params->get( 'topheight', '' );
$bottomheight = $params->get( 'bottomheight', '' );
$boxes = $params->get( 'boxes', '' );

$s5_arrowshide	= $params->get( 's5_arrowshide', '' );
$tm = $params->get( 'tm', '' );
$rm = $params->get( 'rm', '' );
$bm = $params->get( 'bm', '' );
$lm = $params->get( 'lm', '' );
$rotate = $params->get( 'rotate', '' );
$speed = $params->get( 'speed', '' );
$top1_pic = $params->get( 'top1_pic', '' );
$top1_hyperlink = $params->get( 'top1_hyperlink', '' );
$top1_target = $params->get( 'top1_target', '' );
$box1width = $params->get( 'box1width', '' );
$box1_pic = $params->get( 'box1_pic', '' );
$box1_pic_hover = $params->get( 'box1_pic_hover', '' );
$box1_hyperlink = $params->get( 'box1_hyperlink', '' );
$box1_target = $params->get( 'box1_target', '' );
$box1_content = $params->get( 'box1_content', '' );
$top2_pic = $params->get( 'top2_pic', '' );
$top2_hyperlink = $params->get( 'top2_hyperlink', '' );
$top2_target = $params->get( 'top2_target', '' );
$box2width = $params->get( 'box2width', '' );
$box2_pic = $params->get( 'box2_pic', '' );
$box2_pic_hover = $params->get( 'box2_pic_hover', '' );
$box2_hyperlink = $params->get( 'box2_hyperlink', '' );
$box2_target = $params->get( 'box2_target', '' );
$box2_content = $params->get( 'box2_content', '' );
$top3_pic = $params->get( 'top3_pic', '' );
$top3_hyperlink = $params->get( 'top3_hyperlink', '' );
$top3_target = $params->get( 'top3_target', '' );
$box3width = $params->get( 'box3width', '' );
$box3_pic = $params->get( 'box3_pic', '' );
$box3_pic_hover = $params->get( 'box3_pic_hover', '' );
$box3_hyperlink = $params->get( 'box3_hyperlink', '' );
$box3_target = $params->get( 'box3_target', '' );
$box3_content = $params->get( 'box3_content', '' );
$top4_pic = $params->get( 'top4_pic', '' );
$top4_hyperlink = $params->get( 'top4_hyperlink', '' );
$top4_target = $params->get( 'top4_target', '' );
$box4width = $params->get( 'box4width', '' );
$box4_pic = $params->get( 'box4_pic', '' );
$box4_pic_hover = $params->get( 'box4_pic_hover', '' );
$box4_hyperlink = $params->get( 'box4_hyperlink', '' );
$box4_target = $params->get( 'box4_target', '' );
$box4_content = $params->get( 'box4_content', '' );
$top5_pic = $params->get( 'top5_pic', '' );
$top5_hyperlink = $params->get( 'top5_hyperlink', '' );
$top5_target = $params->get( 'top5_target', '' );
$box5width = $params->get( 'box5width', '' );
$box5_pic = $params->get( 'box5_pic', '' );
$box5_pic_hover = $params->get( 'box5_pic_hover', '' );
$box5_hyperlink = $params->get( 'box5_hyperlink', '' );
$box5_target = $params->get( 'box5_target', '' );
$box5_content = $params->get( 'box5_content', '' );
$top6_pic = $params->get( 'top6_pic', '' );
$top6_hyperlink = $params->get( 'top6_hyperlink', '' );
$top6_target = $params->get( 'top6_target', '' );
$box6width = $params->get( 'box6width', '' );
$box6_pic = $params->get( 'box6_pic', '' );
$box6_pic_hover = $params->get( 'box6_pic_hover', '' );
$box6_hyperlink = $params->get( 'box6_hyperlink', '' );
$box6_target = $params->get( 'box6_target', '' );
$box6_content = $params->get( 'box6_content', '' );
$top7_pic = $params->get( 'top7_pic', '' );
$top7_hyperlink = $params->get( 'top7_hyperlink', '' );
$top7_target = $params->get( 'top7_target', '' );
$box7width = $params->get( 'box7width', '' );
$box7_pic = $params->get( 'box7_pic', '' );
$box7_pic_hover = $params->get( 'box7_pic_hover', '' );
$box7_hyperlink = $params->get( 'box7_hyperlink', '' );
$box7_target = $params->get( 'box7_target', '' );
$box7_content = $params->get( 'box7_content', '' );
$top8_pic = $params->get( 'top8_pic', '' );
$top8_hyperlink = $params->get( 'top8_hyperlink', '' );
$top8_target = $params->get( 'top8_target', '' );
$box8width = $params->get( 'box8width', '' );
$box8_pic = $params->get( 'box8_pic', '' );
$box8_pic_hover = $params->get( 'box8_pic_hover', '' );
$box8_hyperlink = $params->get( 'box8_hyperlink', '' );
$box8_target = $params->get( 'box8_target', '' );
$box8_content = $params->get( 'box8_content', '' );
$s5_imageslidestyle = $params->get( 's5_imageslidestyle', '' );
$transstyle = $params->get( 'xml_transstyle', '' );
$tween_time		= $params->get( 'tween_time', '' );
$display_time   	= $params->get( 'display_time', '' );
$tween_time = $tween_time*1000;
$display_time = $display_time*1000;


$picture1target = $params->get( 'top1_target', '' );
$picture2target = $params->get( 'top2_target', '' );
$picture3target = $params->get( 'top3_target', '' );
$picture4target = $params->get( 'top4_target', '' );
$picture5target = $params->get( 'top5_target', '' );
$picture6target = $params->get( 'top6_target', '' );
$picture7target = $params->get( 'top7_target', '' );
$picture8target = $params->get( 'top8_target', '' );
$picture9target = $params->get( 'top9_target', '' );
$picture10target = $params->get( 'top10_target', '' );



	
if ($transstyle == "yes"){ 

$document = &JFactory::getDocument();  


JHTML::_('behavior.mootools');
$document->addCustomTag('<script language="javascript" type="text/javascript" src="modules/mod_s5_frontpage_display2/s5_frontpage_display_2/class.noobSlide.packed.js"></script>');

}

if ($boxes < 8) {
	$boxwidth = 7;
}
if ($boxes < 7) {
	$boxwidth = 16;
}
if ($boxes < 6) {
	$boxwidth = 19;
}
if ($boxes < 5) {
	$boxwidth = 24.95;
}
if ($boxes < 4) {
	$boxwidth = 33.3;
}
if ($boxes < 3) {
	$boxwidth = 49.9;
}

$s5_fd_num_boxes = 0;

$LiveSite 	= JURI::base();

if ($s5_fd_num_boxes == 2) {
$s5_fd_num_boxes_size = "49.9%";

if ($is_opera == "yes") { 
$s5_fd_num_boxes_size = "50%";
}

}

if ($s5_fd_num_boxes == 3) {
$s5_fd_num_boxes_size = "33.3%";
}

if ($s5_fd_num_boxes == 4) {
$s5_fd_num_boxes_size = "24.95%";

if ($is_opera == "yes") { 
$s5_fd_num_boxes_size = "25%";
}

}

if ($s5_fd_num_boxes == 5) {
$s5_fd_num_boxes_size = "19.9%";

if ($is_opera == "yes") { 
$s5_fd_num_boxes_size = "20%";
}

}

if ($s5_fd_num_boxes == 6) {
$s5_fd_num_boxes_size = "16.6%";
}



$brr = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.
if(strrpos($brr,"msie 6") > 1) {
$is_ie6 = "yes";
} 
else {
$is_ie6 = "no";
}

$brr = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.
if(strrpos($brr,"msie 7") > 1) {
$is_ie7 = "yes";
} 
else {
$is_ie7  = "no";
}

if(strrpos($brr,"msie 8") > 1) {
$is_ie8 = "yes";
} 
else {
$is_ie8  = "no";
}



$totalwidth = 0;

if ($top1_pic != "") { 
		$totalwidth = 1;}
if ($top2_pic != "") { 
		$totalwidth = $totalwidth + 1;}

if ($boxes >= "3") {
if ($top3_pic != "") { 
$totalwidth = $totalwidth + 1;}}

if ($boxes >= "4") {
if ($top4_pic != "") { 
$totalwidth = $totalwidth + 1;}}

if ($boxes >= "5") {
if ($top5_pic != "") { 
$totalwidth = $totalwidth + 1;}}

if ($boxes >= "6") {
if ($top6_pic!= "") { 
$totalwidth = $totalwidth + 1;}}

if ($boxes >= "7") {
if ($top7_pic != "") { 
$totalwidth = $totalwidth + 1;}}

if ($boxes >= "8") {
if ($top8_pic != "") { 
$totalwidth = $totalwidth + 1;}}


$s5_fd2fvisible = 0;

if ($top1_pic != "" && $top2_pic == "")  {
$s5_fd2fvisible = 1;}	

if ($top1_pic != "" && $top2_pic != "")  {
$s5_fd2fvisible = 2;}	

if ($boxes >= "3") {
if ($top1_pic != "" && $top2_pic != "" && $top3_pic != "" )  {
$s5_fd2fvisible = 3;}	
}
if ($boxes >= "4") {
if ($top1_pic != "" && $top2_pic != "" && $top3_pic != "" && $top4_pic != "" )  {
$s5_fd2fvisible = 4;}
}
if ($boxes >= "5") {
if ($top1_pic != "" && $top2_pic != "" && $top3_pic != "" && $top4_pic != "" && $top5_pic != "" )  {
$s5_fd2fvisible = 5;}
}
if ($boxes >= "6") {
if ($top1_pic != "" && $top2_pic != "" && $top3_pic != "" && $top4_pic != "" && $top5_pic != "" && $top6_pic != "" )  {
$s5_fd2fvisible = 6;}
}
if ($boxes >= "7") {
if ($top1_pic != "" && $top2_pic != "" && $top3_pic != "" && $top4_pic != "" && $top5_pic != "" && $top6_pic != "" && $top7_pic != "" )  {
$s5_fd2fvisible = 7;}
}
if ($boxes >= "8") {
if ($top1_pic != "" && $top2_pic != "" && $top3_pic != "" && $top4_pic != "" && $top5_pic != "" && $top6_pic != "" && $top7_pic != "" && $top8_pic != "")  {
$s5_fd2fvisible = 8;}
}

echo "<script language=\"javascript\" type=\"text/javascript\" >var s5_fd2fvisible = ".$s5_fd2fvisible.";</script>"; 
?>


	
<script type="text/javascript">//<![CDATA[
var imageURLs = new Array(
"<?php echo $top1_pic ?>",
"<?php echo $top2_pic ?>",
<?php if ($boxes >= "3") {?>
"<?php echo $top3_pic?>"<?php if ($boxes >= "4") {?>,<?php } ?>	
<?php } ?>	
<?php if ($boxes >= "4") {?>
"<?php echo $top4_pic?>"<?php if ($boxes >= "5") {?>,<?php } ?>	
<?php } ?>	
<?php if ($boxes >= "5") {?>
"<?php echo $top5_pic?>"<?php if ($boxes >= "6") {?>,<?php } ?>
<?php } ?>	
<?php if ($boxes >= "6") {?>
"<?php echo $top6_pic?>"<?php if ($boxes >= "7") {?>,<?php } ?>	
<?php } ?>	
<?php if ($boxes >= "7") {?>
"<?php echo $top7_pic?>"<?php if ($boxes >= "8") {?>,<?php } ?>
<?php } ?>	
<?php if ($boxes >= "8") {?>
"<?php echo $top8_pic?>"
<?php } ?>	
)

document.write('<link href="<?php echo $LiveSite ?>/modules/mod_s5_frontpage_display2/s5_frontpage_display_2/styles.css" rel="stylesheet" type="text/css" media="screen" />');
document.write('<link href="<?php echo $LiveSite ?>/modules/mod_s5_frontpage_display2/s5_frontpage_display_2/stylemt.css" rel="stylesheet" type="text/css" media="screen" />');
//]]></script>



<?php if ($is_ie6 == "yes") { ?>
<style>
#s5_fd2_loading {
	background:none;
	filter:
	progid:dximagetransform.microsoft.alphaimageloader(src='<?php echo $LiveSite ?>/modules/mod_s5_frontpage_display2/s5_frontpage_display_2/s5_loading.png', sizingmethod='crop');}
</style>
<?php } ?>	
<div style="display:none">

<img src="<?php echo $box1_pic ?>" alt=""></img>
<img src="<?php echo $top1_pic ?>" alt=""></img>
<img src="<?php echo $box1_pic_hover ?>" alt=""></img>
<img src="<?php echo $box2_pic ?>" alt=""></img>
<img src="<?php echo $top2_pic ?>" alt=""></img>
<img src="<?php echo $box2_pic_hover ?>" alt=""></img>
<?php if ($boxes >= "3") {?>
<img src="<?php echo $box3_pic ?>" alt=""></img>
<img src="<?php echo $top3_pic ?>" alt=""></img>
<img src="<?php echo $box3_pic_hover ?>" alt=""></img>
<?php } ?>
<?php if ($boxes >= "4") {?>
<img src="<?php echo $box4_pic ?>" alt=""></img>
<img src="<?php echo $top4_pic ?>" alt=""></img>
<img src="<?php echo $box4_pic_hover ?>" alt=""></img>
<?php } ?>
<?php if ($boxes >= "5") {?>
<img src="<?php echo $box5_pic ?>" alt=""></img>
<img src="<?php echo $top5_pic ?>" alt=""></img>
<img src="<?php echo $box5_pic_hover ?>" alt=""></img>
<?php } ?>
<?php if ($boxes >= "6") {?>
<img src="<?php echo $box6_pic ?>" alt=""></img>
<img src="<?php echo $top6_pic ?>" alt=""></img>
<img src="<?php echo $box6_pic_hover ?>" alt=""></img>
<?php } ?>
<?php if ($boxes >= "7") {?>
<img src="<?php echo $box7_pic ?>" alt=""></img>
<img src="<?php echo $top7_pic ?>" alt=""></img>
<img src="<?php echo $box7_pic_hover ?>" alt=""></img>
<?php } ?>
<?php if ($boxes >= "8") {?>
<img src="<?php echo $box8_pic ?>" alt=""></img>
<img src="<?php echo $top8_pic ?>" alt=""></img>
<img src="<?php echo $box8_pic_hover ?>" alt=""></img>
<?php } ?>

</div>


<?php if ($transstyle == "yes") {?>
<script type="text/javascript">
	window.addEvent('domready',function(){
		var s5_startItem = 0;
		var s5_if_thumbs_maskout = $('s5_if_thumbs_maskout').setStyle('left',(s5_startItem*68-568)+'px').set('opacity',0.8);
		var fxOptions7 = {property:'left', duration:tween_time, transition:Fx.Transitions.<?php echo $s5_imageslidestyle;?>, wait:false}		
		var thumbsFx = new Fx.Tween(s5_if_thumbs_maskout,fxOptions7);
		var hs7 = new noobSlide({
			size: <?php echo $modulewidth ?>,
			box: $('s5_if_innerbox'),
			items: [<?php if ($box1_pic != "") { ?>0<?php } ?><?php if ($box2_pic != "") { ?>,1<?php } ?><?php if ($boxes >= "3") {?><?php if ($box3_pic != "") { ?>,2<?php } ?><?php } ?><?php if ($boxes >= "4") {?><?php if ($box4_pic != "") { ?>,3<?php } ?><?php } ?><?php if ($boxes >= "5") {?><?php if ($box5_pic != "") { ?>,4<?php } ?><?php } ?><?php if ($boxes >= "6") {?><?php if ($box6_pic != "") { ?>,5<?php } ?><?php } ?><?php if ($boxes >= "7") {?><?php if ($box7_pic != "") { ?>,6<?php } ?><?php } ?><?php if ($boxes >= "8") {?><?php if ($box8_pic != "") { ?>,7<?php } ?><?php } ?>],
			autoPlay:  <?php if ($rotate == "yes") { ?>true<?php } else {?>false<?php } ?>,
			handles: $$('#s5_if_thumbs_handlesout span'),
			fxOptions: fxOptions7,
			addButtons: {previous: $('s5_prev'), play: $('s5_play'), stop: $('s5_stop'), next: $('s5_next')},
			button_event: 'click',	
			interval: <?php echo $display_time ?>,			
			onWalk: function(currentItem){
			thumbsFx.start(currentItem*10-10);},s5_startItem: s5_startItem});	hs7.walk(0);	});
</script>

<?php 
echo "<script language=\"javascript\" type=\"text/javascript\" >var display_time = ".$display_time.";</script>";
echo "<script language=\"javascript\" type=\"text/javascript\" >var tween_time = ".$tween_time.";</script>";
?>
<div id="s5_fd2_outerm" style="position:absolute;z-index:1;margin-bottom:<?php echo $bm ?>px; margin-top:<?php echo $tm ?>px; margin-right:<?php echo $rm ?>px; margin-left:<?php echo $lm ?>px; padding:0px; width:<?php echo $modulewidth ?>px; height:<?php echo $topheight + $bottomheight ?>px; overflow:hidden">
	<div id="s5_fd2_loading"><div id="s5_fd2_loadimage"></div></div>
</div>


<div id="s5_fd2_outer" style="margin-bottom:<?php echo $bm ?>px; margin-top:<?php echo $tm ?>px; margin-right:<?php echo $rm ?>px; margin-left:<?php echo $lm ?>px; padding:0px; width:<?php echo $modulewidth ?>px; height:<?php echo $topheight + $bottomheight + 30?>px; overflow:hidden">

<div id="s5_ismod_onhover" style="width: <?php echo ((0) / 2) + 50;?>px; position: absolute; z-index: 1; display: none;">
			<div style="margin-left: <?php echo ((0) / 2) - 55;?>px; position: absolute; margin-top:<?php echo ((0) / 2) - 80;?>px;">
			<div id="s5_stop">
				<div onclick="s5_ismod_switchbuttons();" style="margin-top: 4px; cursor: pointer; float: left; margin-left: 4px; margin-right: 4px;" id="s5_ismod_stop"></div>
			</div>	
			<div id="s5_play">
				<div onclick="s5_ismod_switchbuttons();" style="display: none; margin-top: 4px; cursor: pointer; float: left; margin-left: 4px; margin-right: 8px;" id="s5_ismod_play"></div>
			</div>
			</div>
		</div>



<div id="s5_fd2_inner" style="display:none;">
<div class="s5_mask" style="width:<?php echo $modulewidth ?>px;overflow:hidden;">
<div id="s5_prev">
		<div id="s5_is_leftarrow" style="display:<?php echo $s5_arrowshide;?>;"></div>
	</div>

	<div id="s5_if_innerbox">
			
			<?php if ($top1_pic != "") { ?>
			<span>
				<?php if ($top1_hyperlink != "") { ?>
					<a href="<?php echo $top1_hyperlink ?>" target="<?php echo $picture1target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top1_pic ?>" alt="Photo" /><?php if ($top1_hyperlink != "") { ?></a><?php } ?></span><?php } ?>	
						
			<?php if ($top2_pic != "") { ?>		
			<span>
				<?php if ($top2_hyperlink != "") { ?>
					<a href="<?php echo $top2_hyperlink ?>" target="<?php echo $picture2target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top2_pic ?>" alt="Photo" /><?php if ($top2_hyperlink != "") { ?></a><?php } ?></span><?php } ?>
			
			<?php if ($boxes >= "3") {?>			
			<?php if ($top3_pic != "") { ?>
			<span>
				<?php if ($top3_hyperlink != "") { ?>
					<a href="<?php echo $top3_hyperlink ?>" target="<?php echo $picture3target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top3_pic ?>" alt="Photo" /><?php if ($top3_hyperlink != "") { ?></a><?php } ?></span><?php } ?><?php } ?>
					
			<?php if ($boxes >= "4") {?>		
			<?php if ($top4_pic != "") { ?>
			<span>
				<?php if ($top4_hyperlink != "") { ?>
					<a href="<?php echo $top4_hyperlink ?>" target="<?php echo $picture4target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top4_pic ?>" alt="Photo" /><?php if ($top4_hyperlink != "") { ?></a><?php } ?></span><?php } ?><?php } ?>
			
			<?php if ($boxes >= "5") {?>
			<?php if ($top5_pic != "") { ?>
			<span>
				<?php if ($top5_hyperlink != "") { ?>
					<a href="<?php echo $top5_hyperlink ?>" target="<?php echo $picture5target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top5_pic ?>" alt="Photo" /><?php if ($top5_hyperlink != "") { ?></a><?php } ?></span><?php } ?><?php } ?>
						
			<?php if ($boxes >= "6") {?>
			<?php if ($top6_pic != "") { ?>
			<span>
				<?php if ($top6_hyperlink != "") { ?>
					<a href="<?php echo $top6_hyperlink ?>" target="<?php echo $picture6target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top6_pic ?>" alt="Photo" /><?php if ($top6_hyperlink != "") { ?></a><?php } ?></span><?php } ?><?php } ?>
						
			<?php if ($boxes >= "7") {?>
			<?php if ($top6_pic != "") { ?>
			<span>
				<?php if ($top7_hyperlink != "") { ?>
					<a href="<?php echo $top7_hyperlink ?>" target="<?php echo $picture7target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top7_pic ?>" alt="Photo" /><?php if ($top7_hyperlink != "") { ?></a><?php } ?></span><?php } ?><?php } ?>
						
			<?php if ($boxes >= "8") {?>
			<?php if ($top8_pic != "") { ?>
			<span>
				<?php if ($top8_hyperlink != "") { ?>
					<a href="<?php echo $top8_hyperlink ?>" target="<?php echo $picture8target ?>" style="cursor:pointer"><?php } ?>
						<img src="<?php echo $top8_pic ?>" alt="Photo" /><?php if ($top8_hyperlink != "") { ?></a><?php } ?></span><?php } ?><?php } ?>

		
		</div>
	<div id="s5_next">	
		<div id="s5_is_rightarrow" style="display:<?php echo $s5_arrowshide;?>;"></div>	
	</div>
	
	</div>
	
	<div id="s5_if_thumbsouter" style="width:<?php echo ($totalwidth) ;?>px;display:none;">
		<div class="s5_if_thumbs">
			<?php if ($top1_pic != "") { ?><div><img src="<?php echo $top1_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php if ($top2_pic != "") { ?><div><img src="<?php echo $top2_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php if ($boxes >= "3") {?>
			<?php if ($top3_pic != "") { ?><div><img src="<?php echo $top3_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "4") {?>
			<?php if ($top4_pic != "") { ?><div><img src="<?php echo $top4_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "5") {?>
			<?php if ($top5_pic != "") { ?><div><img src="<?php echo $top5_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "6") {?>
			<?php if ($top6_pic != "") { ?><div><img src="<?php echo $top6_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "7") {?>
			<?php if ($top7_pic != "") { ?><div><img src="<?php echo $top7_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "8") {?>
			<?php if ($top8_pic != "") { ?><div><img src="<?php echo $top8_pic ?>" alt="Photo Thumb" /></div><?php } ?>
			<?php } ?>
		</div>
		<div id="s5_if_thumbs_maskout"></div>
		<p id="s5_if_thumbs_handlesout">
			<?php if ($top1_pic != "") { ?><a id="s5_fd_click1"></a><?php } ?>
			<?php if ($top2_pic != "") { ?><a id="s5_fd_click2"></a><?php } ?>
			<?php if ($boxes >= "3") {?>
			<?php if ($top3_pic != "") { ?><a id="s5_fd_click3"></a><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "4") {?>
			<?php if ($top4_pic != "") { ?><a id="s5_fd_click4"></a><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "5") {?>
			<?php if ($top5_pic != "") { ?><a id="s5_fd_click5"></a><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "6") {?>
			<?php if ($top6_pic != "") { ?><a id="s5_fd_click6"></a><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "7") {?>
			<?php if ($top7_pic != "") { ?><a id="s5_fd_click7"></a><?php } ?>
			<?php } ?>
			<?php if ($boxes >= "8") {?>
			<?php if ($top8_pic != "") { ?><a id="s5_fd_click8"></a><?php } ?>
			<?php } ?>
		</p>
	</div>
	
</div>		


	<div id="s5_fd2_wrap" style="margin-top:<?php echo $topheight + 15;?>px;">	

	<div id="s5_fd2_1" class="s5_fd_active" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box1_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
			<div class="s5_frontpaged_mr">
				<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
					<?php echo $box1_content ?>
				</div>
			</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>	
	</div>	
	
	
	<div id="s5_fd2_2" class="s5_fd_nonactive" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box2_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
			<div class="s5_frontpaged_mr">
			<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
			<?php echo $box2_content ?>
		</div>
		</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>	
	</div>
	
	<?php if ($boxes >= "3") {?>
	<div id="s5_fd2_3" class="s5_fd_nonactive" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box3_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
		<div class="s5_frontpaged_mr">
			<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
			<?php echo $box3_content ?>
		</div>
		</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>		
	</div>
	<?php }?>
	<?php if ($boxes >= "4") {?>
	<div id="s5_fd2_4" class="s5_fd_nonactive" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box4_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
			<div class="s5_frontpaged_mr">	
				<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
					<?php echo $box4_content ?>
				</div>
			</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>		
	</div>
	<?php }?>
	<?php if ($boxes >= "5") {?>
	<div id="s5_fd2_5" class="s5_fd_nonactive" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box5_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
		<div class="s5_frontpaged_mr">		
		<?php if ($boxes >= "6") {?>
			<div class="s5_fd2_sepd">
			<?php }?>
				<?php echo $box5_content ?>
			<?php if ($boxes >= "6") {?>
			</div>
		<?php }?>
		</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>		
	</div>
	<?php }?>
	<?php if ($boxes >= "6") {?>
	<div id="s5_fd2_6" class="s5_fd_nonactive" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box6_pic ?>); background-repeat: no-repeat">
		<?php if ($boxes >= "7") {?>
		<div class="s5_fd2_sepd">
		<?php }?>
			<?php echo $box6_content ?>
		<?php if ($boxes >= "7") {?>
		</div>
		<?php }?>
	</div>
	<?php }?>
	<?php if ($boxes >= "7") {?>
	<div id="s5_fd2_7" class="s5_fd_nonactive" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box7_pic ?>); background-repeat: no-repeat">
		<?php if ($boxes >= "8") {?>
		<div class="s5_fd2_sepd">
		<?php }?>
			<?php echo $box7_content ?>
		<?php if ($boxes >= "8") {?>
		</div>
		<?php }?>	
	</div>
	<?php }?>
	<?php if ($boxes >= "8") {?>
	<div id="s5_fd2_8" class="s5_fd_nonactive" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box8_pic ?>); background-repeat: no-repeat">
		<?php echo $box8_content ?>
	</div>
	<?php }?>
	
	
	</div>

		
</div>

<script language="javascript" type="text/javascript" src="<?php echo $LiveSite?>modules/mod_s5_frontpage_display2/s5_frontpage_display_2/s5_checkactive.js"></script>

<?php } ?>


<?php if ($transstyle == "no") {?>

<div id="s5_fd2_outerm" style="z-index:3;position:absolute;margin-bottom:<?php echo $bm ?>px; margin-top:<?php echo $tm ?>px; margin-right:<?php echo $rm ?>px; margin-left:<?php echo $lm ?>px; padding:0px; width:<?php echo $modulewidth ?>px; height:<?php echo $topheight + $bottomheight ?>px; overflow:hidden">
	<div id="s5_fd2_loading"><div id="s5_fd2_loadimage"></div></div>
</div>
<div id="s5_fd2_outer" style="margin-bottom:<?php echo $bm ?>px; margin-top:<?php echo $tm ?>px; margin-right:<?php echo $rm ?>px; margin-left:<?php echo $lm ?>px; padding:0px; width:<?php echo $modulewidth ?>px; height:<?php echo $topheight + $bottomheight ?>px; overflow:hidden">

	<div id="s5_fd2_inner" style="opacity:.0; <?php if ($is_ie6 == "yes" || $is_ie7 == "yes" || $is_ie8 == "yes") { ?>filter: alpha(opacity=0); -moz-opacity: 0;<?php } ?>width:<?php echo $modulewidth ?>px; height:<?php echo $topheight ?>px; overflow:hidden;">
	<div onmouseover="s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="height:<?php echo $topheight ?>px; width:<?php echo $modulewidth ?>px; overflow:hidden; background-image: url(<?php echo $top1_pic ?>); background-repeat: no-repeat" id="blenddiv_s5_fd2">
			<img onmouseover="s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" src="<?php echo $top1_pic ?>" style="padding:0px; margin:0px; border: 0 none;opacity:.0; <?php if ($is_ie6 == "yes" || $is_ie7 == "yes" || $is_ie8 == "yes") { ?>filter: alpha(opacity=0); -moz-opacity: 0;<?php } ?> " id="blendimage_s5_fd2" alt="" />
	
	</div> 
	</div> 
	<div id="s5_fd2_wrap">
	

	
	<div id="s5_fd2_1" class="s5_fd_nonactive" onmouseover="s5_fd1();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box1_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
			<div class="s5_frontpaged_mr">
				<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
					<?php echo $box1_content ?>
				</div>
			</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>	
	</div>	
	
	
	<div id="s5_fd2_2" class="s5_fd_nonactive" onmouseover="s5_fd2();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box2_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
			<div class="s5_frontpaged_mr">
			<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
			<?php echo $box2_content ?>
		</div>
		</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>	
	</div>
	
	<?php if ($boxes >= "3") {?>
	<div id="s5_fd2_3" class="s5_fd_nonactive" onmouseover="s5_fd3();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box3_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
		<div class="s5_frontpaged_mr">
			<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
			<?php echo $box3_content ?>
		</div>
		</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>		
	</div>
	<?php }?>
	<?php if ($boxes >= "4") {?>
	<div id="s5_fd2_4" class="s5_fd_nonactive" onmouseover="s5_fd4();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box4_pic ?>); background-repeat: no-repeat">
		<div class="s5_frontpaged_tl">
			<div class="s5_frontpaged_tr" style="padding:0 16px;">
				<div class="s5_frontpaged_tm" style="height:16px;"></div>
			</div>	
		</div>
		<div class="s5_frontpaged_ml">
			<div class="s5_frontpaged_mr">	
		<div class="s5_fd2_sepd" style="height:<?php echo ($bottomheight) - 30;?>px;">
			<?php echo $box4_content ?>
		</div>
		</div>
		</div>	
		<div class="s5_frontpaged_bl">
			<div class="s5_frontpaged_br" style="padding:0 16px;">
				<div class="s5_frontpaged_bm" style="height:16px;"></div>
			</div>	
		</div>		
	</div>
	<?php }?>
	<?php if ($boxes >= "5") {?>
	<div id="s5_fd2_5" class="s5_fd_nonactive" onmouseover="s5_fd5();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box5_pic ?>); background-repeat: no-repeat">
		<?php if ($boxes >= "6") {?>
		<div class="s5_fd2_sepd">
		<?php }?>
			<?php echo $box5_content ?>
		<?php if ($boxes >= "6") {?>
		</div>
		<?php }?>
	</div>
	<?php }?>
	<?php if ($boxes >= "6") {?>
	<div id="s5_fd2_6" class="s5_fd_nonactive" onmouseover="s5_fd6();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box6_pic ?>); background-repeat: no-repeat">
		<?php if ($boxes >= "7") {?>
		<div class="s5_fd2_sepd">
		<?php }?>
			<?php echo $box6_content ?>
		<?php if ($boxes >= "7") {?>
		</div>
		<?php }?>
	</div>
	<?php }?>
	<?php if ($boxes >= "7") {?>
	<div id="s5_fd2_7" class="s5_fd_nonactive" onmouseover="s5_fd7();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box7_pic ?>); background-repeat: no-repeat">
		<?php if ($boxes >= "8") {?>
		<div class="s5_fd2_sepd">
		<?php }?>
			<?php echo $box7_content ?>
		<?php if ($boxes >= "8") {?>
		</div>
		<?php }?>	
	</div>
	<?php }?>
	<?php if ($boxes >= "8") {?>
	<div id="s5_fd2_8" class="s5_fd_nonactive" onmouseover="s5_fd8();s5_fd2_hover()" onmouseout="s5_fd2_hover_out()" style="float:left; padding:0px; margin:0px; height:<?php echo $bottomheight ?>px; width:<?php echo $boxwidth ?>%; background-image: url(<?php echo $box8_pic ?>); background-repeat: no-repeat">
		<?php echo $box8_content ?>
	</div>
	<?php }?>
	
	
	</div>

		
</div>

<?php } ?>



<script type="text/javascript">
var s5_fd2_highlight = '1';
var s5_fd2_rotate = '<?php echo $rotate ?>';
var s5_fd2_speed = '<?php echo $speed ?>';
var top1_pic = '<?php echo $top1_pic ?>';
var top1_hyperlink = '<?php echo $top1_hyperlink ?>';
var top1_target = '<?php echo $top1_target ?>';
var box1_pic = '<?php echo $box1_pic ?>';
var box1_pic_hover = '<?php echo $box1_pic_hover ?>';
var box1_hyperlink = '<?php echo $box1_hyperlink ?>';
var box1_target = '<?php echo $box1_target ?>';
var top2_pic = '<?php echo $top2_pic ?>';
var top2_hyperlink = '<?php echo $top2_hyperlink ?>';
var top2_target = '<?php echo $top2_target ?>';
var box2_pic = '<?php echo $box2_pic ?>';
var box2_pic_hover = '<?php echo $box2_pic_hover ?>';
var box2_hyperlink = '<?php echo $box2_hyperlink ?>';
var box2_target = '<?php echo $box2_target ?>';
var top3_pic = '<?php echo $top3_pic ?>';
var top3_hyperlink = '<?php echo $top3_hyperlink ?>';
var top3_target = '<?php echo $top3_target ?>';
var box3_pic = '<?php echo $box3_pic ?>';
var box3_pic_hover = '<?php echo $box3_pic_hover ?>';
var box3_hyperlink = '<?php echo $box3_hyperlink ?>';
var box3_target = '<?php echo $box3_target ?>';
var top4_pic = '<?php echo $top4_pic ?>';
var top4_hyperlink = '<?php echo $top4_hyperlink ?>';
var top4_target = '<?php echo $top4_target ?>';
var box4_pic = '<?php echo $box4_pic ?>';
var box4_pic_hover = '<?php echo $box4_pic_hover ?>';
var box4_hyperlink = '<?php echo $box4_hyperlink ?>';
var box4_target = '<?php echo $box4_target ?>';
var top5_pic = '<?php echo $top5_pic ?>';
var top5_hyperlink = '<?php echo $top5_hyperlink ?>';
var top5_target = '<?php echo $top5_target ?>';
var box5_pic = '<?php echo $box5_pic ?>';
var box5_pic_hover = '<?php echo $box5_pic_hover ?>';
var box5_hyperlink = '<?php echo $box5_hyperlink ?>';
var box5_target = '<?php echo $box5_target ?>';
var top6_pic = '<?php echo $top6_pic ?>';
var top6_hyperlink = '<?php echo $top6_hyperlink ?>';
var top6_target = '<?php echo $top6_target ?>';
var box6_pic = '<?php echo $box6_pic ?>';
var box6_pic_hover = '<?php echo $box6_pic_hover ?>';
var box6_hyperlink = '<?php echo $box6_hyperlink ?>';
var box6_target = '<?php echo $box6_target ?>';
var top7_pic = '<?php echo $top7_pic ?>';
var top7_hyperlink = '<?php echo $top7_hyperlink ?>';
var top7_target = '<?php echo $top7_target ?>';
var box7_pic = '<?php echo $box7_pic ?>';
var box7_pic_hover = '<?php echo $box7_pic_hover ?>';
var box7_hyperlink = '<?php echo $box7_hyperlink ?>';
var box7_target = '<?php echo $box7_target ?>';
var top8_pic = '<?php echo $top8_pic ?>';
var top8_hyperlink = '<?php echo $top8_hyperlink ?>';
var top8_target = '<?php echo $top8_target ?>';
var box8_pic = '<?php echo $box8_pic ?>';
var box8_pic_hover = '<?php echo $box8_pic_hover ?>';
var box8_hyperlink = '<?php echo $box8_hyperlink ?>';
var box8_target = '<?php echo $box8_target ?>';
</script>
	



<?php if ($transstyle == "no") {?>
<script language="javascript" type="text/javascript" src="<?php echo $LiveSite ?>/modules/mod_s5_frontpage_display2/s5_frontpage_display_2/s5_fd.js"></script>
<?php }?>
<script type="text/javascript">//<![CDATA[
if (document.images) {
	document.img0 = 0;
	document.img1 = 0;
<?php if ($boxes >= "3") {?>document.img2 = 0;<?php }?>
<?php if ($boxes >= "4") {?>document.img3 = 0;<?php }?>
<?php if ($boxes >= "5") {?>document.img4 = 0;<?php }?>
<?php if ($boxes >= "6") {?>document.img5 = 0;<?php }?>
<?php if ($boxes >= "7") {?>document.img6 = 0;<?php }?>
<?php if ($boxes >= "8") {?>document.img7 = 0;<?php }?>
	preloadimages() }
//]]></script>
