<?php
if(!preg_match("/\/home.php/",$_SERVER['HTTP_REFERER'])){
	echo "<script>location.href='" . $CONST_LINK_ROOT . "/home.php#ccover'</script>"; die;
}
if ($ConfirmSign==1) {
	print"<script>window.location.href='$CONST_LINK_ROOT/home.php#cstart'</script>";
	exit;
}
?>

<script type="text/javascript">  
jQuery(document).ready(function () {
	
	var hash = document.location.hash.replace(/#m/i, '');
	if (hash.match("[\?&]tab=([^&#]*)")) {
	var tab = hash.match("[\?&]tab=([^&#]*)")[1];
	}
	
	//highlight the selected link
	if (tab) {
//	alert (tab+'1');
	jQuery('#tab_main' + tab).attr("class", "current");
	jQuery('a[id!=tab_main' + tab +']').removeClass('current');
	} else if (hash==''){
	jQuery('#tab_maincover').attr("class", "current");
	jQuery('a[id!=tab_maincover]').removeClass('current');
	} else {
//	alert (tab+'2');
//	alert (hash+'3');
	jQuery('#tab_main' + hash).attr("class", "current");
	jQuery('a[id!=tab_main' + hash +']').removeClass('current');
	}
	
});
</script> 
<ul id="submenu">
  <li><a href="#mcover" id="tab_maincover" rel="sub_link" onclick="javascript: callpage(this.href);">Cover</a></li>
  <li><a href="#mcategories" id="tab_maincategories" rel="sub_link" onclick="javascript: callpage(this.href);">Categories</a></li>
<!--  <li><a href="#mlistings" id="tab_mainlistings" rel="sub_link" onclick="javascript: callpage(this.href);">Listings</a></li>
-->  <li><a href="#msearch" id="tab_mainsearch" rel="sub_link" onclick="javascript: callpage(this.href);">Search</a></li>
</ul>
