<?
// Filename: mainpage_fcns.inc
// Updated: 2002-11-24 11:59pm
// Main Page Functions for index.php


function connect_maplejt()
{
@ $db = mysql_pconnect("localhost","hdkdfmnc","iekdhsle");//iekdhsle
if (!$db) {
	echo "Error: Could not connect to the database.";
	exit;
	}
mysql_select_db("maplejt_com");
}

function insert_htmlhead(){
?>
<title> Maple Leaf Junior Golf Tour 2004 </title>
<?
}

function insert_header() 
{ ?><img src="images/interface/head001.jpg" border="0" alt="" width="702" height="76"><? }

// insert main menu header
function insert_mmheader() 
{ ?><img src="images/interface/mmspacer001.gif"><? }
   
// insert main menu
function insert_mm() 

{
?>
<table width="157" cellpadding="0" cellspacing="0" bgcolor="#1B1B1B">
<tr><td bgcolor="#353535"><h1>&nbsp;PLAYER INFORMATION</h1></td</tr>
<tr><td>
<div id="navlist">
<ul>
<li><h2><a href="index.php">&nbsp;Main</a></h2>
<li><h2><a href="static.php?&static_id=membership_benifits">&nbsp;Member Benefits</a></h2>
<li><h2><a href="static.php?&static_id=membership_registration">&nbsp;Registration Information</a></h2>
<li><h2><a href="events.php">&nbsp;Schedule Information</a></h2>
<li><h2><a href="static.php?&static_id=application_download">&nbsp;Application Download</a></h2>
<li><h2><a href="static.php?&static_id=events_spring">&nbsp;Spring Series</a></h2>
<li><h2><a href="static.php?&static_id=events_cpga">&nbsp;Mazda CPGA Zone<br>&nbsp;Junior Championship</a></h2>
<li><h2><a href="events.php?&tournament=54">&nbsp;MJT National<br>&nbsp;Tour Championship</a></h2>
<li><h2><a href="static.php?&static_id=internationalevents">&nbsp;International Events</a></h2>
<li><h2><a href="static.php?&static_id=oom">&nbsp;Callaway Order of Merit</a></h2>
<li><h2><a href="profiles.php">&nbsp;Player Profiles</a></h2>
</ul></div></td></tr>
<tr><td><h2>&nbsp;</h2><tr><td>
<tr><td bgcolor="#353535"><h1>&nbsp;SPONSORS</h1></td</tr>
<tr><td>
<div id="navlist">
<ul><li><h2><a href="sponsors.php">&nbsp;MJT Sponsors</a></h2>
<li><h2><a href="sponsors_becoming.php">&nbsp;Becoming a Sponsor</a></h2>
</ul></div></td></tr>
<tr><td><h2>&nbsp;</h2><tr><td>
<tr><td bgcolor="#353535"><h1>&nbsp;ABOUT THE MJT</h1></td</tr>
<tr><td>
<div id="navlist">
<ul>
<li><h2><a href="static.php?&static_id=tour_facts">&nbsp;Tour Facts</a></h2>
<li><h2><a href="static.php?&static_id=directors">&nbsp;Tournament Directors</a></h2>
<li><h2><a href="contact.php">&nbsp;Contact Us</a></h2>
</ul></div></td></tr>
</table>
<?
}

function insert_rankings($tournament){
?>
<table width="157" cellpadding="0" cellspacing="0" bgcolor="#1B1B1B">
<tr><td bgcolor="#353535"><h1>&nbsp;RANKINGS</h1></td</tr>
<tr><td bgcolor="#ECECEC"><? echo "<center>"; if (checkposted_oomresults($tournament)) {
		   
   		   echo "<h2 class=\"black\"><a class=\"black\" href=\"results.php?&tournament=$tournament&type=oom\">";
		   echo "<img border=\"0\" src=\"/images/misc/callaway.jpg\"><br>Order of Merit Standings</a></h2>";
           }
		   echo "<img broder=\"0\" src=\"/images/misc/jgslogo.jpg\"></center>";
		   ?></td></tr>
</table>
<?



}

