Flash scripts? What do these do?

There’s a web page being redone from flash to HTML. I don’t know what these do. Can someone give me some clarification and tell me what code I can safely remove that isn’t necessary?

<?php  ob_start();
session_start();
include('config.php');
require_once(CLASSES . 'FwConnection.php');
require_once(FUNCTIONS . 'functions.php');
require_once(CLASSES . 'image.class.php');
require_once(CLASSES . 'my_pagina_class.php');
$DbConnection = new FwConnection(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
if(!isset($_COOKIE["flashCheck"])){
setcookie("flashCheck", "1", time()+36000);
}
if(basename($_SERVER['SCRIPT_NAME'])!='search.php')
{
	unset($_SESSION['keywords']);
}


define("ADMINEMAIL",adminEmail());

$preloaded=0;
if(isset($_SESSION['preloaded']) && $_SESSION['preloaded']!="")
{
	$preloaded = $_SESSION['preloaded'];
}

?>
<?php 
//session_distroy();
/*echo "<pre>";
print_r($_SESSION);
echo "</pre>";*/
//session_destroy();
/*if(isset($_REQUEST['flashsite']) && $_REQUEST['flashsite']!=""){
$_SESSION['flashok']="ok";

}
if(isset($_REQUEST['nonflashsite']) && $_REQUEST['nonflashsite']!=""){
$_SESSION['flashok']="ok";
$_SESSION['noflash']="yes";
header("Location:allproducts.php");
}
if($_SESSION['flashok']==""){
?>
<div id="main">
<div >
<a href="index.php"><img src="<?php echo SITE_HOST; ?>images/logo.jpg" alt="logo"  border='0'/></a><br />
	<div style="margin:200px;font-weight:bold">
<h2>Select the version of the site .</h2>
<br/>
<form name="flash" action="" method="post">
<input type="submit" name="flashsite" value="Flash site" style="padding:10px">
<input type="submit" name="nonflashsite" value="Non Flash site" style="padding:10px">
</form>
</div>
</div>
<?php
}
else {*/

unset($_SESSION['nonflash']);

if(isset($_SESSION['nonflash']) && $_SESSION['nonflash']=="ok")
{
$menuItems = array("allproducts.php","","category.php?cid=1","category.php?cid=8","category.php?cid=3","category.php?cid=4","category.php?cid=5","category.php?cid=6","category.php?cid=7");

}
else
{
$menuItems = array("flash.php","allproducts.php","category.php?cid=1","category.php?cid=8","category.php?cid=3","category.php?cid=4","category.php?cid=5","category.php?cid=6","category.php?cid=7");
}





$cnt = count($menuItems)-1;

?>

Thank you.

This is really a php question, it is nothing to do with actionscript.