JS links and anchors

Here is what I want to do:

have a link with an anchor, if anchor name is “a1” then javascript function pops up window and goes to an anchor in the popped up window doc (say, <a name=“h1”>Topic</a>

If i go to next link and it has anchor named “a2”, then js function runs and pops up window and goes to anchor “h2” in popped up window.

I already know how to pop up a window and all that, I’m just not sure how to access the anchor name from the js function, not sure of the terminology/syntax, etc.

I guess I would do something like:


		if (anchor = "help1"){
			url = "regis_help.htm";
			selectedPrint = window.open(url, 'selectedPrint', winprops);
			selectedPrint.focus();

  		}else if (anchor = "help2"){
			url = "regis_help.htm";
			selectedPrint = window.open(url, 'selectedPrint', winprops);
			selectedPrint.focus();

//etcetera..........

“winprops” is defined already in my pop up function… and of course the link that is pressed has :

<a name=“help1” href=“javascript: showHelp();”>Link</a>

So, basically all I need is help with the if-statement’s first line. I’m almost there, just need a little push. THanks.