// insert results menu
function insert_rm($tournament) 

{
?><table width="153" border="0" bgcolor="#00813D"cellspacing="0" cellpadding="0">
<tr><td valign="top" height="11" width="153"><img src="images/interface/mainmenuspacertop_001.jpg"></td></tr><?

echo "<tr><td valign=\"top\" height=\"0\" wdith=\"153\"><a href=\"results.php?&tournament=$tournament&type=full\"><font size=\"8pt\"><h2>&nbsp;» Full Results</h2></a></td></tr>"; 
echo "<tr><td height=\"1\" wdith=\"153\"><img border=\"0\" src=\"images/interface/mainmenuspacer_001.gif\"></td></tr>";
echo "<tr><td valign=\"top\" height=\"0\" wdith=\"153\"><a href=\"results.php?&tournament=$tournament&type=topfinishers\"><font size=\"8pt\"><h2>&nbsp;» Top Finishers</h2></a></td></tr>"; 
echo "<tr><td height=\"1\" wdith=\"153\"><img border=\"0\" src=\"images/interface/mainmenuspacer_001.gif\"></td></tr>";
echo "<tr><td valign=\"top\" height=\"0\" wdith=\"153\"><a href=\"results.php?&tournament=$tournament&type=oom\"><font size=\"8pt\"><h2>&nbsp;» Callaway OOM</h2></a></td></tr>"; 
echo "<tr><td height=\"1\" wdith=\"153\"><img border=\"0\" src=\"images/interface/mainmenuspacer_001.gif\"></td></tr>";
echo "<tr><td valign=\"top\" height=\"0\" wdith=\"153\"><a href=\"results.php?&tournament=$tournament&type=press\"><font size=\"8pt\"><h2>&nbsp;» Press Release</h2></a></td></tr>"; 
echo "<tr><td height=\"1\" wdith=\"153\"><img border=\"0\" src=\"images/interface/mainmenuspacer_001.gif\"></td></tr>";
echo "<tr><td valign=\"top\" height=\"0\" wdith=\"153\"><a href=\"results.php?&tournament=$tournament&type=awards\"><font size=\"8pt\"><h2>&nbsp;» Awards</h2></a></td></tr>"; 
echo "<tr><td height=\"1\" wdith=\"153\"><img border=\"0\" src=\"images/interface/mainmenuspacer_001.gif\"></td></tr>";
echo "<tr><td valign=\"top\" height=\"0\" wdith=\"153\"><a href=\"results.php?&tournament=$tournament&type=ach\"><font size=\"8pt\"><h2>&nbsp;» Achievements</h2></a></td></tr>"; 
echo "<tr><td height=\"1\" wdith=\"153\"><img border=\"0\" src=\"images/interface/mainmenuspacer_001.gif\"></td></tr>";
echo "<tr><td valign=\"top\" height=\"0\" wdith=\"153\"><a href=\"results.php?&tournament=$tournament&type=prizes\"><font size=\"8pt\"><h2>&nbsp;» Draw Prizes</h2></a></td></tr>"; 
?>
</table>
<?
}

// insert sponsors menu
function insert_sm() 
{
?><table width="153" border="0" bgcolor="#00813D"cellspacing="0" cellpadding="0">
<tr><td valign="top" height="11" width="153"><img src="images/interface/mainmenuspacertop_001.jpg"></td></tr>
<tr><td wdith="153"><a href="sponsors_presenting.php"><h2>&nbsp;» Presenting Sponsor</h2></a></td></tr>
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="sponsors_official.php"><h2>&nbsp;» Official Sponsors</h2></a></td></tr>
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="sponsors_tournament.php"><h2>&nbsp;» Tournament Sponsors</h2></a></td></tr>
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="sponsors_product.php"><h2>&nbsp;» Product Sponsors</h2></a></td></tr>
</table>
<?
}

