A
amli lola
Hello anyone,
this is my first encouter with javascript so please help (sorry for my bad
english, it's been a long time since high school)
i have this javascript code, and desperately trieing to write a javascript
function that will make my life much easier, the code goes like this, and I
need a javascript function so I don't have to copy/paste all the time...
Thnx..
function rezervirano()
{
// 1. condition
if(sjedala_selektirana[1])
document.A01.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[1])
{
document.A01.src ="stolica_proz_zel2.png";
}
else
document.A01.src ="stolica_proz_crv2.png";
// 2. condition
if(sjedala_selektirana[2])
document.A02.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[2])
document.A02.src ="stolica_proz_zel2.png";
else
document.A02.src ="stolica_proz_crv2.png";
// 3. condition
if(sjedala_selektirana[3])
document.A03.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[3])
document.A03.src ="stolica_proz_zel2.png";
else
document.A03.src ="stolica_proz_crv2.png";
// 4. condition
if(sjedala_selektirana[4])
document.A04.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[4])
document.A04.src ="stolica_proz_zel2.png";
else
document.A04.src ="stolica_proz_crv2.png";
// 5. condition
if(sjedala_selektirana[5])
document.A05.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[5])
document.A05.src ="stolica_proz_zel2.png";
else
document.A05.src ="stolica_proz_crv2.png";
// 6. condition
if(sjedala_selektirana[6])
document.A06.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[6])
document.A06.src ="stolica_proz_zel2.png";
else
document.A06.src ="stolica_proz_crv2.png";
// 7. condition
if(sjedala_selektirana[7])
document.A07.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[7])
document.A07.src ="stolica_proz_zel2.png";
else
document.A07.src ="stolica_proz_crv2.png";
// 8. condition
if(sjedala_selektirana[8])
document.A08.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[8])
document.A08.src ="stolica_proz_zel2.png";
else
document.A08.src ="stolica_proz_crv2.png";
// 9. condition
if(sjedala_selektirana[9])
document.A09.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[9])
document.A09.src ="stolica_proz_zel2.png";
else
document.A09.src ="stolica_proz_crv2.png";
// 10. condition
if(sjedala_selektirana[10])
document.A010.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[10])
document.A010.src ="stolica_proz_zel2.png";
else
document.A010.src ="stolica_proz_crv2.png";
// 11. condition
if(sjedala_selektirana[11])
document.A011.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[11])
document.A011.src ="stolica_proz_zel2.png";
else
document.A011.src ="stolica_proz_crv2.png";
} // function end
Thank you again...
this is my first encouter with javascript so please help (sorry for my bad
english, it's been a long time since high school)
i have this javascript code, and desperately trieing to write a javascript
function that will make my life much easier, the code goes like this, and I
need a javascript function so I don't have to copy/paste all the time...
Thnx..
function rezervirano()
{
// 1. condition
if(sjedala_selektirana[1])
document.A01.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[1])
{
document.A01.src ="stolica_proz_zel2.png";
}
else
document.A01.src ="stolica_proz_crv2.png";
// 2. condition
if(sjedala_selektirana[2])
document.A02.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[2])
document.A02.src ="stolica_proz_zel2.png";
else
document.A02.src ="stolica_proz_crv2.png";
// 3. condition
if(sjedala_selektirana[3])
document.A03.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[3])
document.A03.src ="stolica_proz_zel2.png";
else
document.A03.src ="stolica_proz_crv2.png";
// 4. condition
if(sjedala_selektirana[4])
document.A04.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[4])
document.A04.src ="stolica_proz_zel2.png";
else
document.A04.src ="stolica_proz_crv2.png";
// 5. condition
if(sjedala_selektirana[5])
document.A05.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[5])
document.A05.src ="stolica_proz_zel2.png";
else
document.A05.src ="stolica_proz_crv2.png";
// 6. condition
if(sjedala_selektirana[6])
document.A06.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[6])
document.A06.src ="stolica_proz_zel2.png";
else
document.A06.src ="stolica_proz_crv2.png";
// 7. condition
if(sjedala_selektirana[7])
document.A07.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[7])
document.A07.src ="stolica_proz_zel2.png";
else
document.A07.src ="stolica_proz_crv2.png";
// 8. condition
if(sjedala_selektirana[8])
document.A08.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[8])
document.A08.src ="stolica_proz_zel2.png";
else
document.A08.src ="stolica_proz_crv2.png";
// 9. condition
if(sjedala_selektirana[9])
document.A09.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[9])
document.A09.src ="stolica_proz_zel2.png";
else
document.A09.src ="stolica_proz_crv2.png";
// 10. condition
if(sjedala_selektirana[10])
document.A010.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[10])
document.A010.src ="stolica_proz_zel2.png";
else
document.A010.src ="stolica_proz_crv2.png";
// 11. condition
if(sjedala_selektirana[11])
document.A011.src ="stolica_proz_zut2.png";
else if(sjedala_slobodna[11])
document.A011.src ="stolica_proz_zel2.png";
else
document.A011.src ="stolica_proz_crv2.png";
} // function end
Thank you again...