<?php include ("init.php"); ?>  
<!DOCTYPE html>
<!--[if lt IE 7]><html prefix="og: http://ogp.me/ns#" lang="en" class="no-js lt-ie9 lt-ie8 lt-ie7"><![endif]-->
<!--[if IE 7]><html prefix="og: http://ogp.me/ns#" lang="en" class="no-js lt-ie9 lt-ie8"><![endif]-->
<!--[if IE 8]><html prefix="og: http://ogp.me/ns#" lang="en" class="no-js lt-ie9"><![endif]-->
<!--[if IE 9]><html prefix="og: http://ogp.me/ns#" lang="en" class="no-js ie9 can-maxwidth can-cssclip"><![endif]-->
<!--[if gt IE 9]><!-->   
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html prefix="og: http://ogp.me/ns#" lang="en" class="no-js can-maxwidth can-cssclip"> <!--<![endif]--><head>
	<!--<![endif]-->
	<?php 
	$tmp = $thisUrl."functions/head_section.php";
	include ($tmp);
	?>
	<body class="home">
		<?php include ($thisUrl."functions/google_tags.php");?>	
		<a class="anchor" name="top"></a>
		<div class="page-wrapper">
			<div class="wrapper">				
				<?php
				//$tmp = $thisUrl."functions/head_date.php";
				//include ($tmp);
				$tmp = $thisUrl."functions/social_media.php";
				include ($tmp);
				if ($curPageArr[0]=="veitei") {
					include ($thisUrl.$curPageArr[0]."/functions/header-menu.php");
				} else {
					include ($thisUrl."functions/header-menu.php");
				}
				?>			
                <main role="main" class="main-content">
					<?php					
					$sql = 
					" select * from menus as a, content as b ".
					" WHERE to_menusID = menusID ";
					if ($curPageArr[0]=="veitei") {
						$sql .=
						" AND menusLink = '".str_replace($curPageArr[0]."/", "", $curPage)."'";						
					} else {
						$sql .=
						" AND menusLink = '".$curPage."'";
					}
					$max = mysql_num_rows(mysql_query($sql));
					$perhalaman = 7;
					$page = (isset($_GET["page"]) ? $_GET["page"] : "");
					if (isset($page)){
						$start=($page - 1) * $perhalaman;
					} else {
						$start=0;
					}
					//echo "<br>Max : ".$max;
					//echo "curPageArr: ".$curPageArr[0];
					if ($max > 1) {
						$tmp = $thisUrl."functions/multi-page.php";
						include ($tmp);
					} else {
						if ($curPageArr[0]=="veitei") {
							$tmp = $thisUrl.$curPageArr[0]."/functions/single-page.php";
							include ($tmp);						
						} else {
							$tmp = $thisUrl."functions/single-page.php";
							include ($tmp);
						}
					}
					echo '<p>&nbsp;</p>';
					//echo "<br> tmp : ".$tmp;
					//echo "<br> ID : ".$id;
					//echo "<br>Sql : ".$sql;
					?>   
					<?php
					/**
					$idContent = "";
					if ($hasil = mysql_query($sql)) {
						while ($data = mysql_fetch_array($hasil)) {
							$idContent = $data["idContent"];
						}
					}
					include ($thisUrl."functions/more_on_this_topic.php");
					**/
					?>
                </main>
				<!--insuma_ignore_begin-->
				<?php 
				$tmp = $thisUrl."functions/footer.php";
				include ($tmp);
				?>
				<!--insuma_ignore_end-->
            </div>
        </div>
		<?php 
        $tmp = $thisUrl."functions/footer_section.php";
        include ($tmp);
        ?>
	</body>
</html>