Скачал ява-скрипт новигации-меню, все отлично, меню нравится, но одна проблема - все ссылки открываются в новом окне. Уже голову сломал искать методом научного тыка где исправить, что-бы открывались ссылки в том-же окне. Помогите, пожалуйста!
Скрипт тут http://woweb.ru/load/101-1-0-2668
Вот его код:
==================================
<html>
<head>
<script LANGUAGE="JavaScript">
<!--
var total=1;
var db = new Array();
// -- Enter Values Here --
// Format: dbAdd(parent[true|false] , description, URL [blank for nohref], level , TARGET [blank for "content"], new? [1=yes])
dbAdd( false , "Home" , "/index.html" , 0 , "" , 0)
dbAdd( false, "Whats New" , "/new.html" , 0 , "" , 0)
dbAdd( true , "The Web" , "" , 0 , "", 1)
dbAdd( true , "Scripts" , "/scripts/" , 1 , "" , 1)
dbAdd( false , "Calendar" , "/scripts/calendar/" , 2 , "" , 0)
dbAdd( false , "Replace Util", "/scripts/replace/" , 2 , "" , 0)
dbAdd( false , "Access Analysis", "/scripts/access/", 2 , "" , 0)
dbAdd( false , "Content Tree" , "/scripts/tree/" , 2 , "" , 1)
dbAdd( false , "Tip of the Day" , "/scripts/tip/" , 2 , "" , 1)
dbAdd( true , "Information" , "/info/" , 1 , "" , 0)
dbAdd( false , "Searching the Internet" , "/info/search/" ,2 , "" , 0)
dbAdd( false , "Slash, Slash, Slash" , "/info/slash/" , 2 , "" , 0)
dbAdd( false , "SSI Tutorial" , "/info/ssi/" , 2 , "" , 0)
dbAdd( true , "CGI Scripts" , "/www/scripts/" , 1 , "" , 0)
dbAdd( false , "Image Indexer" , "/www/scripts/images.html" , 2 , "" , 0)
dbAdd( false , "Raytraced Access Stats" , "/www/scripts/access3.html" , 2 , "" , 0)
dbAdd( false , "Countdown" , "/www/scripts/countdown.html" , 2 , "" , 0)
dbAdd( false , "Form Response Mailer" , "/www/scripts/mailer.html" , 2 , "" , 0)
dbAdd( false , "Comments" , "/www/scripts/comments.html" , 2 , "" , 0)
dbAdd( false , "Access Stats" , "/www/scripts/access.html" , 2 , "" , 0)
dbAdd( false , "Graphical Access Stats" , "/www/scripts/access2.html" , 2 , "" , 0)
dbAdd( false , "Table Generator" , "/www/scripts/table.html" , 2 , "" , 0)
dbAdd( false , "Access Counter" , "/www/scripts/counter.html" , 2 , "" , 0)
dbAdd( false , "Mail Links Generator" , "/www/scripts/maillink.html" , 2 , "" , 0)
dbAdd( false , "User Stats" , "/www/scripts/stats.html" , 2 , "" , 0)
dbAdd( true , "Technology" , "" , 0 , "", 0)
dbAdd( true , "Perl" , "/perl/" , 1 , "" , 0)
dbAdd( false , "icons.zip" , "/perl/icons/icons.zip" , 2 , "" , 0)
dbAdd( true , "Graph.pm" , "" , 2 , "" , 0)
dbAdd( false , "Documentation" , "/perl/graph/Graph.pm.html" , 3 , "" , 0)
dbAdd( false , "Example Script" , "/perl/graph/example.txt" , 3 , "" , 0)
dbAdd( false , "Example .gif" , "/perl/graph/example.gif" , 3 , "" , 0)
dbAdd( false , "Download" , "/perl/graph/Graph.pm.zip" , 3 , "" , 0)
dbAdd( false , "Must-Have Utilities" , "/utilities/" , 1 , "" , 0)
dbAdd( true , "Fun" , "" , 0 , "" , 0)
dbAdd( true , "Home Theater" , "/theater/" , 1 , "" , 0)
dbAdd( false , "My Home Theater" , "/theater/theater.html" , 2 , "" , 0)
dbAdd( false , "My Movie Collection" , "/theater/movies.html" , 2 , "" , 0)
dbAdd( false , "Honda Prelude" , "/prelude/" , 1 , "" , 0)
dbAdd( true , "Pictures" , "/pictures/" , 1 , "" , 0)
dbAdd( false , "European Vacation" , "/vacation/" , 2 , "" , 0)
dbAdd( false , "Iscanic" , "/iscanic/" , 2 , "" , 0)
dbAdd( false , "ISCA Users" , "/isca/" , 2 , "" , 0)
dbAdd( true , "Entertainment" , "" , 0 , "" , 0)
dbAdd( false , "Raytracing" , "/raytracing/" , 1 , "" , 0)
dbAdd( false , "Mods and Midis" , "/modmidi/" , 1 , "" , 0)
dbAdd( false , "RealAudio" , "/realaudio/" , 1 , "" , 0)
// dbAdd( false , "" , "" , 0 , "" , 0)
// -- End modifications --
// Get current cookie setting
var current=getCurrState()
function getCurrState() {
var label = "currState="
var labelLen = label.length
var cLen = document.cookie.length
var i = 0
while (i < cLen) {
var j = i + labelLen
if (document.cookie.substring(i,j) == label) {
var cEnd = document.cookie.indexOf(";",j)
if (cEnd == -1) { cEnd = document.cookie.length }
return unescape(document.cookie.substring(j,cEnd))
}
i++
}
return ""
}
// Add an entry to the database
function dbAdd(mother,display,URL,indent,top,newitem) {
db[total] = new Object;
db[total].mother = mother
db[total].display = display
db[total].URL = URL
db[total].indent = indent
db[total].top = top
db[total].newitem = newitem
total++
}
// Record current settings in cookie
function setCurrState(setting) {
var expire = new Date();
expire.setTime(expire.getTime() + ( 7*24*60*60*1000 ) ); // expire in 1 week
document.cookie = "currState=" + escape(setting) + "; expires=" + expire.toGMTString();
}
// toggles an outline mother entry, storing new value in the cookie
function toggle(n) {
if (n != 0) {
var newString = ""
var expanded = current.substring(n-1,n) // of clicked item
newString += current.substring(0,n-1)
newString += expanded ^ 1 // Bitwise XOR clicked item
newString += current.substring(n,current.length)
setCurrState(newString) // write new state back to cookie
}
}
// returns padded spaces (in mulTIPles of 2) for indenting
function pad(n) {
var result = ""
for (var i = 1; i <= n; i++) { result += " " }
return result
}
// Expand everything
function explode() {
current = "";
initState="";
for (var i = 1; i < db.length; i++) {
initState += "1"
current += "1"
}
setCurrState(initState);
history.go(0);
}
// Collapse everything
function contract() {
current = "";
initState="";
for (var i = 1; i < db.length; i++) {
initState += "0"
current += "0"
}
setCurrState(initState);
history.go(0);
}
function tree_close() {
window.parent.location = window.parent.content.location;
}
// end -->
</script>
<TITLE>Contents</TITLE>
</HEAD>
<BODY bgcolor=#ffffff LINK="#006666" VLINK="#004444">
<table width=100% cellspacing=0 cellpadding=3 border=0>
<tr>
<td align=left bgcolor="#006666" width=100%><font color="#fffffe" face="arial"><b>Contents</b></font></td>
<td align=right bgcolor="#006666"><a href="java script:contract();"><IMG SRC="images/minimize.gif" WIDTH=16 HEIGHT=14 BORDER=0></a><a href="java script:explode();"><IMG SRC="images/maximize.gif" WIDTH=16 HEIGHT=14 BORDER=0 ></a><a href="java script:tree_clos
e();"><IMG SRC="images/x.gif" WIDTH=16 HEIGHT=14 BORDER=0></a></td>
</tr>
</table>
<IMG SRC="images/dot.gif" WIDTH=16 HEIGHT=16 BORDER=0> = New!<br>
<table border=0 width=500>
<tr><td>
<font size="-1">
<script LANGUAGE="JavaScript">
<!--
// Set the initial state if no current state or length changed
if (current == "" || current.length != (db.length-1)) {
current = ""
initState = ""
for (i = 1; i < db.length; i++) {
initState += "0"
current += "0"
}
setCurrState(initState)
}
var prevIndentDisplayed = 0
var showMyDaughter = 0
// end -->
<!--
var Outline=""
// cycle through each entry in the outline array
for (var i = 1; i < db.length; i++) {
var currIndent = db[i].indent // get the indent level
var expanded = current.substring(i-1,i) // current state
var top = db[i].top
if (top == "") { top="content" }
// display entry only if it meets one of three criteria
if ((currIndent == 0 || currIndent <= prevIndentDisplayed || (showMyDaughter == 1 && (currIndent - prevIndentDisplayed == 1)))) {
Outline += pad(currIndent)
// Insert the appropriate GIF and HREF
newitem = "";
if (db[i].newitem) { newitem="_new"; }
if (!(db[i].mother)) {
Outline += "<IMG SRC=\"images/blank.gif\" WIDTH=16 HEIGHT=16 BORDER=0><IMG SRC=\"images/document" + newitem + ".gif\" WIDTH=16 HEIGHT=16 BORDER=0>"
}
else {
if (current.substring(i-1,i) == 1) {
Outline += "<A HREF=\"java script:history.go(0)\" onMouseOver=\"window.parent.status=\'Click to collapse\';return true;\" onClick=\"toggle(" + i + ")\">"
Outline += "<IMG SRC=\"images/minus.gif\" WIDTH=16 HEIGHT=16 BORDER=0><IMG SRC=\"images/open" + newitem + ".gif\" WIDTH=16 HEIGHT=16 BORDER=0>"
Outline += "</A>"
}
else {
Outline += "<A HREF=\"java script:history.go(0)\" onMouseOver=\"window.parent.status=\'Click to expand\';return true;\" onClick=\"toggle(" + i + ")\">"
Outline += "<IMG SRC=\"images/plus.gif\" WIDTH=16 HEIGHT=16 BORDER=0><IMG SRC=\"images/closed" + newitem + ".gif\" WIDTH=16 HEIGHT=16 BORDER=0>"
Outline += "</A>"
}
}
Outline += " ";
if (db[i].URL == "" || db[i].URL == null) {
Outline += " " + db[i].display // no link, just a listed item
}
else {
Outline += " <A HREF=\"" + db[i].URL + "\" TARGET=\"" + top + "\">" + db[i].display + "</A>"
}
// Bold if at level 0
if (currIndent == 0) {
Outline = "<B>" + Outline + "</B>"
}
Outline += "<BR>"
prevIndentDisplayed = currIndent
showMyDaughter = expanded
// if (i == 1) { Outline = ""}
if (db.length > 25) {
document.write(Outline)
Outline = ""
}
}
}
document.write(Outline)
// end -->
</script>
</font>
</td></tr>
</table>
<hr noshade>
<font size="-1" face="arial"><i>
<center>Content tree by <a href="mailto:mkruse@netexpress.net">Matt Kruse</a></center>
</i></font>
<br>
</BODY>
</HTML>