[Javascript] Adding Picture

arb arb at andys-scribblings.co.uk
Mon Sep 24 14:58:41 CDT 2001


My java writing ability amounts to nothing. This script was modified for me by SnarfLT who recommended this list for further modifications. I wish to have a variable sized jpeg or gif displayed, next to the descriptive text, which would be different depending on the site selected. This, as an explanation, will be the company logo. The full page can be seen at http://www.andys-scribblings.co.uk/linkstest.html


<SCRIPT>
<!--
/* */
/* written by "Snarf" (snarflt at aol.com) */
/* */

// Start Links
var link0 = new Array()
link0[0]="-- Select --";
link0[1]="Address will be shown here, click the 'Go' button";
link0[2]="Choose a website from the list on the left, and detailes of the retailer and the wines it sells will be displayed here.\n\nScript written by 'Snarf' (snarflt at aol.com)";
var link1 = new Array()
link1[0]="ChateuOnline";
link1[1]="http://affiliation.chateauonline.com/uk/Tracking/clic.asp?partner=ChateauOnline&p1=N%3Aa%E1&p2=N%3Aca&p3=N7íw/";
link1[2]="A fine selection of wines from the world over. Nicely designed site with plenty of `click` options. Loads of choice from everyday `quaffers` through to choice connoisseur bottles. Lots of pre-mixed cases, well-known producers mixed with choice exclusives. Food matching and cellaring tips complete good tasting notes. The only thing that annoyed me was that most of the wines must be brought in either cases of 3 or 6. But some bottles can be purchased individually.";
var link2 = new Array()
link2[0]="Allez Vins!";
link2[1]="http://www.allezvins.co.uk/";
link2[2]="Interesting and quality wines are the mainstay here. Established in 1987 Allez Vins! specialises in small domaines from the lesser known regions of France. Cahors and Madiran are particularly strong with some lovely wines from Bergerac, Gascony and the Rhone and Loire. The website is brimming with enthusiasm and exudes a passion for the wines. Well worth checking out. No minimum purchase, delivery per order £6.50.";
var link3 = new Array()
link3[0]="WineSmart";
link3[1]="http://www.qksrv.net/click-908807-5341780/";
link3[2]="I have had some great wines from this European based company. They concentrate on New World wines that have little distribution in the UK. But they ship throughout Europe. Quality wines from California, New Zealand, Australia and everywhere else too. There are a smattering of choice wines from Europe as well. The site is very easy to use with plenty of information and choice. No minimum delivery. The postal charge varies depending on country.";
var link4 = new Array()
link4[0]="World Marachel";
link4[1]="http://www.worldmarechal.com/marechal/uk/pub/lien_externe_uk.cfm?choix=boutique/boutique.cfm&affilie=scribblings";
link4[2]="A French based company so obviously concentrating on all things French. There is an added `food` dimension to this site with plenty of tasty treats and specialist foods through to complete dishes to match with the wine offerings. Although strong on France there are a smattering of wines from Australia, Spain, California and elsewhere.";
var link5 = new Array()
link5[0]="number 5";
link5[1]="Address will be shown here, click the 'Go' button";
link5[2]="Choose a website from the list on the left, and detailes of the retailer and the wines it sells will be displayed here.\n\nScript written by 'Snarf' (snarflt at aol.com)";

// define the variable numLinks[0] with the number of links you have above. In this case the last defined link above is link4, so we have 4 links.
// make sure there is the same amount of <OPTION> tags as there are links, each with the numerical value corresponding to the link that will go there
var numLinks=new Array()
numLinks[0]="5"

// Create the Select List
function firstLoad() {
for (i=0;i<=numLinks[0];i++) {
document.links.elements[0].options[i].value=i
document.links.elements[0].options[i].text=eval("link"+ i +"[0]")
}
document.notes.elements[0].value=link0[0]
document.links.elements[1].value=link0[1]
document.links.elements[4].value=link0[2]
}

function changeLink(num) {
if (num <= numLinks[0]) {
document.notes.elements[0].value=eval("link"+ num +"[0]")
document.links.elements[1].value=eval("link"+ num +"[1]")
document.links.elements[4].value=eval("link"+ num +"[2]")
}
}

function goLink(linkAddress,selected) {
if (selected > "0") {
window.open("" + linkAddress + "", "Window", ['width=150,height=200,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1'])
}
}

function tastingNotes(selected) {
if (selected > "0") {
document.notes.submit()
}
}
//-->
</SCRIPT>
<script type="text/javascript" language="JavaScript1.2">
var bookmarkurl="http://www.andys-scribblings.co.uk"
var bookmarktitle="Andy's Scribblings- Weekly drinks newsletter"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
</script>


<FORM name="links">
<TABLE bgcolor="#C8BCA0" width=150 border=2 cellspacing=2 cellborder=2 cellpadding=0>
<TR><TH colspan=2><p class="title">Scribblings Recommended Sites</p></TH></TR>
<TR><TD rowspan=2>
<SELECT size=5 name="list" id="list" onChange="changeLink(this.selectedIndex)">
<!-- the "---------------" on the next line is used to set the width of the select box. if you don't use this, netscape navigator will not show the list box properly, so make sure it is always wide enough for your items to fit -->
<OPTION value=0 selected>-----------------------
<OPTION value=1>
<OPTION value=2>
<OPTION value=3>
<OPTION value=4>
<option value=5>
</SELECT>
</TD><TD>
<INPUT name="addr" type="hidden" size="46">
<CENTER>
<NOBR>
<INPUT type="button" name="Go" value="Go to Site" style="background:#fff8dc" onClick="goLink(document.links.addr.value,document.links.list.selectedIndex)">
<INPUT type="button" name="submit" value="Tasting Notes" style="background:#fff8dc" onClick="tastingNotes(document.links.list.selectedIndex)">
</NOBR>
</CENTER>
</TD></TR><TR><TD>
<TEXTAREA name="desc" cols="39" rows="8" readonly></TEXTAREA>
</FORM>
<center><FORM name="notes" method="get" action="http://search.atomz.com/search/">
<!-- change the sp-q tag to hidden instead of text --> 
<INPUT type="text" name="sp-q" value="--Select--">
<INPUT type="hidden" name="sp-a" value="000130e8-sp00000000">
</FORM></center>
</TD></TR></TABLE>
</CENTER>


Andrew Barrow
Scribblings: weekly wine and drink email newsletter
[w]  : http://www.andys-scribblings.co.uk
[m]  : arb at andys-scribblings.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010924/f6cb64f4/attachment.htm>


More information about the Javascript mailing list