function insert_membershipm() 
{
?><table width="153" border="0" bgcolor="#00813D"cellspacing="0" cellpadding="0">
<tr><td valign="top" height="11" width="153"><img src="images/interface/mainmenuspacertop_001.jpg"></td></tr>
<tr><td wdith="153"><a href="membership_information.php"><h2>&nbsp;» Membership Information</h2></a></td></tr>
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="membership_entry.php"><h2>&nbsp;» Entry Procedures</h2></a></td></tr>
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="membership_application.php"><h2>&nbsp;» Application Download</h2></a></td></tr>
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="membership_conduct.php"><h2>&nbsp;» Code of Conduct</h2></a></td></tr>
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="membership_about.php"><h2>&nbsp;» About the WCJGT</h2></a></td></tr>
</table>
<?
}

function insert_qualifierm() 
{
?><table width="153" border="0" bgcolor="#00813D"cellspacing="0" cellpadding="0">
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr><td wdith="153"><a href="membership_qualifiers.php"><h2>&nbsp;» Qualifying Tournaments</h2></a></td></tr>
</table>
<?
}

function insert_tdate($tnumber) {
connect_maplejt();
$query = "SELECT UNIX_TIMESTAMP(tournament_date) FROM tournaments WHERE tournament_id = '$tnumber'";
$query2 = "SELECT UNIX_TIMESTAMP(tournament_date2) FROM tournaments WHERE tournament_id = '$tnumber'";
$result = mysql_query ($query); 
$result2 = mysql_query ($query2);
$row = mysql_fetch_array($result);
$row2 = mysql_fetch_array($result2);
$row[0] = $row[0] + 82800; // adjust to correct date??!!
$row2[0] = $row2[0] + 82800; // adjust to correct date??!!
echo date("F", $row[0]);
echo "<br>";
echo date("j", $row[0]);
echo " - ";
echo date("j", $row2[0]);
}

function insert_tdates($tnumber) {
connect_maplejt();
$query = "SELECT UNIX_TIMESTAMP(tournament_date) FROM tournaments WHERE tournament_id = '$tnumber'";
$query2 = "SELECT UNIX_TIMESTAMP(tournament_date2) FROM tournaments WHERE tournament_id = '$tnumber'";
$result = mysql_query ($query); 
$result2 = mysql_query ($query2);
$row = mysql_fetch_array($result);
$row2 = mysql_fetch_array($result2);
$row[0] = $row[0] + 82800; // adjust to correct date??!!
$row2[0] = $row2[0] + 82800; // adjust to correct date??!!
echo date("F ", $row[0]);
echo date("j", $row[0]);
echo " - ";
echo date("j", $row2[0]);
}

function insert_tdatefull($tnumber) {
connect_maplejt();
$query = "SELECT UNIX_TIMESTAMP(tournament_date) FROM tournaments WHERE tournament_id = '$tnumber'";
$query2 = "SELECT UNIX_TIMESTAMP(tournament_date2) FROM tournaments WHERE tournament_id = '$tnumber'";
$result = mysql_query ($query); 
$result2 = mysql_query ($query2); 
$row = mysql_fetch_array($result);
$row2 = mysql_fetch_array($result2);
$row[0] = $row[0] + 82800; // adjust to correct date??!!
$row2[0] = $row2[0] + 82800; // adjust to correct date??!!
echo date("F j", $row[0]);
echo " - ";
echo date("F j, Y", $row2[0]);
}

function insert_ndate($nnumber) {
connect_maplejt();
$query = "SELECT UNIX_TIMESTAMP(news_date) FROM news WHERE news_id = '$nnumber'";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);
echo date("F j, Y", $row[0]);
}

function insert_signup() 
{ ?>
<table width="153" border="0" bgcolor="#00813D"cellspacing="0" cellpadding="0">
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacerbottom_001.gif"></td></tr>
</table>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=153 HEIGHT=52>
<PARAM NAME=movie VALUE="flash/signup002.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#00813D>
<EMBED src="flash/signup002.swf" quality=high bgcolor=#00813D  WIDTH=153 HEIGHT=52 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
<? }

