		<?php
			$twitter = get_option(THEME_NAME."_twitter");
			$facebook = get_option(THEME_NAME."_facebook");
			$digg = get_option(THEME_NAME."_digg");
			$youtube = get_option(THEME_NAME."_youtube");
			$flickr = get_option(THEME_NAME."_flickr");
			if ( get_option( THEME_NAME."_rss_button" ) == "on" ) {							
				$rss = get_option(THEME_NAME."_rss_url");	
				if($rss == "") {
					$rss = get_bloginfo("rss_url");
				}
			} else { 
					$rss = false; 
				}	
			$footer_title = get_option(THEME_NAME."_footer_title");
			$footer_txt = get_option(THEME_NAME."_footer_txt");
			
			$footer_text = get_option(THEME_NAME."_footer_text");
			$cat_block = get_option(THEME_NAME."_cat_block");
			$social_footer = get_option(THEME_NAME."_social_footer");
			
		
		?>
		<!-- BEGIN .main-footer -->
		<div class="main-footer">
			<?php if ( $footer_text == "on" ) { ?>
			<div class="about">
				<h2><?php echo $footer_title; ?></h2>
				<div>
					<?php echo add_p_tags($footer_txt); ?>
				</div>
			</div>
			<?php } ?>
			
			<?php if ( $cat_block == "on" ) { ?>
			<div class="categories">
				<h2><?php printf ( __( 'Categories' , THEME_NAME ));?></h2>
				<ul>
					<?php 
						for ( $i=1; $i<=7; $i++) { 
						
							$cat = get_option( THEME_NAME."_cat_block_".$i );
							$cat_link = get_category_link( $cat );
							$cat_name = get_cat_name( $cat );	
							
							if ( $cat ) {
								echo "<li><a href=\"".$cat_link."\">".$cat_name."</a></li>";
							}
						} ?>
				</ul>
			</div>
			<?php } ?>
			<?php if ( $social_footer == "on" ) { ?>
			<div class="social">
				<h2><?php printf ( __( 'Social networks' , THEME_NAME ));?></h2>
				<ul>
					<?php if ( $twitter ) { ?><li><a href="<?php echo trim($twitter); ?>" class="twitter" target="_blank"><?php printf ( __( 'Follow us on Twitter' , THEME_NAME ));?></a></li><?php } ?>
					<?php if ( $facebook ) { ?><li><a href="<?php echo trim($facebook); ?>" class="facebook" target="_blank"><?php printf ( __( 'Friend un on Facebook' , THEME_NAME ));?></a></li><?php } ?>
					<?php if ( $digg ) { ?><li><a href="<?php echo trim($digg); ?>" class="digg" target="_blank"><?php printf ( __( 'Dig us at Digg' , THEME_NAME ));?></a></li><?php } ?>
					<?php if ( $youtube ) { ?><li><a href="<?php echo trim($youtube); ?>" class="youtube" target="_blank"><?php printf ( __( 'Watch our YouTube channel' , THEME_NAME ));?></a></li><?php } ?>
					<?php if ( $flickr ) { ?><li><a href="<?php echo trim($flickr); ?>" class="flickr" target="_blank"><?php printf ( __( 'Check our photos at Flickr' , THEME_NAME ));?></a></li><?php } ?>
					<?php if ( $rss ) { ?><li><a href="<?php echo trim($rss); ?>" class="rss"><?php printf ( __( 'RSS feeds' , THEME_NAME ));?></a></li><?php } ?>
				</ul>
			</div>
			<?php } ?>
			<div class="copyright">
				<div class="back-to-top"><a href="#top"><span><?php printf ( __( 'go back to the top' , THEME_NAME ));?></span></a></div>
				Copyright &amp; Design &copy; 2013 by <b><a href="http://www.mobanbus.cn" target="_blank">WordPress Themes</a></b>
			</div>
		<!-- END .main-footer -->
		</div>

		<!-- END .main-content -->
		</div>

		<!-- END .main-content-wrapper -->
		</div>

	<?php wp_footer(); ?>	
	<!-- END body -->
	</body>

<!-- END html -->
</html>
