Question : Need help knowing what parts of script to edit

I am trying to use the code that regisw posted in this thread (http://www.experts-exchange.com/Web_Development/Miscellaneous/Q_20995470.html). However, I am new to javascript and don't know what portions to edit and what to keep as is.

If someone could please color code the things I'm supposed to change to differentiate from what I am supposed to leave as is, I would appreciate it.

What I am trying to do is create a popup-blocker proof dhtml popup that is 358 wide by 144 high, so that I can control the images used and look of the text, as I understand that I cannot change the yellow icon that comes with a regular javascript popup.

Thanks very much.
Related Solutions: Creating popup

Answer : Need help knowing what parts of script to edit

It surely does help telling the full story from the beginning!

It completely changes the script - a form does not work the same as a link

Also I think you should keep the scrollbars - to see why, go to the popup and change the font - for example in Firefox by using ctrl-+


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
<html>
<head>
<title>Post form to new window</title>
<script type="text/javascript">
var win = null;
function  NewWindow(formName,w,h) {
  var form = document.forms[formName];
  var LeftPosition =  (screen.width) ? (screen.width-w)/2 : 0;
  var TopPosition =  (screen.height) ? (screen.height-h)/2 : 0;
  var settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars,resizable'
  win  = window.open('',form.target,settings);
  setTimeout('document.forms["'+formName+'"].submit()',300); // give the window time to open
  return false; // cancel link
}
</script>
</head>
<body>

<form name="purchaseForm" target="purchaseWin" action="http://ww5.aitsafe.com/cf/add.cfm" method="post">
<input type="hidden" name="product" value="Tungsten Bucking Bar #01" />
<input type="hidden" name="price" value="69.95" />
<input type="hidden" name="scode" value="ETBB01" />
<input type="hidden" name="nocart" />
<input type="hidden" name="units" value="1" />
<input type="hidden" name="return" value="http://www.tungstenheavypowder.com/store/prices.html" />
<noscript>
<input type="image" name="submit" src="http://www.tungstenbuckingbars.com/buy_button.jpg" alt="Buy" />
</noscript>
</form>
<script>
document.write('<a href="#" onclick="return NewWindow(\'purchaseForm\',358,144)"><img src="http://www.tungstenbuckingbars.com/buy_button.jpg" alt="Buy" border="0" /></a>');
</script>
</body>
Random Solutions  
 
programming4us programming4us