Help needed

Can someone help me with a simple JS code, since I am new with it, but I need it for my website. There is incompatibility with this two lines

<a href=“en.htm” onclick=“return hs.htmlExpand(this, { objectType: ‘ajax’} )”>
<a href=“img/02.jpg” class=“highslide” onclick=“return hs.expand(this)”>

First one is used for pop-up window when someone press an icon for changing language on the website, second one is in other part of the html code and it is used for the gallery. If I remove the first line, the second works perfectly.
Thanks in advance
PS: I can post the entire code if needed

All <a> tags need to be closed, so just based on the HTML you posted, I imagine that the top one is being left open, the browser thinks that the second one is a child of the first, and that messes with the JS. But that’s a wild guess. If you link to a live example, I could investigate a little more thoroughly. (And if you were feeling particularly awesome, you could link to a version that has the first line, and then another version that doesn’t, so that we could compare.)

Give few minutes to make the links and upload them, it’s not the <a> tag, cause it’s closed on proper place. The code works fine on the other pages, but on this one there is js gallery and that’s why it has problem, something with the java that I use for the gallery is messing up.

Ok, here is the link: http://www.eccofarm.com/js
So, on the first page, I’ve put the js code for the flags of English language and Greek language. So far so good, works fine.
On page Галерия(Gallery, the one before the last in the menu) I’ve tried to do the same for the English language button. So I just copied the code, that works fine on the first page. And it’s not working fine;

<a href=“indexEN.html”> <a href=“en.htm” onclick=“return hs.htmlExpand(this, { objectType: ‘ajax’} )”>
<img style=“position: absolute; top:5px; left: 1190px;” title=“English” src=“images/flags/en.png”></a></a>

It’s like the browser doesn’t read this code: <a href=“en.htm” onclick=“return hs.htmlExpand(this, { objectType: ‘ajax’} )”>
It’s just redirecting me to page indexEN.html(it should show as pop-up)
Any idea?

Also, I have made bad positioning for the flags, don’t pay much attention, will fixed it later.

Okay, I think I figured it out.

The “htmlExpand” method is only created in the “highslide-with-html.js” file. However, all of your code in “highslide-with-html.js” is wrapped in a giant if block:


if (!hs) {
    // create the object and all of its methods,
    // including htmlExpand
}

But on your gallery page, the “highslide-with-gallery.js” script runs first. It creates an “hs” object, so none of the code in “highslide-with-html.js” gets executed.

The quickest fix would be to add another if in your “highslide-with-html.js” script:


if (!hs) {
    // create the entire object

} else if (!hs.htmlExpand) {
    // the object exists, but not the method you want
    // so just create the method
}

However, you’d probably be better served in the long term by refactoring all of your scripts. I imagine that if one method got left out, others did as well. Who knows how many bugs you’d have to keep chasing down…

Thank you very much dude.
This pop-up windows will stay until i translate the pages in the different languages. May be you can advice me to use something else to show a warning message, which will not be in conflict with the JS Gallery?

Never mind, I figured it out with new JS code. Will posted later if someone wants to take a look.
Greetings and thank you very much.

www.eccofarm.com