Problem with bit of JavaScript that DreamWeaver is writing

I'm having a problem with the code that DreamWeaver (CS3) is written. I'm fairly certain that the problem is in a small piece of JavaScript code that is compose of DreamWeaver.

It is a pretty complex problem, so patient with me.

First of all - what I'm trying to move: when a page on my site (the - oilman.com), I want a link that opens a new window in the store online at another site (AMSOIL.com). I need to leave the page on my site open and open this page "keep". Firstly that it works fine, using the 'open window' 'behaviour' in DreamWeaver. If someone wants to change windows (or tabs) and return to my page, also - leaving the window 'save' the problem is set up to occur. If back on my site, you click this account or a different link that goes back to the 'Bank' on the same page or on another page to AMSOIL.com - the "Save" window goes to the correct page, but "store" window does NOT come up on top. When they click on a link to return to the 'Bank' I need 'store' window to get to the top. If they have previously put something in the basket and come back and add something to the cart in the "store" coming from various links on my site that the 'Bank' works correctly because I leave it open all the time.

snipets of code that DreamWeaver wrote for my site (the - oilman.com):
head:
< script >
<!--
CSAct [/ * CMP * / '129AABC1'] = new Array (CSOpenWindow, / * URL * / ' http://www.amsoil.com/redirect.cgi?zo=52257 & page = store ', 'store', 0, 0, true, true, true, true, EU tr, true, true);
CSAct [/ * CMP * / '129AAC63'] = new Array (CSOpenWindow, / * URL * / ' http://www.amsoil.com/redirect.cgi?zo=52257 & page = store ', 'store', 0, 0, true, true, true, true, EU tr, true, true);
CSAct [/ * CMP * / '10D39F40'] = new Array (CSOpenWindow, / * URL * / ' http://www.amsoil.com/redirect.cgi?zo=52257 & page = storefront/sso ', 'store', 0, 0, true, true, tru e, true, true, true, true);
/
function MM_openBrWindow (theURL, winName, features) {//v2.0
Window.Open (Theurl, winName, Features);
}
->
< /script >

Code 2 different links using this script:
"" "< a href =" http://www.amsoil.com/redirect.cgi?zo=52257 & page = storefront/sso " target ="store"onClick =" MM_openBrWindow (' #', 'Bank', "") "" csclick = "10D39F40" > buy now < /a >
"" < a href = " http://www.amsoil.com/redirect.cgi?zo=52257 & page = store" title = "AMSOIL Store to AMSOIL.com" target = "store" onClick = "MM_openBrWindow ('http:www.amsoil.com/redirect.cgi?zo=52257 & amp;)" "" page = store', ' stor-e ",""")"" > on line store < /a >

I think what I need is a javascript longer. Instead of just "window.open" I need an 'if', but my knowledge of javascript is very, very limited.
I need to check if the window called 'keep' is open then 'focus', or if it is not open to open the window named "keep".
This will fix my problem? If so, please help me to write lines of code to do.
If this isn't the solution, what is the problem and the solution?

A separate but related matter: If you look at different links in the two codes, in calling one of them uses a page reference "null" and another repeat the full link of the href = attribute reference. Both seem to work, but which is the right or the preferred syntax. My guess is that there are some browsers this will give a problem, but where is the favorite.

Don Dawson
mailto:[email protected]

Thanks for the replies. I solved the problem. Because of a storm called Fay who dumped 20 "of rain here - power came out internet for days, road cut in 3 places to get out of the House - it is low priority for a week.

Yes, I have quoted wrong snipets that had some left over code Go-Live, but it was not causing my problem. I had worked in the from pages before Go-Live and new pages in DreamWeaver that all did the same thing.
The small piece of script that DW wrote that left me the problem:


function MM_openBrWindow (theURL, winName, features) {//v2.0
Window.Open (Theurl, winName, Features);
}
//-->

The necessary patch adding a line to the function (and I don't know there are a number of other ways to do it too, but this one seems the most simple):

function MM_openBrWindow (theURL, winName, features) {//v2.0
Focus on the shop window
toTheStore = window.open (theURL, winName, features);
toTheStore.focus ();
}

'Design' DW CS3 mode itself left me short. After setting up with the "Design", I have to go to the 'Code' and correct.

Thanks again to all who watched and considered my problem.

Tags: Dreamweaver

Similar Questions

Maybe you are looking for