473,378 Members | 1,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

I need help, I can not see my problem.

Hi all; I have the following files; index.html, sigsheader.js,
sigsboby.js, smilesbody.js and smiles.js. The sourse is below.

The page displays two manual slide shows... Each slideshow has a set
of buttons. the top slideshow (the smiles work fine. How ever the sigs
slideshow displays the pictures in the smiles section.
*************** index.html *****************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Bow's and foggy's stored grahics</title>
<SCRIPT src="smilesheader.js"></SCRIPT>
<SCRIPT src="sigsheader.js"></SCRIPT>
</head>
<body
background="http://home.insightbb.com/clipart/backgrounds/bkgnd019.gif"
bgcolor="#ffffff" link="#0000ff" text="#000000" vlink="#ff0000">
<center>
<h1>Bow's and foggy's stored grahics</h1>
<h2 style="color: rgb(255, 0, 0);" color="red">Team Special
Forces</h2>
<table>
<tr>
<tb>

</tb>
<tb>
<SCRIPT src="smilesbody.js"></SCRIPT>
</tb>
</tr>
<tr>
<tb>
<SCRIPT src="sigsbody.js"></SCRIPT>
</tb>
</tr>
</table>
</center>
</body>
</html>
******************* smilesheader.js *******************************
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("smilesImages=new Array()");
document.writeln("smilesImages[0]=\"smiles/007.gif\"");
document.writeln("smilesImages[1]=\"smiles/1luvu.gif\"");
document.writeln("smilesImages[2]=\"smiles/1zhelp.gif\"");
document.writeln("smilesImages[3]=\"smiles/22_yikes.gif\"");
document.writeln("smilesImages[4]=\"smiles/2evil.gif\"");
document.writeln("smilesImages[5]=\"smiles/test.jpg\"");
document.writeln("smilesImages[6]=\"smiles/2twocents.gif\"");
document.writeln("smilesImages[7]=\"smiles/321.gif\"");
document.writeln("smilesImages[8]=\"smiles/ak47.gif\"");
document.writeln("smilesImages[9]=\"smiles/ald.gif\"");
document.writeln("smilesImages[10]=\"smiles/alien.gif\"");
document.writeln("smilesImages[11]=\"smiles/angry.gif\"");
document.writeln("smilesImages[12]=\"smiles/arsch.gif\"");
document.writeln("smilesImages[13]=\"smiles/asdf.gif\"");
document.writeln("smilesImages[14]=\"smiles/aufreg.gif\"");
document.writeln("smilesImages[15]=\"smiles/aus.gif\"");
document.writeln("smilesImages[16]=\"smiles/axt.gif\"");
document.writeln("smilesImages[17]=\"smiles/a_plain.gif\"");
document.writeln("smilesImages[18]=\"smiles/bad.gif\"");
document.writeln("smilesImages[19]=\"smiles/badassleft.gif\"");
document.writeln("smilesImages[20]=\"smiles/badassright.gif\"");
document.writeln("smilesImages[21]=\"smiles/badsmile.gif\"");
document.writeln("smilesImages[22]=\"smiles/bananasmile.gif\"");
document.writeln("smilesImages[23]=\"smiles/bananawalk.gif\"");
document.writeln("smilesImages[24]=\"smiles/batman.gif\"");
document.writeln("smilesImages[25]=\"smiles/bazooka.gif\"");
document.writeln("smilesImages[26]=\"smiles/behead.gif\"");
document.writeln("smilesImages[27]=\"smiles/bekloppt.gif\"");
document.writeln("smilesImages[28]=\"smiles/bier.gif\"");
document.writeln("smilesImages[29]=\"smiles/bigthumb.gif\"");
document.writeln("smilesImages[30]=\"smiles/bigun2.gif\"");
document.writeln("smilesImages[31]=\"smiles/birthday.gif\"");
document.writeln("smilesImages[32]=\"smiles/blaah.gif\"");
document.writeln("smilesImages[33]=\"smiles/blbl.gif\"");
document.writeln("smilesImages[34]=\"smiles/blover.gif\"");
document.writeln("smilesImages[35]=\"smiles/bong.gif\"");
document.writeln("smilesImages[36]=\"smiles/bounce.gif\"");
document.writeln("smilesImages[37]=\"smiles/bricks1.gif\"");
document.writeln("smilesImages[38]=\"smiles/bs.gif\"");
document.writeln("smilesImages[39]=\"smiles/bunny.gif\"");
document.writeln("smilesImages[40]=\"smiles/byewhore.gif\"");
document.writeln("smilesImages[41]=\"smiles/casanova.gif\"");
document.writeln("smilesImages[42]=\"smiles/charley.gif\"");
document.writeln("smilesImages[43]=\"smiles/cry.gif\"");
document.writeln("smilesImages[44]=\"smiles/cussing.gif\"");
document.writeln("smilesImages[45]=\"smiles/drink.gif\"");
document.writeln("smilesImages[46]=\"smiles/dunno.gif\"");
document.writeln("smilesImages[47]=\"smiles/eek3.gif\"");
document.writeln("smilesImages[48]=\"smiles/eek7.gif\"");
document.writeln("smilesImages[49]=\"smiles/enforcer.gif\"");
document.writeln("smilesImages[50]=\"smiles/engel.gif\"");
document.writeln("smilesImages[51]=\"smiles/freak3.gif\"");
document.writeln("smilesImages[52]=\"smiles/girl.gif\"");
document.writeln("smilesImages[53]=\"smiles/grasseater.gif\"");
document.writeln("smilesImages[54]=\"smiles/grenade.gif\"");
document.writeln("smilesImages[55]=\"smiles/hammer.gif\"");
document.writeln("smilesImages[56]=\"smiles/headshake2.gif\"");
document.writeln("smilesImages[57]=\"smiles/laser_shot_jump.gif\"");
document.writeln("smilesImages[58]=\"smiles/microwave.gif\"");
document.writeln("smilesImages[59]=\"smiles/newbie.gif\"");
document.writeln("smilesImages[60]=\"smiles/nono.gif\"");
document.writeln("smilesImages[61]=\"smiles/nuts.gif\"");
document.writeln("smilesImages[62]=\"smiles/partyman.gif\"");
document.writeln("smilesImages[63]=\"smiles/remybussi.gif\"");
document.writeln("smilesImages[64]=\"smiles/robot2.gif\"");
document.writeln("smilesImages[65]=\"smiles/samurai.gif\"");
document.writeln("smilesImages[66]=\"smiles/scratch.gif\"");
document.writeln("smilesImages[67]=\"smiles/screwy.gif\"");
document.writeln("smilesImages[68]=\"smiles/sheep.gif\"");
document.writeln("smilesImages[69]=\"smiles/shoot.gif\"");
document.writeln("smilesImages[70]=\"smiles/silly.gif\"");
document.writeln("smilesImages[71]=\"smiles/sleeping.gif\"");
document.writeln("smilesImages[72]=\"smiles/southpark.gif\"");
document.writeln("smilesImages[73]=\"smiles/spam4.gif\"");
document.writeln("smilesImages[74]=\"smiles/sword.gif\"");
document.writeln("smilesImages[75]=\"smiles/taz.gif\"");
document.writeln("smilesImages[76]=\"smiles/twak.gif\"");
document.writeln("");
document.writeln("");
document.writeln("smilescounter=smilesImages.lengt h-1");
document.writeln("smilesi=0");
document.writeln("");
document.writeln("");
document.writeln("function smilesfirst()");
document.writeln("{");
document.writeln("");
document.writeln("document.getElementById(\'imagev iewer\').src=smilesImages[0]");
document.writeln("smilesi=0");
document.writeln("}");
document.writeln("");
document.writeln("function smilesprevious()");
document.writeln("{");
document.writeln("if (smilesi>0)");
document.writeln(" {");
document.writeln(" smilesi--");
document.writeln("
document.getElementById(\'imageviewer\').src=smile sImages[smilesi]");
document.writeln(" }");
document.writeln("}");
document.writeln("");
document.writeln("function smilesnext()");
document.writeln("{");
document.writeln("if (smilesi<smilescounter)");
document.writeln(" {");
document.writeln(" smilesi++");
document.writeln("
document.getElementById(\'imageviewer\').src=smile sImages[smilesi]");
document.writeln(" }");
document.writeln("}");
document.writeln("");
document.writeln("function smileslast()");
document.writeln("{");
document.writeln("document.getElementById(\'imagev iewer\').src=smilesImages[smilescounter]");
document.writeln("}");
document.writeln("<\/script>");
******************** sigsheader.js **************************
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("sigsImages=new Array()");
document.writeln("");
document.writeln("sigsImages[0]=\"sigs/finished1.jpg\"");
document.writeln("sigsImages[1]=\"sigs/foghorn.jpg\"");
document.writeln("sigsImages[2]=\"sigs/motto.jpg\"");
document.writeln("sigsImages[3]=\"sigs/sig.jpg\"");
document.writeln("sigsImages[4]=\"sigs/SWAT.jpg\"");
document.writeln("");
document.writeln("sigscounter=sigsImages.length-1");
document.writeln("sigsi=0");
document.writeln("");
document.writeln("");
document.writeln("function sigsfirst()");
document.writeln("{");
document.writeln("");
document.writeln("document.getElementById(\'imagev iewer\').src=sigsImages[0]");
document.writeln("sigsi=0");
document.writeln("}");
document.writeln("");
document.writeln("function sigsprevious()");
document.writeln("{");
document.writeln("if (sigsi>0)");
document.writeln(" {");
document.writeln(" sigsi--");
document.writeln("
document.getElementById(\'imageviewer\').src=sigsI mages[sigsi]");
document.writeln(" }");
document.writeln("}");
document.writeln("");
document.writeln("function sigsnext()");
document.writeln("{");
document.writeln("if (sigsi<sigscounter)");
document.writeln(" {");
document.writeln(" sigsi++");
document.writeln("
document.getElementById(\'imageviewer\').src=sigsI mages[sigsi]");
document.writeln(" }");
document.writeln("}");
document.writeln("");
document.writeln("function sigslast()");
document.writeln("{");
document.writeln("document.getElementById(\'imagev iewer\').src=sigsImages[sigscounter]");
document.writeln("}");
document.writeln("<\/script>");
**************** smilesbody.js *****************************
document.writeln("<center>");
document.writeln("<h1>smiles<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"smilesfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"smilesprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"smilesnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"smileslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\">");
document.writeln("<img id=\"imageviewer\"
src=\"smiles/sword.gif\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"smilesfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"smilesprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"smilesnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"smileslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you have a smilely<\/p>");
document.writeln("<\/center>");

***************************** sigsbody.js ****************************
document.writeln("<center>");
document.writeln("<h1>signatures<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"sigsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\" onclick=\"sigsprevious()\"
type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"sigsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"sigslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\">");
document.writeln("sigs must be within 400 X 150 pixels");
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<tr>");
document.writeln("<td align=\"center\">");
document.writeln("<img id=\"imageviewer\"
src=\"sigs/sig.jpg\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<tr>");
document.writeln("<td align=\"center\">");
document.writeln("sigs must be within 400 X 150 pixels");
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"sigsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\" onclick=\"sigsprevious()\"
type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"sigsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"sigslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you need a place to store your [SF]
sig<\/p>");
document.writeln("<\/center>");
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Jul 23 '05 #1
7 1606
David. E. Goble <de*****@gtech.computing> wrote in message
news:87********************************@4ax.com...
Hi all; I have the following files; index.html, sigsheader.js,
sigsboby.js, smilesbody.js and smiles.js. The sourse is below.

The page displays two manual slide shows... Each slideshow has a set
of buttons. the top slideshow (the smiles work fine. How ever the sigs
slideshow displays the pictures in the smiles section.


You appear to have two image placeholders both with the id: "imageviewer"
Rename the second one, along with all references to it.
--
S.C.
http://makeashorterlink.com/?H3E82245A

Jul 23 '05 #2
Never mind I found the problem
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Jul 23 '05 #3
Arrrh! some buttons work while others don't, but I can't see why. I
have tried comparing the files that do work, with the ones that don't.
But to no help.

The funny thing is the parts that work have the same code, except
different variables.

(Note Javascript and htm code was writen by a c program, the code then
run thru a html to js converter)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Bow's and foggy's stored grahics</title>
<SCRIPT src="avatarsheader.js"></SCRIPT>
<SCRIPT src="smilesheader.js"></SCRIPT>
<SCRIPT src="sigsheader.js"></SCRIPT>
</head>
<body
background="http://home.insightbb.com/clipart/backgrounds/bkgnd019.gif"
bgcolor="#ffffff" link="#0000ff" text="#000000" vlink="#ff0000">
<h1 align="center">Bow's and foggy's stored grahics</h1>
<h2 align="center" style="color: rgb(255, 0, 0);" color="red">Team
Special Forces</h2>
<table border="1" align="center">
<tr>
<td>
<SCRIPT src="avatarsbody.js"></SCRIPT>
</tb>
<td>
<SCRIPT src="smilesbody.js"></SCRIPT>
</tb>
<td>
<SCRIPT src="sigsbody.js"></SCRIPT>
</tb>
</tr>
</tr>
<td colspan="3" align="center">
Then email it to us at <a
href="mailto:Bo*******@insightbb.com">Bo*******@in sightbb.com</a></p>
</td>
</tr>
</table>
</body>
</html>

//Generated By Easy HTML To Any Script Converter
document.writeln("<center>");
document.writeln("<h1>sigs<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"sigsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\" onclick=\"sigsprevious()\"
type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"sigsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"sigslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\"><img id=\"sigsviewer\"
src=\"sigs/motto.jpg\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"sigsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\" onclick=\"sigsprevious()\"
type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"sigsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"sigslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you have a smilely<\/p>");
document.writeln("<\/center>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("sigsImages=new Array()");
document.writeln("");
document.writeln("sigsImages[0]=\"sigs/finished1.jpg\"");
document.writeln("sigsImages[1]=\"sigs/foghorn.jpg\"");
document.writeln("sigsImages[2]=\"sigs/motto.jpg\"");
document.writeln("sigsImages[3]=\"sigs/sig.jpg\"");
document.writeln("sigsImages[4]=\"sigs/SWAT.jpg\"");
document.writeln("sigsImages[5]=\"sigs/title.gif\"");
document.writeln("");
document.writeln("sigscounter=sigsImages.length-1");
document.writeln("sigsi=0");
document.writeln("");
document.writeln("function sigsfirst()");
document.writeln("{");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[0]");
document.writeln("sigsi=0");
document.writeln("}");
document.writeln("");
document.writeln("function sigsprevious()");
document.writeln("{");
document.writeln("if (sigsi>0)");
document.writeln("{");
document.writeln("sigsi++");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[sigsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function sigsnext()");
document.writeln("{");
document.writeln("if (sigsi>sigscounter)");
document.writeln("{");
document.writeln("sigsi--");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[sigsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function sigslast()");
document.writeln("{");
document.writeln("document.getElementById(\'sigsvi ewer\').src=sigsImages[sigscounter]");
document.writeln("}");
document.writeln("");
document.writeln("<\/script>");//Generated By Easy HTML To Any Script
Converter
document.writeln("<center>");
document.writeln("<h1>avatars<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"avatarsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"avatarsprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"avatarsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"avatarslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\"><img id=\"avatarsviewer\"
src=\"avatars/soscom.gif\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"avatarsfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"avatarsprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"avatarsnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"avatarslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you have a smilely<\/p>");
document.writeln("<\/center>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("avatarsImages=new Array()");
document.writeln("");
document.writeln("avatarsImages[0]=\"avatars/160thsoar.gif\"");
document.writeln("avatarsImages[1]=\"avatars/75thrgrrgt.gif\"");
document.writeln("avatarsImages[2]=\"avatars/avatart-head_banger.gif\"");
document.writeln("avatarsImages[3]=\"avatars/soscom.gif\"");
document.writeln("avatarsImages[4]=\"avatars/syndrome.gif\"");
document.writeln("avatarsImages[5]=\"avatars/usacapoc.gif\"");
document.writeln("avatarsImages[6]=\"avatars/usajfkswcs.gif\"");
document.writeln("avatarsImages[7]=\"avatars/usasfc.gif\"");
document.writeln("avatarsImages[8]=\"avatars/usasoc.gif\"");
document.writeln("");
document.writeln("avatarscounter=avatarsImages.len gth-1");
document.writeln("avatarsi=0");
document.writeln("");
document.writeln("function avatarsfirst()");
document.writeln("{");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[0]");
document.writeln("avatarsi=0");
document.writeln("}");
document.writeln("");
document.writeln("function avatarsprevious()");
document.writeln("{");
document.writeln("if (avatarsi>0)");
document.writeln("{");
document.writeln("avatarsi--");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[avatarsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function avatarsnext()");
document.writeln("{");
document.writeln("if (avatarsi<avatarscounter)");
document.writeln("{");
document.writeln("avatarsi++");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[avatarsi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function avatarslast()");
document.writeln("{");
document.writeln("document.getElementById(\'avatar sviewer\').src=avatarsImages[avatarscounter]");
document.writeln("}");
document.writeln("");
document.writeln("<\/script>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<center>");
document.writeln("<h1>smiles<\/h1>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"smilesfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"smilesprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"smilesnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"smileslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<table border=\"1\">");
document.writeln("<tr>");
document.writeln("<td align=\"center\"><img id=\"smilesviewer\"
src=\"smiles/alien.gif\"><\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<p><\/p>");
document.writeln("<form>");
document.writeln("<input value=\"First\" onclick=\"smilesfirst()\"
type=\"button\">");
document.writeln("<input value=\"Previous\"
onclick=\"smilesprevious()\" type=\"button\">");
document.writeln("<input value=\"Next\" onclick=\"smilesnext()\"
type=\"button\">");
document.writeln("<input value=\"Last\" onclick=\"smileslast()\"
type=\"button\">");
document.writeln("<\/form>");
document.writeln("<p><\/p>");
document.writeln("<p>If you have a smilely<\/p>");
document.writeln("<\/center>");
//Generated By Easy HTML To Any Script Converter
document.writeln("<script type=\"text/javascript\">");
document.writeln("");
document.writeln("smilesImages=new Array()");
document.writeln("");
document.writeln("smilesImages[0]=\"smiles/007.gif\"");
document.writeln("smilesImages[1]=\"smiles/1luvu.gif\"");
document.writeln("smilesImages[2]=\"smiles/1zhelp.gif\"");
document.writeln("smilesImages[3]=\"smiles/22_yikes.gif\"");
document.writeln("smilesImages[4]=\"smiles/2evil.gif\"");
document.writeln("smilesImages[5]=\"smiles/test.jpg\"");
document.writeln("smilesImages[6]=\"smiles/2twocents.gif\"");
document.writeln("smilesImages[7]=\"smiles/321.gif\"");
document.writeln("smilesImages[8]=\"smiles/ak47.gif\"");
document.writeln("smilesImages[9]=\"smiles/ald.gif\"");
document.writeln("smilesImages[10]=\"smiles/alien.gif\"");
document.writeln("smilesImages[11]=\"smiles/angry.gif\"");
document.writeln("smilesImages[12]=\"smiles/arsch.gif\"");
document.writeln("smilesImages[13]=\"smiles/asdf.gif\"");
document.writeln("smilesImages[14]=\"smiles/aufreg.gif\"");
document.writeln("smilesImages[15]=\"smiles/aus.gif\"");
document.writeln("smilesImages[16]=\"smiles/axt.gif\"");
document.writeln("smilesImages[17]=\"smiles/a_plain.gif\"");
document.writeln("smilesImages[18]=\"smiles/bad.gif\"");
document.writeln("smilesImages[19]=\"smiles/badassleft.gif\"");
document.writeln("smilesImages[20]=\"smiles/badassright.gif\"");
document.writeln("smilesImages[21]=\"smiles/badsmile.gif\"");
document.writeln("smilesImages[22]=\"smiles/bananasmile.gif\"");
document.writeln("smilesImages[23]=\"smiles/bananawalk.gif\"");
document.writeln("smilesImages[24]=\"smiles/batman.gif\"");
document.writeln("smilesImages[25]=\"smiles/bazooka.gif\"");
document.writeln("smilesImages[26]=\"smiles/behead.gif\"");
document.writeln("smilesImages[27]=\"smiles/bekloppt.gif\"");
document.writeln("smilesImages[28]=\"smiles/bier.gif\"");
document.writeln("smilesImages[29]=\"smiles/bigthumb.gif\"");
document.writeln("smilesImages[30]=\"smiles/bigun2.gif\"");
document.writeln("smilesImages[31]=\"smiles/birthday.gif\"");
document.writeln("smilesImages[32]=\"smiles/blaah.gif\"");
document.writeln("smilesImages[33]=\"smiles/blbl.gif\"");
document.writeln("smilesImages[34]=\"smiles/blover.gif\"");
document.writeln("smilesImages[35]=\"smiles/bong.gif\"");
document.writeln("smilesImages[36]=\"smiles/bounce.gif\"");
document.writeln("smilesImages[37]=\"smiles/bricks1.gif\"");
document.writeln("smilesImages[38]=\"smiles/bs.gif\"");
document.writeln("smilesImages[39]=\"smiles/bunny.gif\"");
document.writeln("smilesImages[40]=\"smiles/byewhore.gif\"");
document.writeln("smilesImages[41]=\"smiles/casanova.gif\"");
document.writeln("smilesImages[42]=\"smiles/charley.gif\"");
document.writeln("smilesImages[43]=\"smiles/cry.gif\"");
document.writeln("smilesImages[44]=\"smiles/cussing.gif\"");
document.writeln("smilesImages[45]=\"smiles/drink.gif\"");
document.writeln("smilesImages[46]=\"smiles/dunno.gif\"");
document.writeln("smilesImages[47]=\"smiles/eek3.gif\"");
document.writeln("smilesImages[48]=\"smiles/eek7.gif\"");
document.writeln("smilesImages[49]=\"smiles/enforcer.gif\"");
document.writeln("smilesImages[50]=\"smiles/engel.gif\"");
document.writeln("smilesImages[51]=\"smiles/freak3.gif\"");
document.writeln("smilesImages[52]=\"smiles/girl.gif\"");
document.writeln("smilesImages[53]=\"smiles/grasseater.gif\"");
document.writeln("smilesImages[54]=\"smiles/grenade.gif\"");
document.writeln("smilesImages[55]=\"smiles/hammer.gif\"");
document.writeln("smilesImages[56]=\"smiles/headshake2.gif\"");
document.writeln("smilesImages[57]=\"smiles/laser_shot_jump.gif\"");
document.writeln("smilesImages[58]=\"smiles/microwave.gif\"");
document.writeln("smilesImages[59]=\"smiles/newbie.gif\"");
document.writeln("smilesImages[60]=\"smiles/nono.gif\"");
document.writeln("smilesImages[61]=\"smiles/nuts.gif\"");
document.writeln("smilesImages[62]=\"smiles/partyman.gif\"");
document.writeln("smilesImages[63]=\"smiles/remybussi.gif\"");
document.writeln("smilesImages[64]=\"smiles/robot2.gif\"");
document.writeln("smilesImages[65]=\"smiles/samurai.gif\"");
document.writeln("smilesImages[66]=\"smiles/scratch.gif\"");
document.writeln("smilesImages[67]=\"smiles/screwy.gif\"");
document.writeln("smilesImages[68]=\"smiles/sheep.gif\"");
document.writeln("smilesImages[69]=\"smiles/shoot.gif\"");
document.writeln("smilesImages[70]=\"smiles/silly.gif\"");
document.writeln("smilesImages[71]=\"smiles/sleeping.gif\"");
document.writeln("smilesImages[72]=\"smiles/southpark.gif\"");
document.writeln("smilesImages[73]=\"smiles/spam4.gif\"");
document.writeln("smilesImages[74]=\"smiles/sword.gif\"");
document.writeln("smilesImages[75]=\"smiles/taz.gif\"");
document.writeln("smilesImages[76]=\"smiles/twak.gif\"");
document.writeln("smilesImages[77]=\"smiles/walker.gif\"");
document.writeln("smilesImages[78]=\"smiles/title.gif\"");
document.writeln("");
document.writeln("smilescounter=smilesImages.lengt h-1");
document.writeln("smilesi=0");
document.writeln("");
document.writeln("function smilesfirst()");
document.writeln("{");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[0]");
document.writeln("smilesi=0");
document.writeln("}");
document.writeln("");
document.writeln("function smilesprevious()");
document.writeln("{");
document.writeln("if (smilesi>0)");
document.writeln("{");
document.writeln("smilesi--");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[smilesi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function smilesnext()");
document.writeln("{");
document.writeln("if (smilesi<smilescounter)");
document.writeln("{");
document.writeln("smilesi++");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[smilesi]");
document.writeln("}");
document.writeln("}");
document.writeln("");
document.writeln("function smileslast()");
document.writeln("{");
document.writeln("document.getElementById(\'smiles viewer\').src=smilesImages[smilescounter]");
document.writeln("}");
document.writeln("");
document.writeln("<\/script>");

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define FALSE 0
#define TRUE 1
#define LINESIZE 255

int setupoutfiles(char filename[], FILE **header, FILE **body)
{
char tempstr[LINESIZE]="\0";

strcpy(tempstr, filename);
strcat(filename, "header.htm");
*header=fopen(filename, "w+");
if(!header) return -1;
strcat(tempstr, "body.htm");
*body=fopen(tempstr, "w+");
if(!body) return -1;
return 0;
}

int setupinfile(char filename[], FILE **infile)
{
*infile=fopen(filename, "r+");
if(!infile) return -1;
return 0;
}

void therest(FILE **header, char b[])
{
fprintf(*header, "\n%scounter=%sImages.length-1\n", b, b);
fprintf(*header, "%si=0\n\n", b);
fprintf(*header, "function %sfirst()\n", b);
fprintf(*header, "{\n");
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[0]\n", b, b);
fprintf(*header, "%si=0\n", b);
fprintf(*header, "}\n\n");

fprintf(*header, "function %sprevious()\n", b);
fprintf(*header, "{\n");
fprintf(*header, "if (%si>0)\n", b);
fprintf(*header, "{\n");
fprintf(*header, "%si--\n", b);
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[%si]\n", b, b, b);
fprintf(*header, "}\n");
fprintf(*header, "}\n\n");

fprintf(*header, "function %snext()\n", b);
fprintf(*header, "{\n");
fprintf(*header, "if (%si<%scounter)\n", b);
fprintf(*header, "{\n");
fprintf(*header, "%si++\n", b);
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[%si]\n", b, b, b);
fprintf(*header, "}\n");
fprintf(*header, "}\n\n");

fprintf(*header, "function %slast()\n", b);
fprintf(*header, "{\n");
fprintf(*header,
"document.getElementById(\'%sviewer\').src=%sImage s[%scounter]\n", b,
b, b);
fprintf(*header, "}\n\n");
fprintf(*header, "</script>");
}

int myheader(FILE **infile, FILE **header, char b[], char afile[])
{
char line[LINESIZE]="\0";
char base[LINESIZE]="\0";
int i=0;

strcpy(afile, "\0");
fprintf(*header, "<script type=\"text/javascript\">\n\n");
fprintf(*header, "%sImages=new Array()\n\n", b);
while(fgets(line, LINESIZE, *infile)!=NULL)
{
line[strlen(line)-1] = '\0';
if(strstr(line, ".gif")!=NULL || strstr(line, ".jpg")!=NULL)
{
strcpy(base, b);
strcat(base, "/");
strcat(base, line);
/*if(!rand()%1) strcpy(afile, base);*/
fprintf(*header, "%sImages[%d]=\"%s\"\n", b, i++, base);
}
}
therest(header, b);
return 0;
}

void mybuttons(FILE **body, char b[])
{
fprintf(*body, "<form>\n");
fprintf(*body, "<input value=\"First\" onclick=\"%sfirst()\"
type=\"button\">\n", b);
fprintf(*body, "<input value=\"Previous\"
onclick=\"%sprevious()\" type=\"button\">\n", b);
fprintf(*body, "<input value=\"Next\" onclick=\"%snext()\"
type=\"button\">\n", b);
fprintf(*body, "<input value=\"Last\" onclick=\"%slast()\"
type=\"button\">\n", b);
fprintf(*body, "</form>\n");
}
void mybody(FILE **body, char b[], char afile[])
{
fprintf(*body, "<center>\n");
fprintf(*body, "<h1>%s</h1>\n", b);

mybuttons(body, b);

fprintf(*body, "<table border=\"1\">\n");
fprintf(*body, "<tr>\n");
fprintf(*body, "<td align=\"center\">");
fprintf(*body, "<img id=\"%sviewer\"
src=\"%s/alien.gif\"></td>\n", b, b);
fprintf(*body, "</tr>\n");
fprintf(*body, "</table>\n");
fprintf(*body, "<p></p>\n");

mybuttons(body, b);

fprintf(*body, "<p></p>\n");
fprintf(*body, "<p>If you have a smilely</p>\n");
fprintf(*body, "</center>\n");
}

int main(int argc, char *argv[])
{
FILE *infile, *header, *body;
char outfname[LINESIZE]="\0",
tempstr[LINESIZE]="\0";

if(argc>2)
{
if(setupoutfiles(strcpy(outfname, argv[2]), &header, &body))
{
printf("problem opening outfiles %s\n", outfname);
return -1;
}
if(setupinfile(argv[1], &infile))
{
printf("problem opening infile %s\n", argv[1]);
return -1;
}
}
else
{
printf("mymenu infname [basefolder] -> basefolderheader.htm,
basefolderbody.htm\n");
return -1;
}
strcpy(outfname, argv[2]);
myheader(&infile, &header, outfname, tempstr);
mybody(&body, outfname, tempstr);

fclose(header);
fclose(body);
fclose(infile);
return 0;
}

Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Jul 23 '05 #4
Is there some sort of limitation or something.... Because one second
something will work the next thing its not!
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Jul 23 '05 #5
David. E. Goble <de*****@gtech.computing> writes:
Arrrh! some buttons work while others don't, but I can't see why. I (Note Javascript and htm code was writen by a c program, the code then
run thru a html to js converter)

This is out of the scope here on comp.lang.c. You should redirect
your question to comp.dev.null. They probably are more familiar
with this sort of stuff.


--
/myr

Jul 23 '05 #6
In article <98********************************@4ax.com>,
David. E. Goble <de*****@gtech.computing> wrote:
Arrrh! some buttons work while others don't, but I can't see why. I
have tried comparing the files that do work, with the ones that don't.
But to no help.

The funny thing is the parts that work have the same code, except
different variables.

(Note Javascript and htm code was writen by a c program, the code then
run thru a html to js converter)


Do you have a website one can visit?

Why did you include the C code? In the web browser, you can see the
downloaded code. Look at this and see if the code was generated as you
expect. You can see the result of document.write by entering what
people around hear refer to as a one liner.

The following one-liner when pasted into the command line will
display the generated html. (It looks for line ends which are OS
dependent.):

javascript:'<html><head><title>SourceFileListing<\/title><\/head><body><c
ode><ol><li>'+(document.documentElement||document. body).innerHTML.replace
(/&/g,%22&amp;%22).replace(/</g,%22&lt;%22).replace(/%20%20/g,%22&nbsp;%2
0%22).replace(/\r\n/g,%22<li>%22).replace(/\n/g,%22<li>%22).replace(/\r/g
,%22<li>%22)+'<\/ol><\/code><\/body><\/html>';

I do not see the source to the javascript include files.

You need to narrow the problem down.

Robert
Jul 23 '05 #7
I managed to fix the problem. manually.

Yea I do, its http://home.insightbb.com/~bow.foggy Let me what you
think. Plan on adding buttons to display all smiles/avatars/sigs.

Also plan to fix the automation for maintaining the files...
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: kazack | last post by:
I posted a similiar question in this newsgroup already and got an answer which I already knew but didn't get the answer I was looking for so I am reposting the code and question differently in the...
7
by: Christian Christmann | last post by:
Hi, in the past I always appreciated your help and hope that you also can help me this time. I've spent many many hours but still can't solve the problem by myself and you are my last hope. ...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
2
by: bryan | last post by:
I have a situation that's pretty delicate that I need some help on. I've been stumped for awhile I just need some advice on the best possible solution. The problem: I have a site I'm making...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
8
by: SanjaiGandhi | last post by:
Hi ...i am new to programing....pls help to overcome this program.. The Program is..: if a = 557..using for loop or while or dowhile ..we have to get the answer for 5+5+7..that is what ever...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.