[greenstone-users] I can't insert a script of java script

From Israel Abraham Flores Cruz
DateMon Jan 14 20:57:37 2008
Subject [greenstone-users] I can't insert a script of java script
Hi !

I've been trying to insert a script of javascript to obtain a _imagecollection_ that can changes when the mainpage of Greenstone load completly , If I use it within a ordinary html page it works fine, but within Greenstone it doesn't change , the script is this:
<html> <head> <title>Java Script simple Code</title> </head> <body onload = "animate()"> <img src="_httpimg_/gsdlhead.jpg" id="anim"> <script languague="JavaScript" type="text/javascript"> <!--//Begin var counter = 0;

function animate() { var img = document.getElementById("anim"); // Proceed to the next image counter ++; // There are only four images, so restart when we're done if (counter > 3) counter = 0; if (counter == 0) { // Display the first image img.src = "_httpimg_/gsdlhead.jpg"; } else if (counter == 1) { // Display the second image img.src = "_httpimg_/foto_02.jpg"; } else if (counter == 2) { // Display the third image img.src = "_httpimg_/foto_03.jpg"; } else { // Display the fourth image img.src = "_httpimg_/foto_04.jpg"; } // We need to call the animate function again in 0.10 seconds // Pause for 1 second between the fourth and first image if (counter == 3) { setTimeout("animate()", 2000); } else { setTimeout("animate()", 200); } }
// End --></script> </body> </html>


Everything works fine, but in Greenstone the script is ignored, I inserted in the _pagescriptextra_ macro in the style.dm macro package, but its 'doesn't work.
I put everything whithout the <html></html>, I put it too in the macro home.dm
======================================================================================================================
# this file must be UTF-8 encoded
package home
# set the title of the home page to be "greenstone digital library"# in the currently chosen language
_pagetitle_ {_textdescrgreenstone_}
######################################################################## global navigation links#######################################################################
# overridden here as we don't want 'home' links on this page
# home:helplink and home:preflink set in nav_css/ns4 macro files_globallinks_ {_helplink_ _preflink_}
######################################################################## icons#######################################################################
_iconmusiclibrary_ {<img src="_httpicontmusic_" border="1" alt="meldex music library" title="meldex music library">}
_imagecollection_ {<body onload = "animate()">
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><img src="_httpimg_/gsdlhead.jpg" id="anim" alt="Centro de Documentaci&oacute;n Institucional" align="middle" width="780" height="108" border="0" usemap="#Map" /><map name="Map" id="Map"><area shape="rect" coords="7,8,146,105" href="http://cdivirtual.salud.gob.mx" target="_blank" alt="cdi" /><area shape="rect" coords="661,14,761,89" href="http://portal.salud.gob.mx" target="_blank" alt="Secretaria de Salud"/></map></td> </tr></table><br><br></body>}
######################################################################## http macros ## These contain the url without any quotes#######################################################################
_httppagegsdl_ {_httppagex_(gsdl)}_httppagehomepref_ {_httppagex_(homepref)}
######################################################################## images#######################################################################
# Buttons for the pane after the collections and before the text
_button_ {<div class="button"><span class="button"><a href="_1_">_2_</a></span></div>}
_imagegli_ {_button_(_httppagegli_,_gli:textgli_)}
_imagecollector_ {_button_(_httppagecollector_,_collector:textcollector_)}
_imagedepositor_ {_button_(_httppagedepositor_,_depositor:textdepositor_)}
_imagetranslator_ {_button_(_httppagetranslator_,_gti:textgti_)}
_imageadmin_ {_button_(_httppagestatus_,_home:textadmin_)}
_imagegogreenstone_ {_button_(_home:httppagegsdl_,_home:textabgs_)}
_imagegodocs_ {_button_(_home:httppagedocs_,_home:textgsdocs_)}
######################################################################## page content #######################################################################
# _homeextra_ is the automatically generated list of collections (in a table)########AQUI YO COMENTE LO SIGUIENTE QUE ES DONDE SE ENCUENTRA LO DE LA INTRODUCCION A LA BIBLIOTECA DE GREENSTONE#_content_ {#<div id="content">#<div class="divbar">#<p class="navbar">#_textdescrselcol_#</p>#</div>
#<div class="section">#_homeextra_#</div>
#<div class="divbar">&nbsp;</div>
#<div class="section">#<table>#_textgogli_#_textgocollector_#_textgodepositor_#_textgotranslator_#_textgoadmin_#_textgogreenstone_#_textgodocs_
#</table>#</div>
#<div class="divbar">&nbsp;</div>
#<div class="section">#_textaboutgreenstone_#</div>
#<div class="divbar">&nbsp;</div>
#</div>#}#### AQUI TERMINA EL COMENTARIO Y SE SUSTITUYE POR LO DE AQUI ABAJO ESTO LO TOMA COMO HTML CASI PURO_content_ {<div id="content"><div class="divbar"><p class="navbar">_textdescrselcol_</p></div>
<div class="section">_homeextra_</div>
<div class="divbar">&nbsp;</div><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><div class="section"><table><p style="font-size:12px; font-family:arial,helvetica,sans-serif" > ****** todo el texto que se quiera</table></div>
<div class="divbar">&nbsp;</div>
<div class="section">_textaboutgreenstone_</div>
<div class="divbar">&nbsp;</div>
</div>}####HASTA AQUI FUE LO QUE SE CAMBIO# the _textgocollector_, _textgotranslator_, and _textgoadmin_ macros # may be overridden to be empty from within the receptionist if the # collector, translator, or admin facilities are disabled
_textgogli_ {<tr valign=top><td valign=top>_imagegli_</td><td>_gli:textdescrgli_</td></tr>}
_textgocollector_ {<tr valign=top><td valign=top>_imagecollector_</td><td>_collector:textdescrcollector_</td></tr>}
_textgodepositor_ {<tr valign=top><td valign=top>_imagedepositor_</td><td>_depositor:textdescrdepositor_</td></tr>}
_textgotranslator_ {<tr valign=top><td valign=top>_imagetranslator_</td><td>_gti:textdescrtranslator_</td></tr>}
_textgoadmin_ {<tr valign=top><td valign=top>_imageadmin_</td><td>_textdescradmin_</td></tr>}
#_textgogreenstone_ {#<tr valign=top>#<td valign=top>_imagegogreenstone_</td>#<td>_textdescrgogreenstone_</td>#</tr>}
_textgodocs_ {<tr valign=top><td valign=top>_imagegodocs_</td><td>_textdescrgodocs_</td></tr>}
package homepref_pagetitle_ {_preferences:textpreferences_ - _textdescrgreenstone_}
_imagecollection_ {<body onload = "animate()">
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><img src="_httpimg_/gsdlhead.jpg" id="anim" alt="Centro de Documentaci&oacute;n Institucional" align="middle" width="780" height="108" border="0" usemap="#Map" /><map name="Map" id="Map"><area shape="rect" coords="7,8,146,105" href="http://cdivirtual.salud.gob.mx" target="_blank" alt="cdi" /><area shape="rect" coords="661,14,761,89" href="http://portal.salud.gob.mx" target="_blank" alt="Secretaria de Salud"/></map></td> </tr></table><br><br></body>} _globallinks_ {_homelink_ _helplink_}
_pagescriptextra_ { function animate() { var img = document.getElementById("anim"); // Proceed to the next image counter ++; // There are only four images, so restart when we're done if (counter > 3) counter = 0; if (counter == 0) { // Display the first image img.src = "_httpimg_/gsdlhead.jpg"; } else if (counter == 1) { // Display the second image img.src = "_httpimg_/foto_02.jpg"; } else if (counter == 2) { // Display the third image img.src = "_httpimg_/foto_03.jpg"; } else { // Display the fourth image img.src = "_httpimg_/foto_04.jpg"; } // We need to call the animate function again in 0.10 seconds // Pause for 1 second between the fourth and first image if (counter == 3) { setTimeout("animate()", 2000); } else { setTimeout("animate()", 200); } }}
_content_ {<div id="content">
<div class="divbar">&nbsp;</div>
<div class="section"><form name="PrefForm" method="get" action="_gwcgi_"><h3>_preferences:textpresentationprefs_</h3>
<table border="0"><tr valign="top"><td>_preferences:textlanguage_</td><td>_languageoption_</td></tr><tr valign="top"><td>_preferences:textencoding_</td><td>_encodingoption_</td></tr><tr valign="top">_preferences:formatoption_</tr></table></div>
<div class="divbar">&nbsp;</div>
</div> <!-- \_homepref:content\_ -->}
=====================================================================================================================

where can I put the script code to use it? what have I done wrong? Please help me, thank yall and grettings.

_________________________________________________________________
Dos categor□as, incre□bles premios, un ganador. □Quieres ser t□?
http://cine.prodigymsn.com/nanometraje
------------ pr□xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: https://list.scms.waikato.ac.nz/mailman/private/greenstone-users/attachments/20080114/7d5166ed/attachment-0001.html