<?php
/**************************************************************************/
/* Module Gbook MX v2.0 Copyright (c) 2004 by Víctor Simental             */
/* $Revision 30/01/2004 - $Id javascript.php - v4.2.3    EPX $            */ 
/* @URI: http://www.phpwebmasters.com                                     */ 
/* ============================================                           */
/* Based in Gbook MX v4.1.0 Copyright (c) 2003 by                         */
/* Víctor Simental - http://gbookmx.sourceforge.net                       */
/* ============================================                           */
/* GbookMX is Based in the Gbook v1.0 for PHP Nuke Copyright (c) 2003 by  */
/* http://www.PHP-Mania.com.ar                                            */
/* Programed and Design By Víctor Simental and German Cúevas              */
/* vicmx@phpwebmasters.com                                                */
/*                                                                        */
/* 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.         */
/**************************************************************************/

if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {   
 die ("You can't access this file directly...");
}

if($pais_field == 1){
    $showcountry = "<script language=\"JavaScript1.2\" type=\"text/javascript\">\n";
    $showcountry .= "function showcountry(){\n";
    $showcountry.="document.images.paises.src=\"modules/$module_name/images/flags/\"+document.book.bandera.options[document.book.bandera.selectedIndex].value;\n";
    $showcountry .= "}\n";
    $showcountry .= "</script>\n\n";
	}

    $bbcodescript ="<SCRIPT type=\"text/javascript\">\n\n<!--\n";
    $bbcodescript .="function fun () {\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="function DoSmilie(addSmilie) {\n";
    $bbcodescript .="\n";
    $bbcodescript .="var addSmilie;\n";
    $bbcodescript .="var revisedMessage;\n";
    $bbcodescript .="var currentMessage = document.book.firma.value;\n";
    $bbcodescript .="revisedMessage = currentMessage+addSmilie;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="function DoPrompt(action) {\n";
    $bbcodescript .="var revisedMessage;\n";
    $bbcodescript .="var currentMessage = document.book.firma.value;\n";
    $bbcodescript .="\n";
    $bbcodescript .="if (action == \"url\") {\n";
    $bbcodescript .="var thisURL = prompt(\""._ENTERURL."\", \"http://\");\n";
    $bbcodescript .="var thisTitle = prompt(\""._ENTERURLTITLE."\", \""._PAGETITLE."\");\n";
    $bbcodescript .="var urlBBCode = \"[URL=\"+thisURL+\"]\"+thisTitle+\"[/URL]\";\n";
    $bbcodescript .="revisedMessage = currentMessage+urlBBCode;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="if (action == \"email\") {\n";
    $bbcodescript .="var thisEmail = prompt(\""._ENTEREMAIL."\", \"\");\n";
    $bbcodescript .="var emailBBCode = \"[EMAIL]\"+thisEmail+\"[/EMAIL]\";\n";
    $bbcodescript .="revisedMessage = currentMessage+emailBBCode;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="if (action == \"bold\") {\n";
    $bbcodescript .="var thisBold = prompt(\""._ENTERBOLD."\", \"\");\n";
    $bbcodescript .="var boldBBCode = \"[B]\"+thisBold+\"[/B]\";\n";
    $bbcodescript .="revisedMessage = currentMessage+boldBBCode;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="if (action == \"italic\") {\n";
    $bbcodescript .="var thisItal = prompt(\""._ENTERITALIC."\", \"\");\n";
    $bbcodescript .="var italBBCode = \"[I]\"+thisItal+\"[/I]\";\n";
    $bbcodescript .="revisedMessage = currentMessage+italBBCode;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="if (action == \"strike\") {\n";
    $bbcodescript .="var thisStri = prompt(\""._ENTERSTRIKE."\", \"\");\n";
    $bbcodescript .="var striBBCode = \"[STRIKE]\"+thisStri+\"[/STRIKE]\";\n";
    $bbcodescript .="revisedMessage = currentMessage+striBBCode;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="if (action == \"underline\") {\n";
    $bbcodescript .="var thisUnder = prompt(\""._ENTERUNDERLINE."\", \"\");\n";
    $bbcodescript .="var underBBCode = \"[U]\"+thisUnder+\"[/U]\";\n";
    $bbcodescript .="revisedMessage = currentMessage+underBBCode;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="if (action == \"image\") {\n";
    $bbcodescript .="var thisImage = prompt(\""._ENTERIMAGE."\", \"http://\");\n";
    $bbcodescript .="var imageBBCode = \"[IMG]\"+thisImage+\"[/IMG]\";\n";
    $bbcodescript .="revisedMessage = currentMessage+imageBBCode;\n";
    $bbcodescript .="document.book.firma.value=revisedMessage;\n";
    $bbcodescript .="document.book.firma.focus();\n";
    $bbcodescript .="return;\n";
    $bbcodescript .="}\n";
    $bbcodescript .="\n";
    $bbcodescript .="\n";
    $bbcodescript .="}\n";
    $bbcodescript .="//-->\n</SCRIPT>\n";
    


    $validate = "<script language='JavaScript'>\n";
    $validate .= "<!--\n";
    $validate .= "function validarform() {\n";
    $validate .= "\tvar Valida = 0;\n";
    $validate .= "\tif (document.book.firma.value == '') { Valida = 1; }\n";
    $validate .= "\tif (document.book.nombre.value == '') { Valida = 1; }\n";
    $validate .= "\tif (Valida == 1) {\n";
    $validate .= "\t\talert(\""._SCRIPTALERT."\");\n";
    $validate .= "\t\treturn false;\n";
    $validate .= "\t} else\n";
    $validate .= "\t\tdocument.book.submit.disabled = true;\n"; 
    $validate .= "\t\tdocument.book.preview.disabled = true;\n";
    $validate .= "\t\tdocument.book.reset.disabled = true;\n";
    $validate .= "\t\treturn true;\n";
    $validate .= "\t}\n";
    $validate .= "\n";
    $validate .= "//-->\n";
    $validate .= "</script>\n"; 

    $valida = "<script language='JavaScript'>\n";
    $valida .= "<!--\n";
    $valida .= "function validarform2() {\n";
    $valida .= "document.book.submit.disabled = true;\n";
    $valida .= "document.book.back.disabled = true;\n";
    $valida .= "return true;\n";
    $valida .= "\t}\n";
    $valida .= "\n";
    $valida .= "//-->\n";
    $valida .= "</script>\n"; 

	$lisbbcode="<A href=\"javascript: fun()\" onClick=\"DoPrompt('url');\"><IMG src=\"modules/$module_name/images/bbcode/url.gif\" border=\"0\" alt=\""._BBCODEWEBADDRESS."\"></A>\n";
	$lisbbcode.="<A href=\"javascript: fun()\" onClick=\"DoPrompt('email');\"><IMG src=\"modules/$module_name/images/bbcode/emailb.gif\" border=\"0\" alt=\""._BBCODEEMAILADDRESS."\"></A>\n";
	$lisbbcode.="<A href=\"javascript: fun()\" onClick=\"DoPrompt('image');\"><IMG src=\"modules/$module_name/images/bbcode/image.gif\" border=\"0\" alt=\""._BBCODEIMAGE."\"></A>\n";
	$lisbbcode.="<A href=\"javascript: fun()\" onClick=\"DoPrompt('bold');\"><IMG src=\"modules/$module_name/images/bbcode/bold.gif\" border=\"0\" alt=\""._BBCODEBOLD."\"></A>\n";
	$lisbbcode.="<A href=\"javascript: fun()\" onClick=\"DoPrompt('italic');\"><IMG src=\"modules/$module_name/images/bbcode/italic.gif\" border=\"0\" alt=\""._BBCODEITALIC."\"></A>\n";
	$lisbbcode.="<A href=\"javascript: fun()\" onClick=\"DoPrompt('strike');\"><IMG src=\"modules/$module_name/images/bbcode/strike.gif\" border=\"0\" alt=\""._BBCODESTRIKE."\"></A>\n";
	$lisbbcode.="<A href=\"javascript: fun()\" onClick=\"DoPrompt('underline');\"><IMG src=\"modules/$module_name/images/bbcode/underline.gif\" border=\"0\" alt=\""._BBCODEUNDERLINE."\"></A>\n";
	
	$lissmilies="<table border=\"0\"><tr><td><A href=\"javascript: fun()\" onClick=\"DoSmilie(' :-) ');\"><IMG src=\"modules/$module_name/images/smilies/sm1.gif\" border=\"0\" alt=\":-)\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :( ');\"><IMG src=\"modules/$module_name/images/smilies/sm2.gif\" border=\"0\" alt=\":(\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :D ');\"><IMG src=\"modules/$module_name/images/smilies/sm4.gif\" border=\"0\" alt=\":D\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' ;-) ');\"><IMG src=\"modules/$module_name/images/smilies/sm3.gif\" border=\"0\" alt=\";-)\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :confused: ');\"><IMG src=\"modules/$module_name/images/smilies/sm10.gif\" border=\"0\" alt=\":confused:\" ></A></td></tr>\n";
	
	$lissmilies.="<tr><td><A href=\"javascript: fun()\" onClick=\"DoSmilie(' :cool: ');\"><IMG src=\"modules/$module_name/images/smilies/sm6.gif\" border=\"0\" alt=\":cool:\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :d: ');\"><IMG src=\"modules/$module_name/images/smilies/sm20.gif\" border=\"0\" alt=\":d:\"></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :mmm: ');\"><IMG src=\"modules/$module_name/images/smilies/sm19.gif\" border=\"0\" alt=\":mmm:\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :??: ');\"><IMG src=\"modules/$module_name/images/smilies/sm30.gif\" border=\"0\" alt=\":??:\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :invisible: ');\"><IMG src=\"modules/$module_name/images/smilies/sm24.gif\" border=\"0\" alt=\":invisible:\" ></A></td></tr>\n";
	
	$lissmilies.="<tr><td><A href=\"javascript: fun()\" onClick=\"DoSmilie(' :sleepy: ');\"><IMG src=\"modules/$module_name/images/smilies/sm8.gif\" border=\"0\" alt=\":sleepy:\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :-o ');\"><IMG src=\"modules/$module_name/images/smilies/sm9.gif\" border=\"0\" alt=\":-o\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :ghost: ');\"><IMG src=\"modules/$module_name/images/smilies/sm41.gif\" border=\"0\" alt=\":ghost:\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :smooker: ');\"><IMG src=\"modules/$module_name/images/smilies/sm42.gif\" border=\"0\" alt=\":smooker:\" ></A></td><td>\n";
	$lissmilies.="<A href=\"javascript: fun()\" onClick=\"DoSmilie(' :globo: ');\"><IMG src=\"modules/$module_name/images/smilies/sm35.gif\" border=\"0\" alt=\":globo:\" ></A></td></tr>\n";
	$lissmilies.="</table><center><a href=\"javascript:void(window.open('modules.php?name=$module_name&amp;op=Showsmilies','3','width=250,height=350,toolbar=no, scrollbars=yes, esizable=no, statusbar=no'))\">"._LIST."</a>\n";


?>