First of all, things are a bit ambiguous. You have both a window name and a variable name of 'window1'. Another thing, you seem to not realize that the browser is perfectly capable of checking to see if a window named window1 already exists and, if so, replacing its contents with the new url and, if not, opening it first. The browser also has no problem in giving focus to a window it has just opened. One more thing, the language attribute for the script tag is deprecated, don't use it. With all this in mind, your script can be simplified to:
Code:
<script type="text/javascript">
function showit(txt)
{
window1 = window.open(txt,"window1","width=750,height=400,left=115,top=130,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes");
window1.focus();
}
</script>
Also, the links like this one:
HTML Code:
<a href=# onclick="showit('http://www.columbiaflooring.com')">
should probably be:
HTML Code:
<a href="http://www.columbiaflooring.com" onclick="showit(this.href);return false;">
to prevent unwanted windows from opening and/or page reloads from happening. And to give non javascript enabled browsers something to see.
Bookmarks