<?php
/**
 * $Source: /home/cvs/nukescripts/kernel/javascript.php,v $
 * $Revision: 1.1.0a $
 * $Author: cyril $
 * $Date: 2006/06/19 21:03:12 $
 *
 */
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* 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.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
defined('MAXIMUS') or die ('Access denied javascript MAXIMUS directly...');
##################################################
# Include for some common javascripts functions  #
##################################################
global $sentineladmin, $module, $name, $wysiwyg;
if($sentineladmin > 0) {
if (defined('ADMIN_MAX')) {
  echo   "<script type=\"text/javascript\" src=\"includes/overlib.js\"><!-- overLIB
        (c) Erik Bosrup --></script>\n"
	."<script type=\"text/javascript\" src=\"includes/overlib_hideform.js\"><!--
        overLIB (c) Erik Bosrup --></script>\n";
}
}

if (defined('ADMIN_ALLOW') AND defined('ADMIN_MAX') AND ( $wysiwyg == 'tiny') AND !defined('NO_EDITOR')) {
    include_once(INCLUDE_PATH.'kernel/fly/tiny1.php');
} elseif (defined('ADMIN_ALLOW') AND ( $wysiwyg == 'tiny') AND ($name != "Private_Messages") AND ($name != "Forums") AND !defined('NO_EDITOR')) {
    include_once(INCLUDE_PATH.'kernel/fly/tiny2.php');
} elseif ( ($name != "Private_Messages") AND ($name != "Forums") AND ( $wysiwyg == 'tiny') AND !defined('NO_EDITOR')) {
    include_once(INCLUDE_PATH.'kernel/fly/tiny3.php');
}

if ($userpage == 1) {
    echo "<script type=\"text/javascript\">\n"
	."<!--\n"
	."function showimage() {\n"
	."if (!document.images)\n"
	."return\n"
	."document.images.avatar.src=\n"
	."'$nukeurl/modules/Forums/images/avatars/gallery/' + document.Register.user_avatar.options[document.Register.user_avatar.selectedIndex].value\n"
	."}\n"
	."//-->\n"
	."</script>\n\n";
}

if ((defined('MODULE_FILE') AND file_exists("modules/$name/copyright.php")) AND !defined('HOME_FILE')) {
    echo "<script type=\"text/javascript\">\n"
	."<!--\n"
	."function openwindow(){\n"
	."	window.open (\"modules/$name/copyright.php\",\"Copyright\",\"toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=200\");\n"
	."}\n"
	."//-->\n"
	."</script>\n\n";
}