<?php

	include "library.php";

	$cxn = start_code( true );
	

    $menu = val( $_GET, "menu" );


    if ($menu == "search")
    {
	    page_header( "Search listings", $cxn );
	    
        show_mobile_search_buttons();
    }
    else
    if ($menu == "listings")    
    {
	    page_header( "Listings", $cxn );
	
        show_mobile_listings_buttons();
    }
    else
    if ($menu == "accounts")    
    {
	    page_header( "Accounts", $cxn );

        show_mobile_accounts_buttons();
    }
    else
    if ($menu == "messages")    
    {
	    page_header( "Messages", $cxn );

        show_mobile_messages_buttons();
    }
    else
    if ($menu == "information")    
    {
	    page_header( "Information", $cxn );

        show_mobile_information_buttons();
    }
    else
    if ($menu == "other")    
    {
	    page_header( "Other", $cxn );

        show_mobile_other_buttons();
    }
    


    function show_mobile_search_buttons()
    {
        echo "<br><br>";
    
        echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-collapse: collapse'>";
    
        echo "<tr>";
    
    	echo "<td width='20%'></td><td width='60%' align='left'>";

    	show_green_button3( "&nbsp;&nbsp;Search listings", 75, "search_listings.php" );

    	echo "</td><td width='20%'></td></tr><tr><td width='20%'></td><td width='60%' align='left'>";

    	show_green_button3_bottom( "&nbsp;&nbsp;Remembered list", 75, "mailboxes.php", "box", "remembered" );

    	echo "</td><td width='20%'></td></tr></table>";

    }



    function show_mobile_listings_buttons()
    {
        echo "<br><br>";
    
        echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-collapse: collapse'>";
    
        echo "<tr>";
    
    	echo "<td width='20%'></td><td width='60%' align='left'>";
    	
    	show_green_button3( "&nbsp;&nbsp;Create listing", 160, "edit_listing.php", "newlisting", "true" );
    	
    	echo "</td><td width='20%'></td></tr><tr><td width='20%'></td><td width='60%' align='left'>";
    	
    	show_green_button3_bottom( "&nbsp;&nbsp;View my listings", 160, "view_my_listings.php" );

    	echo "</td><td width='20%'></td></tr></table>";
    }



    function show_mobile_accounts_buttons()
    {
        echo "<br><br>";        
        
        echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-collapse: collapse'>";
    
        echo "<tr>";
    
    	echo "<td width='20%'></td><td width='60%' align='left'>";
    	
    	show_green_button3( "&nbsp;&nbsp;Create an account", 160, "edit_account.php", "newaccount", "true" );
    	
    	echo "</td><td width='20%'></td></tr><tr><td width='20%'></td><td width='60%' align='left'>";

    	show_green_button3_bottom( "&nbsp;&nbsp;Edit my account", 160, "edit_account.php", "newaccount", "false" );

    	echo "</td><td width='20%'></td></tr></table>";
    }



    function show_mobile_messages_buttons()
    {
        echo "<br><br>";
    
        echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-collapse: collapse'>";
    
        echo "<tr>";
    
    	echo "<td width='15%'></td><td width='60%' align='left'>";
    	
    	show_green_button3( "&nbsp;&nbsp;Inbox", 200, "mailboxes.php", "box", "inbox" );
    	
    	echo "</td><td width='15%'></td></tr><tr><td width='15%'></td><td width='60%' align='left'>";
    	
    	show_green_button3( "&nbsp;&nbsp;Sent", 200, "mailboxes.php", "box", "sent" );
    	
    	echo "</td><td width='15%'></td></tr><tr><td width='15%'></td><td width='60%' align='left'>";
    	
    	show_green_button3( "&nbsp;&nbsp;Received", 200, "mailboxes.php", "box", "received" );

    	echo "</td><td width='15%'></td></tr><tr><td width='15%'></td><td width='60%' align='left'>";

    	show_green_button3_bottom( "&nbsp;&nbsp;Remembered", 200, "mailboxes.php", "box", "remembered" );

    	echo "</td><td width='15%'></td></tr></table>";
    }


    function show_mobile_information_buttons()
    {
        echo "<br><br>";
    
        echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-collapse: collapse'>";
    
        echo "<tr>";
    
    	echo "<td width='20%'></td><td width='60%' align='left'>";
    	
    	show_green_button3( "&nbsp;&nbsp;FAQ", 180, "faq.php" );
    	
    	echo "</td><td width='20%'></td></tr><tr><td width='20%'></td><td width='60%' align='left'>";

    	show_green_button3( "&nbsp;&nbsp;Costs", 180, "charges.php" );

    	echo "</td><td width='20%'></td></tr><tr><td width='20%'></td><td width='60%' align='left'>";
    
    	show_green_button3( "&nbsp;&nbsp;Policies", 180, "policies.php" );
    	
    	echo "</td><td width='20%'></td></tr><tr><td width='20%'></td><td width='60%' align='left'>";

    	show_green_button3( "&nbsp;&nbsp;About Us", 180, "about_us.php" );

    	echo "</td><td width='20%'></td></tr><tr><td width='20%'></td><td width='60%' align='left'>";

    	show_green_button3_bottom( "&nbsp;&nbsp;Contact Us", 180, "contact_us.php" );

    	echo "</td><td width='20%'></td></tr></table>";
    }


    function show_mobile_other_buttons()
    {
        echo "<br><br>";
    
        echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-collapse: collapse'>";
    
        echo "<tr>";
    
    	echo "<td width='15%'></td><td width='60%' align='left'>";

//    	show_green_button3( "&nbsp;&nbsp;Buy Credits", 200, "buy_credits.php" );
//
//    	echo "</td><td width='15%'></td></tr><tr><td width='15%'></td><td width='60%' align='left'>";
    	
    	show_green_button3( "&nbsp;&nbsp;Login", 200, "main_menu_login.php" );
    	
    	echo "</td><td width='15%'></td></tr><tr><td width='15%'></td><td width='60%' align='left'>";
    	
    	show_green_button3_bottom( "&nbsp;&nbsp;Logout", 200, "session_kill.php" );

    	echo "</td><td width='15%'></td></tr></table>";
    }


        // tab style buttons for mobile screen buttons
        
    function show_green_button3( $text, $size, $page="", $param1="", $value1="", $param2="", $value2="", $param3="", $value3="", $param4="", $value4="", $param5="", $value5=""  )
	{
		$url = url_encode( $page, $param1, $value1, $param2, $value2, $param3, $value3, $param4, $value4, $param5, $value5 );

		echo "<div onclick=\"window.location.href='".$url."'\" class='greenbuttonmobile3' style='line-height: 50px; width:100%; align:'left' >".$text."</div> ";			
	}


        // different style to main menu tabs
        
    function show_green_button3_bottom( $text, $size, $page="", $param1="", $value1="", $param2="", $value2="", $param3="", $value3="", $param4="", $value4="", $param5="", $value5=""  )
	{
		$url = url_encode( $page, $param1, $value1, $param2, $value2, $param3, $value3, $param4, $value4, $param5, $value5 );

		echo "<div onclick=\"window.location.href='".$url."'\" class='greenbuttonmobile3_bottom' style='line-height: 50px; width:100%; align:'left' >".$text."</div> ";			
	}

?>

