<?php

/***************************************************************************

 toggleWYSIWYGVersion.php
 -------------------------
 copyright : (C) 2002-2003 The ezContents Development Team

 ***************************************************************************/

/***************************************************************************
 The ezContents Development Team offers no warranties on this script.
 The owner/licensee of the script is solely responsible for any problems
 caused by installation of the script or use of the script.

 All copyright notices regarding ezContents must remain intact on the
 scripts and in the HTML for the scripts.

 For more info on ezContents,
 visit http://www.ezcontents.org/

/***************************************************************************

/***************************************************************************
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the License which can be found within the
 *	zipped package.
 *
 ***************************************************************************/

include_once ("rootdatapath.php");
require_once ($GLOBALS["rootdp"]."include/config.php");
require_once ($GLOBALS["rootdp"]."include/db.php");
require_once ($GLOBALS["rootdp"]."include/session.php");
include ($GLOBALS["rootdp"]."include/functions.php");

$WYSIWYG_Version = '';
if ($EZ_SESSION_VARS["WYSIWYG"] == 'Y') {
	if ($EZ_SESSION_VARS["WYSIWYG_Version"] != '') { $WYSIWYG_Version = $EZ_SESSION_VARS["WYSIWYG_Version"];
	} else { if ($GLOBALS["WYSIWYG_Version"] != '') { $WYSIWYG_Version = $GLOBALS["WYSIWYG_Version"]; }	
	}

	switch ($WYSIWYG_Version) {
		case '2'		  : $WYSIWYG_Version = '2 Modified';
							break;
		case '2 Modified' : if ($EZ_SESSION_VARS["Browser"] == 'Microsoft Internet Explorer') {
								$WYSIWYG_Version = '2';
							} else { $WYSIWYG_Version = '3 Beta'; }
							break;
		case '3 Beta'	  : if ($EZ_SESSION_VARS["Browser"] == 'Microsoft Internet Explorer') {
								$WYSIWYG_Version = '2';
							} else { $WYSIWYG_Version = '3 Modified'; }
							break;
		case '3 Modified' : if ($EZ_SESSION_VARS["Browser"] == 'Microsoft Internet Explorer') {
								$WYSIWYG_Version = '2';
							} else { $WYSIWYG_Version = '3 Beta'; }
							break;
		default			  : if ($EZ_SESSION_VARS["Browser"] == 'Microsoft Internet Explorer') {
								$WYSIWYG_Version = '2';
							} else { $WYSIWYG_Version = '3 Beta'; }
							break;
	}

	$EZ_SESSION_VARS["WYSIWYG_Version"] = $WYSIWYG_Version;
	db_session_write();
}

Header("Location: ".BuildLink('menu.php')."&activegroup=".$HTTP_GET_VARS["activegroup"]);

?>