function insert_signupjgs() 
{ ?>
<table width="153" border="0" bgcolor="#00813D"cellspacing="0" cellpadding="0">
<tr><td wdith="153"><img border="0" src="images/interface/mainmenuspacerbottom_002.gif"></td></tr>
<tr><td wdith="153"><img border="0" src="images/interface/signupjgs_002.gif"></td></tr>
<tr><td wdith="153"><img border="0" src="images/interface/mainmenuspacerbottom_001.gif"></td></tr>
</table>
<? }

// inserts a sponsor box below the main menu
function insert_sponsorblank(){
echo "<table width=\"153\" border=\"0\" bgcolor=\"#00813D\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr><td width=\"153\"><img src=\"images/interface/sponsorheaderblank_001.gif\"></td></tr>";
echo "</table>";
}

function insert_microsponsor($sponsor_id, $id){
if (($id == 51) || ($id == 44) || ($id == 45) || ($id == 46) || ($id == 53)) {
	echo "<img src=\"images/sponsors/pga_m.gif\">";
	return;
	}
if (($id == 41)) {
	echo "<img src=\"images/sponsors/opga_m.gif\">";
	return;
	}		
if (($id == 54)) {
	echo "<img src=\"images/sponsors/bostonpizza_m.jpg\">";
	return;
	}	
if ($sponsor_id == 0) {
	?>
	<img src="/images/sponsors/mjt_m.jpg">
	<?    
	}
	else {
		connect_maplejt();
		$query = "SELECT * FROM sponsors WHERE sponsor_id = '$sponsor_id'";
		$result = mysql_query ($query); 
		$row = mysql_fetch_array($result);
		echo "<img src=\"images/sponsors/$row[m_filename]\">";
	}
}


function insert_presentingsponsor() 
{
connect_maplejt();
$query = "SELECT * FROM sponsors WHERE sponsor_id = '1'";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);

	echo "<table width=\"156\" border=\"0\" bgcolor=\"#00813D\" cellspacing=\"0\" cellpadding=\"0\">";
	echo "<tr><td width=\"156\"><img src=\"images/interface/presentingsponsor001.jpg\"></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><!-- sponsor image --><h1 align=\"center\"><img src=\"images/sponsors/$row[t_filename]\"></h1></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><h3 align=\"center\">";
	echo "<tr><td width=\"156\"><img src=\"images/interface/sponsorfooter001.jpg\"></td></tr>";
	echo "</table>";
	echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"153\">";
	echo "</table>";
}


function insert_sponsor() 
{
connect_maplejt();
$query = "SELECT sponsor_id FROM sponsors ORDER BY sponsor_id DESC";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);
$max_sponsor_id = $row[sponsor_id];
$random_sponsor_id = rand(1,$max_sponsor_id);
$query = "SELECT * FROM sponsors WHERE sponsor_id = $random_sponsor_id";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);

	echo "<table width=\"156\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	echo "<tr><td width=\"156\"><img src=\"images/interface/featuredsponsor001.jpg\"></td></tr>";
