Changing browser windows with window.location in javascript
<p>I have a web site that is in two languages, English and French. now i do not know java-script, I created a code for showing different pictures using javascript depending on which language u want to use. </p>

<p>So if you are on the www.my-site.com/en/ you will see En_pic_ pictures same goes for the opposite.</p>

<pre><code>/*These are the Popup images for the English and French portal */

var url1 = 'http://www.my-site.com/fr/';
var url2 = 'http://www.my-site.com/en/';
MagnifImage.setup(
if (window.location = 'url2'){  
"En_pic_1", "/images/1.png","",
"En_pic_2", "/img/content/tracking_instructions/2.png",  "",
"En_pic_3", "/img/content/tracking_instructions/3.png", "",
"En_pic_4", "/img/content/tracking_instructions/4.png", "",
}else{
"Fr_pic_1", "/img/content/tracking_instructions/1_fr.png", "",
"Fr_pic_2", "/images/mon-compte.png","",
"Fr_pic_3", "/img/content/tracking_instructions/3_fr.png","",
"Fr_pic_4", "/img/content/tracking_instructions/4_fr.png",""
}
);
</code></pre>

<p>Everything works but if I am on the other language page I get an alert box saying there is no Fr_pic_1 or En_pic_1.(depending on the current page I am in) The code I found to accomplish this as follows:</p>

<pre><code>if( !(objRef.trigElem=document.getElementById( idParts[0] )) )
 alert("There is no element with the ID:'"+idParts[0]+"'\n\nCase must match exactly\n\nElements must be located ABOVE the script initialisation.");
else
{
 if(objRef.trigElem.parentNode &amp;&amp; objRef.trigElem.parentNode.tagName=='A')
  objRef.trigElem=objRef.trigElem.parentNode;

 objRef.classId=idParts[1] || "MagnifImage" ;
 objRef.imgObj=new Image();

 objRef.imgObj.imgIndex=i;
 objRef.imgObj.hasLoaded=0;
</code></pre>

<p>its a code I found at <a href="http://scripterlative.com?magnifimage" rel="nofollow">http://scripterlative.com?magnifimage</a></p>

<p>Please help....</p>
