<?php
/***************************************************************************
 *   Copyright (C) 2008 by oscim   Project lossim                          *
 *   a@oscim.fr                                                            *
 *       [created : 15.03.2008, 14:15:50] @oscim                           *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
 	session_start();
	require("../include/lib_ext.php");
	require("include/lib/lib.general.php");
	var_config_cst($LIB,'');
	NewFct('verif_session');
	include("include/lib/lib.theme.php");
	require("include/block/admin_header.php");
	## linguistique generaux
	$reponse=@include_once("include/language/".$_user_perso_['pref_language'].".php");
	if (!$reponse) require ("./include/language/english.php");
	## linguistique de la page appelé.
	$reponse=@include_once("include/language/".$_user_perso_['pref_language']."/xmedia.php");
	if (!$reponse) include_once ("./include/language/english/xmedia.php");
	include_once (_BO_CLASS.'class.lum.php');
	include_once (CHEMIN_ABS.CHEMIN_DU_SITE.'lib_partage/lib.image.php');
	include_once ('include/lib/lib.xmedia.php');

	if (!isset($_POST['nav'])) $_POST['nav']='xmedia_light';
	if (!isset($_GET['nav'])) $_GET['nav']=$_POST['nav'];
	$destination_form='xmedia_full.php';

	?>
	<style  type="text/css">
		@import url(<?php echo URL_DU_SITE."admin/template/".TEMPLATE_ADMIN."/base_compl.css" ?>);
		@import url(<?php echo URL_DU_SITE."admin/template/".TEMPLATE_ADMIN."/css_content/xmedia.css" ?>);


		* {
			font-size:90%;
		}
		html,body{
			background: #c5c0bd;
		}
	</style>
	<script src="<?php print URL_DU_SITE ?>ext/prototype/prototype.js" type="text/javascript"></script>
	<script src="include/js/application.js" type="text/javascript"></script>
	<script language="JavaScript" type="text/javascript">
		var qsParm = new Array();
		/* ---------------------------------------------------------------------- *\
		  Function    : retrieveWYSIWYG()
		  Description : Retrieves the textarea ID for which the image will be inserted into.
		\* ---------------------------------------------------------------------- */
		function retrieveWYSIWYG() {
		  var query = window.location.search.substring(1);
		  var parms = query.split('&');
		  for (var i=0; i<parms.length; i++) {
		    var pos = parms[i].indexOf('=');
		    if (pos > 0) {
		       var key = parms[i].substring(0,pos);
		       var val = parms[i].substring(pos+1);
		       qsParm[key] = val;
		    }
		  }
		}
		/* ---------------------------------------------------------------------- *\
		  Function    : insertImage()
		  Description : Inserts image into the WYSIWYG.
		\* ---------------------------------------------------------------------- */
		function insertImage() {
		  var image = '<img src="<?php print URL_DU_SITE.REP_IMG ?>' + document.getElementById('imageurl').value + '" alt="' + document.getElementById('alt').value + '" alignment="' + document.getElementById('alignment').value + '" border="' + document.getElementById('borderThickness').value + '" hspace="' + document.getElementById('horizontal').value + '" vspace="' + document.getElementById('vertical').value + '"></img>';
		//   window.opener.insertHTML(image, qsParm['wysiwyg']);
		  window.parent.insertHTML(image, qsParm['wysiwyg']);
		}

	</script>
	<?php print_top();?>
	<?php nav_pop_xmedia($_GET['nav']); ?>
	<?php include('content/'.$_GET['nav'].'.php'); ?>

		<div id="bulle"></div> <!--TOOLIP-->
	<div id="retour_ajax" style="display:none;">
		<p id='retour_ajax_txt'></p>
		<p id='retour_ajax_nav'></p>
		<p id='retour_ajax_help'>Cliquez dessus pour fermer</p>
	</div> <!-- RETOUR AJAX -->
	<script src="include/js/application.js" type="text/javascript"></script>
	<script type='text/javascript'>
	<?php  // appel dyn des lib js
	       if(isset($js_lib)) while ($funct_lib = each($js_lib))
		      		include('include/js/'.$funct_lib['value'].'.js'); ?>
		function control_presence_menu(){
		}
		function init(){
			montre();
			// gestion retour ajax
			var div= document.getElementById('retour_ajax');
			div.onclick = function(){  cache('retour_ajax'); cache('backgd'); };
		<?php ## chargement de function specifique a la page
		      if(isset($function_js_init)) while ($funct_js = each($function_js_init))
		      		print $funct_js['value']."\r";
		?>
		}
		window.onload=init;
	</script>