Jave script
Jeg har et kave script som opfører sig forskelliget i IE og NS. Jeg vil gerne have det til at værer "lukket" som i IE og menupunkterne skal være klikbare som i NS.<SCRIPT LANGUAGE="JavaScript">
<!--
var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true:false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true:false;
if (document.images) {
arImLoad = new Array (
"../art/b_left_over",
"../art/b_left_down",
"../art/b_right_over",
"../art/b_right_down",
"triUp");
arImList = new Array ();
for (counter in arImLoad) {
arImList[counter] = new Image();
arImList[counter].src = arImLoad[counter] + ".gif";
}}
function navOver(imName,dir,over,bot) {
if (!document.images) {return};
whichIm = (NS4 && bot) ? document.elFooter.document.images[imName] : document.images[imName];
if (over) {whichIm.src = "../art/b_" + dir + "_over.gif"}
else {whichIm.src = "../art/b_" + dir + ".gif"}
}
function navPress(imName,dir,press,bot) {
whichIm = (NS4 && bot) ? document.elFooter.document.images[imName] : document.images[imName];
if (press) {whichIm.src = "../art/b_" + dir + "_down.gif"}
else {whichIm.src = "../art/b_" + dir + ".gif"}
}
function expandIt(){return}
function expandAll(){return}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
isExpanded = false;
function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == el) {
ind = i;
break;
}
}
return ind;
}
function arrange() {
nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}
function initIt(){
if (NS4) {
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
tempColl = document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
if (tempColl(i).className == "child") tempColl(i).style.display = "none";
}
}
}
function expandIt(el) {
if (!ver4) return;
if (IE4) {expandIE(el)} else {expandNS(el)}
}
function expandIE(el) {
whichEl = eval(el + "Child");
whichIm = event.srcElement;
if (whichEl.style.display == "none") {
whichEl.style.display = "block";
whichIm.src = "triUp.gif";
}
else {
whichEl.style.display = "none";
whichIm.src = "triDown.gif";
}
}
function expandNS(el) {
whichEl = eval("document." + el + "Child");
whichIm = eval("document." + el + "Parent.document.images['imEx']");
if (whichEl.visibility == "hide") {
whichEl.visibility = "show";
whichIm.src = "triUp.gif";
}
else {
whichEl.visibility = "hide";
whichIm.src = "triDown.gif";
}
arrange();
}
function showAll() {
for (i=firstInd; i<document.layers.length; i++) {
whichEl = document.layers[i];
whichEl.visibility = "show";
}
}
function expandAll(isBot) {
newSrc = (isExpanded) ? "triDown.gif" : "triUp.gif";
if (NS4) {
document.images["imEx"].src = newSrc;
for (i=firstInd; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Parent") != -1) {
whichEl.document.images["imEx"].src = newSrc;
}
if (whichEl.id.indexOf("Child") != -1) {
whichEl.visibility = (isExpanded) ? "hide" : "show";
}
}
arrange();
if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
}
else {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
if (divColl(i).className == "child") {
divColl(i).style.display = (isExpanded) ? "none" : "block";
}
}
imColl = document.images.item("imEx");
for (i=0; i<imColl.length; i++) {
imColl(i).src = newSrc;
}
}
isExpanded = !isExpanded;
}
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4) {
write(".parent {position:absolute; visibility:hidden}");
write(".child {position:absolute; visibility:hidden}");
write(".regular {position:absolute; visibility:hidden}")
}
else {
write(".child {display:none}")
}
write("</STYLE>");
}
onload = initIt;
//-->
</SCRIPT>
</HEAD>
<BODY onLoad="timerONE=window.setTimeout('scrollit_r2l(100)',500);">
<CENTER>
<A HREF="main.html "TARGET="main"><IMG SRC="graphic/kiflogo.gif" ALT="Tilbage til forsiden" HEIGHT=95 BORDER=0></A>
</CENTER>
<BR><BR>
<!-- ********************************* VIS/SKJUL ALLE *********************************** -->
<DIV ID=B><A HREF="#" onClick="expandAll(false); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Skjul alle"></A>
Vis/Gem alle</DIV>
<!-- ***************************** OM KIF *********************************************** -->
<DIV ID="elOneParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elOne'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Om KIF</A></DIV></DIV>
<!-- ************************ OM KIF - UNDERMENU ************************** -->
<DIV ID="elOneChild" CLASS=child>
<DIV ID=B><A HREF="../omkif/generelt.html" TARGET="main">Generelt</A><BR>
<A HREF="../omkif/contact.html" TARGET="main">Kontaktpersoner</A><BR>
<A HREF="../omkif/2006.html" TARGET="main">KIF's hovedmål</A><BR>
<A HREF="../omkif/galleri/galleri.html" TARGET="main">Profilgalleri</A><BR>
<A HREF="../omkif/ungdom.html" TARGET="main">Ungdom</A><BR>
<A HREF="../omkif/doping.html" TARGET="main">Dopingpolitik</A><BR>
<A HREF="../omkif/love.html" TARGET="main">Vedtægter</A><BR>
<A HREF="../omkif/kontingent.html" TARGET="main">Kontingent</A><BR>
<A HREF="../omkif/indmeld.html" TARGET="main">Indmeldelse</A><BR>
<A HREF="../omkif/maillist.html" TARGET="main">Maillisten</A><BR>
<BR></DIV></DIV>
<!-- ****************************** NYHEDER ******************************** -->
<DIV ID="elTwoParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elTwo'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Nyheder</DIV></DIV></A>
<!-- ************************** NYHEDER - UNDERMENU **************************** -->
<DIV ID="elTwoChild" CLASS=child>
<DIV ID=B>
<A HREF="../news/news.html" TARGET="main">Sidste nyt</A><BR>
<A HREF="../news/dm1999.html" TARGET="main">DM 1999</A><BR>
<A HREF="../news/arkiv.html" TARGET="main">Ældre nyheder</A><BR>
<BR></DIV></DIV>
<!-- *************************** TRÆNING **************************************** -->
<DIV ID="elThreeParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elThree'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Træning</DIV></DIV></A>
<!-- **************************** TRÆNING - UNDERMENU *************************** -->
<DIV ID="elThreeChild" CLASS=child>
<DIV ID=B><A HREF="../training/run/runTraining.html" TARGET="main">Løb og motion</A><BR>
<A HREF="../training/hammer/cordius.html" TARGET="main">Hammer/diskos</A><BR>
<A HREF="../training/kast/kast.html" TARGET="main">Kastetræning</A><BR>
<A HREF="../training/hurdle/hurdle.html" TARGET="main">Hækkeløb</A><BR>
<A HREF="../training/trainingTime.html" TARGET="main"> Træningstider</A><BR>
<A HREF="../training/coach.html" TARGET="main"> Vores trænerstab</A><BR>
<A HREF="../training/motionTraining.html" TARGET="main"> Motionstræning</A><BR>
<BR></DIV></DIV>
<!-- **************************** TEST DIG SELV ********************************** -->
<DIV ID="elFourParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elFour'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Test dig selv</DIV></DIV></A>
<!-- ************************ TEST OG BEREGN - UNDERMENU **************************** -->
<DIV ID="elFourChild" CLASS=child><DIV ID=B>
<A HREF="../test/bmi.html" TARGET="main">BMI</A><BR>
<A HREF="../test/recovery.html" TARGET="main">Restitueret?</A><BR>
<A HREF="../test/reaction.html" TARGET="main">Reaktionscheck</A><BR>
<A HREF="../test/check.html" TARGET="main">Checkboksen</A><BR>
<A HREF="../test/color.html" TARGET="main">Dyst mellem hjernehalvdelene</A><BR>
<BR></DIV></DIV>
<!-- **************************** BEREGN PÅ DIG SELV ********************************** -->
<DIV ID="elFiveParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elFive'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Beregn</DIV></DIV></A>
<!-- ************************ BEREGN - UNDERMENU **************************** -->
<DIV ID="elFiveChild" CLASS=child><DIV ID=B>
<A HREF="../beregn/vo2.html" TARGET="main">VO<SUB>2</SUB> maks</A><BR>
<A HREF="../beregn/calorieCal.html" TARGET="main">Kalorie forbrug</A><BR>
<A HREF="../beregn/hr.html" TARGET="main">Beregn din puls</A><BR>
<A HREF="../beregn/long.html" TARGET="main">Længde/trespring</A><BR>
<A HREF="../beregn/pace.html" TARGET="main">Løbetempo</A><BR>
<A HREF="../beregn/tempCon.html" TARGET="main">Temperatur</A><BR>
<A HREF="../beregn/kmMile.html" TARGET="main">Distance</A><BR>
<A HREF="../beregn/ugedag.html" TARGET="main">Din ugedag</A><BR>
<BR></DIV></DIV>
<!-- **************************** TERMINSLISTE ************************************** -->
<DIV ID="elSixParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elSix'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Stævner - løb</A></DIV></DIV>
<!-- **************************** TERMINSLISTE - UNDERMENU ************************ -->
<DIV ID="elSixChild" CLASS=child><DIV ID=B>
<A HREF="../termin/termin.html" TARGET="main">Terminslisten</A><BR>
<A HREF="http://www.dansk-atletik.dk/termin.htm" TARGET="main">DAFs terminsliste</A><BR>
<A HREF="http://www.friidrott.se/friidrott/taevling99/arena99.htm" TARGET="main">Den svenske</A><BR>
<A HREF="http://www.friidrett.no/upload/Hovedtermin99.doc" TARGET="main">Den norske</A><BR>
<A HREF="http://www.dlv-sport.de/inhalt3/termine.htm" TARGET="main">Den tyske</A><BR>
<A HREF="http://www.iaaf.org/Calendar/index.asp" TARGET="main">IAAF kalender</A><BR>
<A HREF="../termin/puma.html" TARGET="main">Puma Grand Prix</A><BR>
<A HREF="../termin/strand.html" TARGET="main">Strandsvejsløbet</A><BR>
<A HREF="../termin/valby.html" TARGET="main">Valbyløbet</A><BR>
<A HREF="../termin/erem.html" TARGET="main">Eremitageløbet</A><BR>
<A HREF="../termin/tilArr.html" TARGET="main">Tilføj dit arrangement</A><BR>
<BR></DIV></DIV>
<!-- **************************** RESULTAT BØRS ************************************ -->
<DIV ID="elSevenParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elSeven'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Resultat børs</DIV></DIV></A>
<!-- **************************** RESULTAT BØRS - UNDERMENU **************************** -->
<DIV ID="elSevenChild" CLASS=child><DIV ID=B>
<!-- <A HREF="../result/dm1999.html" TARGET="main">DM 1999</A><BR> -->
<A HREF="../result/puma.html" TARGET="main">Puma Grand Prix</A><BR>
<A HREF="../result/DMhalv.html" TARGET="main">DM ½ marathon</A><BR>
<A HREF="../result/skaf.html" TARGET="main">SKAF 1999</A><BR>
<A HREF="../result/dt9901h1.html" TARGET="main">DT Herre 1</A><BR>
<A HREF="../result/dt9902h1.html" TARGET="main">DT Herre 2</A><BR>
<A HREF="../result/dt9901k1.html" TARGET="main">DT Kvinder 1</A><BR>
<BR></DIV></DIV>
<!-- **************************** STATISTIK ****************************************** -->
<DIV ID="elEightParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elEight'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Statistik</DIV></DIV></A>
<!-- ***************************** STATISTIK - UNDERMENU ****************************** -->
<DIV ID="elEightChild" CLASS=child><DIV ID=B>
<A HREF="../statistik/year/year.html" TARGET="main">KIF statistik</A><BR>
<A HREF="../statistik/klubmestre98.html" TARGET="main">Klubmestre 98</A><BR>
<A HREF="../statistik/klubrekorder.html" TARGET="main">Klubrekorder</A><BR>
<A HREF="../statistik/15kampvin.html" TARGET="main">15-kampsvindere</A><BR>
<A HREF="../statistik/year/pr.html" TARGET="main">TIlføj ny PR</A><BR>
<BR></DIV></DIV>
<!-- ************************* HISTORIE *************************************** -->
<DIV ID="elNineParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elNine'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Historie</DIV></DIV></A>
<!-- **************************** HISTORIE - UNDERMENU **************************** -->
<DIV ID="elNineChild" CLASS=child><DIV ID=B>
<A HREF="../history/1892.html" TARGET="main">1892-1919</A><BR>
<A HREF="../history/1920.html" TARGET="main">1920-1939</A><BR>
<A HREF="../history/1940.html" TARGET="main">1940-1959</A><BR>
<A HREF="../history/1960.html" TARGET="main">1960-1979</A><BR>
<A HREF="../history/1980.html" TARGET="main">1980-1998</A><BR>
<BR></DIV></DIV>
<!-- *********************************** LINKS ************************************** -->
<DIV ID="elTenParent" CLASS=parent>
<DIV ID=B><A HREF="#" onClick="expandIt('elTen'); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Gem undermenu">
Links</DIV></DIV></A>
<!-- ******************************* LINKS - UNDERMENU **************************** -->
<DIV ID="elTenChild" CLASS=child><DIV ID=B>
<A HREF="../links/training.html" TARGET="main">Træning</A><BR>
<A HREF="../links/run.html" TARGET="main">Løbesider</A><BR>
<A HREF="../links/sund.html" TARGET="main">Sundhed</A><BR>
<A HREF="../links/magasin.html" TARGET="main">Nyheder</A><BR>
<A HREF="../links/statistik.html" TARGET="main">Statistik</A><BR>
<A HREF="../links/andre.html" TARGET="main">Blandet</A><BR>
<A HREF="../links/forbund.html" TARGET="main">Forbund</A><BR>
<A HREF="../links/club.html" TARGET="main">Atletikklubber</A><BR>
<A HREF="../links/newurl.html" TARGET="main">Tilføj nyt link</A><BR>
<BR></DIV></DIV>
<!-- ********************************* SITEMAP ******************************** -->
<DIV ID="elElevenParent" CLASS=parent>
<DIV ID=B>
<!-- <A HREF="#" onClick="expandIt('elEleven'); return false"> ALT="Vis/Gem undermenu" -->
<A HREF="sitemap.html" TARGET="main">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0>
Site map</A></DIV></DIV>
<!-- ******************************* SITEMAP - UNDERMENU **************************** -->
<!--
<DIV ID="elElevenChild" CLASS=child>
<P><A HREF="*.html" TARGET="main">*</A><BR>
<BR></DIV>
-->
<!-- ********************************* INTERNE SIDER ************************* -->
<DIV ID="elTwelveParent" CLASS=parent>
<DIV ID=B>
<!-- <A HREF="#" onClick="expandIt('elTwelve'); return false"> ALT="Vis/Gem undermenu" -->
<A HREF="login.html" TARGET="main">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0>
Interne sider</A></DIV></DIV>
<!-- ***************************** INTERNE SIDER - UNDERMENU **************************** -->
<!--
<DIV ID="elTwelveChild" CLASS=child>
<P><A HREF="../intern/*.html" TARGET="main">*</A><BR>
<BR></DIV>
-->
<!-- ****************************** KONTAKT KIF ********************************* -->
<DIV ID="elThirteenParent" CLASS=parent>
<DIV ID=B>
<!-- <A HREF="#" onClick="expandIt('elThirteen'); return false"> -->
<A HREF="mailto:webmaster@kif-atletik.dk">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Send en mail">
Kontakt KIF</A></DIV></DIV>
<!-- ***************************** KONTAKT KIF - UNDERMENU **************************** -->
<!--
<DIV ID="elThirteenChild" CLASS=child>
<P><A HREF="*.html" TARGET="main">*</A><BR>
<BR></DIV>
-->
<!-- ************************* GEM/VIS ALLE *************************** -->
<DIV ID="elExpParent" CLASS=regular>
<DIV ID=B><A HREF="#" onClick="expandAll(true); return false">
<IMG NAME="imEx" SRC="triDown.gif" WIDTH=12 HEIGHT=12 BORDER=0 ALT="Vis/Skjul alle"></A>
Vis/Gem alle</DIV><BR><BR></DIV>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
if (NS4) {
firstEl = "elOneParent";
firstInd = getIndex(firstEl);
showAll();
arrange();
}
//-->
</SCRIPT>