//	echo "<tr><td height=\"10\" bgcolor=\"#FFFFFF\"></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><!-- sponsor image --><h1 align=\"center\"><img src=\"images/sponsors/$row[t_filename]\"></h1></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><h2 align=\"center\">$row[sponsor_name]</h2></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><h3 align=\"center\">";
	echo "<table width=\"90%\"><tr><td>";
	$s_text = stripslashes($row[sponsor_text]);
	$s_text2 = substr($s_text, 0, 300);	// truncate string to 300 charicters
	echo $s_text2;
	if (strlen($s_text2) > 295)
		echo "...";
	echo "</h3></td></tr>";
	
	// determine what page to like the sponsor link to
	if ($row[sponsor_type] == 'official'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors_official.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	if ($row[sponsor_type] == 'presenting'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	if ($row[sponsor_type] == 'product'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors_product.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	if ($row[sponsor_type] == 'tournament'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors_tournament.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	echo "</tr></td></table>";
	echo "<tr><td width=\"156\"><img src=\"images/interface/sponsorfooter001.jpg\"></td></tr>";
	echo "</table>";
	echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"153\">";
	// echo "<tr><td height=\"300\" bgcolor=\"#00813D\" >&nbsp;</td></tr>";
	echo "</table>";
}

function insert_sponsor_name($id) 
{
// get a random sponsor ID
connect_maplejt();
$query = "SELECT * FROM sponsors WHERE sponsor_id = '$id'";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);
	echo "$row[sponsor_name]";
		if ($row[sponsor_type] == 'official'){
		echo "<br><a class=\"reverse\"href=\"sponsors_official.php\">Read More</a>";
		}
	if ($row[sponsor_type] == 'presenting'){
		echo "<br><a class=\"reverse\"href=\"sponsors.php\">Read More</a>";
		}
	if ($row[sponsor_type] == 'product'){
		echo "<br><a class=\"reverse\"href=\"sponsors_product.php\">Read More</a>";
		}
	if ($row[sponsor_type] == 'tournament'){
		echo "<br><a class=\"reverse\"href=\"sponsors_tournament.php\">Read More</a>";
		}
}

function insert_sponsor_image_by_id($id) 
{
// get a random sponsor ID
connect_maplejt();
$query = "SELECT * FROM sponsors WHERE sponsor_id = '$id'";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);
	echo "<img src=\"images/sponsors/$row[t_filename]\">";
}

function insert_sponsor_by_id($id) 
{
if ($id == 0) {
    return;
}
// get a random sponsor ID
connect_maplejt();
$query = "SELECT * FROM sponsors WHERE sponsor_id = '$id'";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);

	echo "<table width=\"156\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	echo "<tr><td width=\"156\"><img src=\"images/interface/presentingsponsor001.jpg\"></td></tr>";
//	echo "<tr><td height=\"10\" bgcolor=\"#FFFFFF\"></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><!-- sponsor image --><h1 align=\"center\"><img src=\"images/sponsors/$row[t_filename]\"></h1></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><h2 align=\"center\">$row[sponsor_name]</h2></td></tr>";
	echo "<tr><td width=\"156\" bgcolor=\"#FFFFFF\"><h3 align=\"center\">";
	echo "<table width=\"90%\"><tr><td>";
	$s_text = stripslashes($row[sponsor_text]);
	$s_text2 = substr($s_text, 0, 300);	// truncate string to 300 charicters
	echo $s_text2;
	if (strlen($s_text2) > 295)
		echo "...";
	echo "</h3></td></tr>";
	
	// determine what page to like the sponsor link to
	if ($row[sponsor_type] == 'official'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors_official.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	if ($row[sponsor_type] == 'presenting'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	if ($row[sponsor_type] == 'product'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors_product.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	if ($row[sponsor_type] == 'tournament'){
		echo "<tr><td width=\"153\" bgcolor=\"#FFFFFF\"><a class=\"reverse\"href=\"sponsors_tournament.php\"><h2 align=\"center\" color=\"#000000\">(Read More)</h2></a></td></tr>";
		}
	echo "</tr></td></table>";
	echo "<tr><td width=\"156\"><img src=\"images/interface/sponsorfooter001.jpg\"></td></tr>";
	echo "</table>";
	echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"153\">";
	// echo "<tr><td height=\"300\" bgcolor=\"#00813D\" >&nbsp;</td></tr>";
	echo "</table>";
}

function insert_sponsormenu(){
?>
		<p>
		<b><a class="reverse" href="sponsors_official.php">Official Sponsors</a></b><br>
		<b><a class="reverse" href="sponsors_tournament.php">Tournament Sponsors</a></b><br>		
		<b><a class="reverse" href="sponsors_product.php">Product Sponsors</a></b><br>		
		<b><a class="reverse" href="sponsors_other.php">MJT Affiliated Organizations</a></b><br>	
		<b><a class="reverse" href="mrlube.php">Long Drive Competition Sponsor</a></b><br>		
		<b><a class="reverse" href="sundog.php">Skills Competition Sponsor </a></b><br>		
		</p>
<?
}

function insert_golfwest()
{
?><br>
<table width="157" cellpadding="0" cellspacing="0" valign="top">
<tr><td>
<img src="/images/interface/memberspecials001.jpg">
<tr><td bgcolor="#1B1B1B" valign="top">
<img src="/images/interface/golfwest_001.jpg">
<table width="140">
<tr><td>
<p class="white">Just one of the special benefits for MJT members is a complimentary copy of GolfWest magazine!<br>
<br>
Featuring MJT player profiles, MJT tournament results and more.<br>
<br>
<b>Watch this space for future Member Specials</b></p>
<center><img src="/images/misc/golfwest.jpg">
<b><a href="www.mygolfwest.com">www.mygolfwest.com</a></b>
</center>
</td></tr>
</td></tr>
</table>
</table>
<?
}


function insert_sponsors($sponsortype)
{
connect_maplejt();
$query = "SELECT * FROM sponsors WHERE sponsor_type = '$sponsortype'";
$result = mysql_query ($query); 

?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <?
while($row = mysql_fetch_array($result)){
	echo "<tr><td width=\"485\" align=\"middle\" valign=\"top\"><img src=\"images/sponsors/$row[l_filename]\"></td></tr>";
	echo "<tr><td width=\"485\" align=\"left\" valign=\"top\"><p>";
	echo stripslashes($row[sponsor_text]);
	if (!($row[sponsor_website] == NULL)){
		echo " - ";
		echo "<b><a class=\"reverse\" href=\"http://$row[sponsor_website]\">$row[sponsor_website]</a>";
		}
	echo "</b>";	
	echo "</p></td></tr>";
	echo "<tr><td width=\"485\" align=\"middle\" valign=\"top\"><img border=\"0\" width=\"485\" src=\"images/interface/mainmenuspacer_001.gif\"></td></tr>";
	echo "<tr><td>&nbsp;</td></tr>";
	}
	?> </table> <?
}
   
// insert navbar - creates the navbar that sits under the header
function insert_mainnavbar() 
{
?>
<div id="hnavlist">
<table height="18" width="545" border="0" cellspacing="0" bgcolor="#353535" cellpadding="0">
<tr>
<td><ul><li><h2>&nbsp;&nbsp;&nbsp;<a href="schedule.php">SCHEDULE</a></h2></li></ul></td>
<td><ul><li><h2>&nbsp;&nbsp;&nbsp;<a href="teetimes.php">TEE TIMES</a></h2></li></ul></td>
<td><ul><li><h2>&nbsp;&nbsp;&nbsp;<a href="results.php">RESULTS</a></h2></li></ul></td>
<td><ul><li><h2>&nbsp;&nbsp;&nbsp;<a href="photos.php">PHOTO GALLERY</a></h2></li></ul></td>
<td><ul><li><h2>&nbsp;&nbsp;&nbsp;<a href="results_archive.php">ARCHIVES</a></h2></li></ul></td>
</tr>
</table>
</div>
<?
}

function insert_banner()
{
$random = rand(1,7);

?>
<center>
<img border="0" src="/images/banners/<? echo $random; ?>.jpg">
</center>
<?
}


function insert_ttimesbar()
{
?><table border="0" cellspacing="0" width="219" cellpadding="0">
<tr><td><img src="images/interface/teetimesheader_003.jpg"></td></tr>
<tr><td align="center"><h2><a class="reverse" href="teetimes.php?&tournament=8">THE HONDA WAY JUNIOR <br>AT LEDGEVIEW GC</a><!-- Currently No Tee Times Posted --></h2></td></tr>
<tr><td height="10"></td></tr>
<tr><td align="center"><h2 class="red">Check HERE for Tee Times posted 48 hours prior to tournament</h2></td></tr>
</table>
<?
}

function insert_sidebar()
{
?>
<table border="0" cellspacing="0" width="200" cellpadding="0">
<tr><td><h1 class="plain">
<!-- <center><img src="images/icons/clevelandwinners.jpg"></center> -->
</td></tr>
<tr><td height="10"></td></tr>
</table>
<?
/* ?>
<table border="0" cellspacing="0" width="200" cellpadding="0">
<tr><td><img align="left" src="images/icons/ontarionjt.jpg"><h1>ONTARIO MAJOR JUNIOR CHAMPIONSHIPS ANNOUNCED!</h1></td></tr>
<tr><td><h2 class="plain">The 2003 season of 24 tournaments now includes two major championships in Ontario under the Nationwide Junior Tour banner in affiliation with the Ontario and Northern Ontario Professional Golfers' Associations.<br><br>
August 11-12: <a class="reverse" href="tournaments.php?&tournament=18"><b>The Ontario PGA Junior Championship presented by MAZDA</b></a> at Royal Ashburn GC, Ashburn, ON<br><br>
August 25-26: <a class="reverse" href="tournaments.php?&tournament=22"><b>The Northern Ontario Junior Championship presented by MAZDA</b></a> at Timberwolf Golf Club, Sudbury, ON</h2>
<center><br><a href="membership_application.php"><h1 class="red">Click here to register!</h1></a></center><br>
<h2 class="plain">Note: Look for the full Ontario schedule for 2004, due this November! More tournaments will be scheduled as the top junior Tour in Canada increases the opportunities for juniors across the country.</h1><br>
<br>
<center><img src="images/icons/ontariopga.jpg"></center>
<h2 class="plain">
"The Ontario PGA is proud to partner with the Western Canada Junior Golf Tour (now Nationwide Junior Golf Tour) on this exciting new venture. Combining our two Associations will surely benefit both parties and provide Ontario's junior golfers with another venue to test their abilities against their peers. The Ontario PGA is committed to excellence in all its undertakings and you and your players should expect nothing less than a great event."......Chris Jones, Captain, Ontario PGA</h2>
</td></tr>
<tr><td height="10"></td></tr>
</table><? */

}

function insert_resultsbar()
{
?><table border="0" cellspacing="0" width="219" cellpadding="0">
<tr><td><img src="images/interface/resultsheader_002.jpg"></td></tr>
<tr><td align="center"><!-- <h2><a class="reverse" href="results.php?&tournament=8&type=full"></a> <!-- Currently No Results Posted  </h2>-->
</td></tr>
<tr><td height="10"></td></tr>
<tr><td align="center"><h2 class="red">RESULTS posted within 24 hours of each tournament</h2></td></tr>
</table><?
}

function insert_rnavbar($tournament, $type){
connect_maplejt();
$query = "SELECT MAX(tournament_id) FROM tournaments";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);
// echo "highest tourney is $row[0]";
$tnext = $tournament + 1;
$tprev = $tournament - 1;
if ($tournament == $row[0]){
	$tnext = 1;
	}
if ($tournament == 25){
	$tprev = $row[0];
	}
?><table width="153" border="0" bgcolor="#00813D"cellspacing="0" cellpadding="0">
<tr><td height="1" wdith="153"><img border="0" src="images/interface/mainmenuspacer_001.gif"></td></tr>
<tr>
<? echo "<td align=\"middle\" valign=\"top\" height=\"0\" wdith=\"153\">";
echo "<h2 class=\"white\">Prev&nbsp;<a href=\"results.php?&tournament=$tprev&type=$type\">"; ?>
<img border="0" src="images/interface/tournamentsnavleft_001.jpg"></a>
<?

echo "<a href=\"results.php?&tournament=$tnext&type=$type\">"; ?>
<img border="0" src="images/interface/tournamentsnavright_001.jpg"></a>Next&nbsp;&nbsp;
</h2></td></tr>
</table>
<?
}

function insert_tnavbar($tournament){
connect_maplejt();
$query = "SELECT MAX(tournament_id) FROM tournaments";
$result = mysql_query ($query); 
$row = mysql_fetch_array($result);
// echo "highest tourney is $row[0]";
$tnext = $tournament + 1;
$tprev = $tournament - 1;
if ($tournament == $row[0]){
	$tnext = 25;
	}
if ($tournament == 25){
	$tprev = $row[0];
	}
echo "<a href=\"events.php?&tournament=$tprev\">Previous Event</a>&nbsp;&nbsp;&nbsp;";
echo "<a href=\"events.php?