<?php

session_cache_limiter('private, must-revalidate');
session_start();

###################################################################
#####           BEGIN  -  MAIN BLOCK                       ########
###################################################################

# load the general.php file, which will set the includes path and load
# the includes file (which will load all the other needed files)
require_once "general.php";

  //  security checks
  if (!isset($_GET['build-cache'])) {
    if (!isset($_GET['id'])) {  // no user id set
      exit();
    } else {  //  valid to system
      $thisSystem = 'cren';
      /// in:  idx_winr1_0/includes/inc.utility_fns.php
      if (!valid_flexframer($thisSystem, $_GET['id'])) exit();
    }
  }


  //  flex framer cache function
  function load_flexframe_cache($id) {
    $fileName = '../files/flexframe/cren/' . $id . '.html';
    if (is_file($fileName)) {
        ob_start();
        include $fileName;
        $contents = ob_get_contents();
        ob_end_clean();
        return $contents;
    }
    return false;
  }

  //  flex framer cache intercept
  if (!isset($_GET['build-cache'])) {
    if (isset($_GET['mylistings']) && $_GET['mylistings'] == 1) {
      if (isset($_GET['id'])) {
        $ffCache= load_flexframe_cache($_GET['id']);
        if($ffCache != false) { echo $ffCache; exit(); }
      }
    }
  }

/*
	echo "<pre>";
print_r($_SESSION);
echo "</pre>";
*/

$html .= make_idx_page();

# need to see if there's a custom stylesheet for a particular user id
# and if so, use it
if (isset($_GET['id'])) {

	$id = $_GET['id'];

	if (file_exists("styles/" . $id . ".css")) {
		$this_stylesheet = "styles/" . $id . ".css";
	} else {
		//$this_stylesheet = "idx_main.css";
	}

}

###################################################################
######           END  -  MAIN BLOCK                         #######
###################################################################


?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title></title>

<script language='javascript' type='text/javascript'>
function showLarger_slideshow(bigImage){

 window.open('http://idx.flexiss.net/slide.php?curfile='+bigImage,'slideshow','width=700,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,status=no');

}

function childWindow(url){

		newWindow = window.open(url,"honeyChild","height=400,width=550,toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes")
		newWindow.focus();

}

</script>


<link rel="stylesheet" href="<? echo $this_stylesheet; ?>">
<link href="style/style_function.php?load=idx_main.css,lytebox.css,calendar-system.css" type="text/css" rel="stylesheet" />
</head>



<script language="javascript" type="text/javascript"
    src="http://idx.flexiss.net/cren/js/js.php?load=prototype.js,lowpro.js,builder.js,effects.js,dragdrop.js,slider.js,lytebox.js,common.js">
</script>

<body STYLE="text-align: center" CLASS=idxPage>


<?php echo $html; ?>

</body>
</html>
