<?php
//
// Created on: 22 Feb 2001
// Usage     : bssfunc.php?language="eng|gb"&bssid=0&mode=newbss
//
// Function  : Contain the bssstatus.php and bssfuncinfo.php frame
//
// bssfunc.php ___ bssstatus.php   (upper)
//             \__ bssfuncinfo.php (bottom)
//
?>
<?php
include("nocache.inc");
include("bssfunc.inc");
include("header.inc");
if (!isset($language))
    $language="eng";
$parameter="${language}namearray";
?>
<html>
<head>
<title>BSS Status</title>
<SCRIPT Language="javascript" type="text/javascript">
<!--
    var no_of_refresh=0;
    var refresh_bsstree_string="<?=${$parameter}[actioniscompleted]?>";
    function show_status(status,alarm,mode)
    {
        //
        // refresh the bsstree in the left hand side

        if (no_of_refresh <= 0)
        {
            url = parent.contents.location + "";  // force it to string
            if ((pos = url.search("&x=")) != -1)
            {
                parent.contents.location.href = url.substr(0,pos) + "&x=<?=$x?>&y=<?=$y?>";
            }
            else
            {
                parent.contents.location.href = url + "&x=<?=$x?>&y=<?=$y?>";
            }
        }


        if ((typeof(alarm) != "undefined") && (alarm != ""))
        {
       	    window.status=alarm;
            alert(alarm);
       	    window.status="";
        }
        if (typeof(status) != "undefined")
        {
       	    window.status=status;
            if (status == refresh_bsstree_string)
            	no_of_refresh=5;
        }
        if ((typeof(mode) != "undefined") && (mode == "newbss"))
        {
            no_of_refresh=1;
        }

        if (no_of_refresh > 0)
        {
            if (no_of_refresh++ < 10)
            {
                //refresh every 5 seconds and repeat for X times
                timeout_handle = setTimeout(show_status,5000);  // 5 sec
                parent.contents.location.href=parent.contents.location;
            }
            else
            {
                clearTimeout(timeout_handle); 
                timeout_handle = null;
            }
        }
        //else
        //    window.status="";
    }
//-->
</SCRIPT>
</head>
    <frameset rows="71%,*" frameborder=0 framespacing=0 onLoad='show_status("<?=$status?>","<?=$alarm?>","<?=$mode?>")'>
<!--        <frame name=contents framespacing=0 marginwidth=5 marginheight=0 noresize target='upper'
         src='bssstatus.php?language=<?=$language?>&bssid=<?=$bssid?>'>;-->
        <frame name=contents framespacing=0 marginwidth=5 marginheight=0 noresize target='upper'
         src=''>;
        <frame name="bottom" framespacing=0 marginwidth=5 marginheight=0 src="bssfuncinfo.php?language=<?=$language?>&bssid=<?=$bssid?>">
        <noframes>
            <body>
            <p>This page uses frames, but your browser doesn't support them.</p>
            </body>
        </noframes>
    </frameset>
</frameset>
</html>
