<?php

function display_page($e_message,$type) {
    global $Sess_UserId;
    global $Sess_UserType;
    global $Sess_Userlevel;
    global $SITE_ROOT;
    global $SITE_WWW_ROOT;
    global $CONST_IMAGE_LANG;
	global $CONST_TABLE_WIDTH;
	global $CONST_TABLE_CELLSPACING;
	global $CONST_TABLE_CELLPADDING;
	global $link;
	global $TEMPLATE_AFFILIATES;
	global $TEMPLATE_CONTACT;
	global $TEMPLATE_PRIVACY;
	global $TEMPLATE_DISCLAIMER;
	global $TEMPLATE_ABOUTUS;
	global $TEMPLATE_HOME;
	global $TEMPLATE_LOGOUT;
	global $TEMPLATE_SHOPPING;
	global $TEMPLATE_MAILBOX;
	global $TEMPLATE_PROFILE;
	global $TEMPLATE_HOTLIST;
	global $TEMPLATE_INFO;
	global $TEMPLATE_REG3;
	global $TEMPLATE_LOG3;
	global $TEMPLATE_LOST2;
	global $TEMPLATE_SEARCH2;
	global $CONST_LANG_CHARSET;
	
	# retrieve the template
	$query="SELECT * FROM templates WHERE tpl_description='Member Area'";
	$retval=mysql_query($query) or die(mysql_error());
	$template = mysql_fetch_object($retval);
	$sess_id="PHPSESSID=".session_id(); if (get_magic_quotes_gpc()==0) $template->tpl_header=addslashes($template->tpl_header); eval("\$template->tpl_header=\"$template->tpl_header\";"); print(stripslashes($template->tpl_header));
	print ("<table width='$CONST_TABLE_WIDTH' border='0' cellspacing='$CONST_TABLE_CELLSPACING' cellpadding='$CONST_TABLE_CELLPADDING'>
  <tr> 
    <td class='pageheader'>$type</td>
  </tr>
  <tr> 
    <td><b>$e_message</b></td>
  </tr>
</table>");
	if (get_magic_quotes_gpc()==0) $template->tpl_footer=addslashes($template->tpl_footer); eval("\$template->tpl_footer=\"$template->tpl_footer\";"); print(stripslashes($template->tpl_footer));
	exit;
}

function restrict_demo()
{
	global $DEMO;
	if($DEMO)
	{
		echo "<script>alert('This feature is restricted in Demo, Hit Back button to proceed')</script>";
		echo "<script>window.location='history.go(-2)'</script>";
		unset($_REQUEST);
	//echo "<A HREF='javascript:history.go(-2)'>Go Back</A>";
		//display_page(GENERAL_DEMO_RESTRICTION_ERROR_DESCRIPTION,GENERAL_DEMO_RESTRICTION_ERROR);
		die;
	}
}
?>