dokumentering af script
Jeg har i forbindelse med mit arbejde anvendt et javascript som jeg skal have dokumenteret, dette kan jeg dog imidlertidig ikke gøre selv da jeg ikke er velbevandret inden for javascriptområdet. Jeg søger derfor en venlig person som vil forklare hvad scriptet gør, og hvordan dette virker.Scriptet er som følger:
//SKAL I HEAD
<style type="Text/CSS">
#navigation { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: visible }
#nyheder { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
#firmaprofil { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
#fagomraader { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
#watertechinfo { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
#sog { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
#sitemap { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
#kontakt { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
#forside { position: absolute; top: 189px; left: 186px; width: 270px; height: 24px; visibility: hidden }
</style>
<csactions>
<csaction name="937A2B369" class="Set Status" type="onevent" val0="gå til forsiden">
<csaction name="937A2B371" class="Set Status" type="onevent" val0="">
<csaction name="937A2B373" class="ShowHide" type="onevent" val0="forside" val1="1">
<csaction name="937A2B375" class="ShowHide" type="onevent" val0="forside" val1="0">
<csaction name="937A2B377" class="ShowHide" type="onevent" val0="kontakt" val1="1">
<csaction name="937A35379" class="ShowHide" type="onevent" val0="kontakt" val1="0">
<csaction name="937A35381" class="ShowHide" type="onevent" val0="sitemap" val1="1">
<csaction name="937A35383" class="ShowHide" type="onevent" val0="sitemap" val1="0">
<csaction name="937A35385" class="ShowHide" type="onevent" val0="sog" val1="1">
<csaction name="937A35387" class="ShowHide" type="onevent" val0="sog" val1="0">
<csaction name="937A35389" class="ShowHide" type="onevent" val0="watertechinfo" val1="1">
<csaction name="937A35391" class="ShowHide" type="onevent" val0="watertechinfo" val1="0">
<csaction name="937A35393" class="ShowHide" type="onevent" val0="fagomraader" val1="1">
<csaction name="937A35395" class="ShowHide" type="onevent" val0="fagomraader" val1="0">
<csaction name="937A35397" class="ShowHide" type="onevent" val0="firmaprofil" val1="1">
<csaction name="937A3F399" class="ShowHide" type="onevent" val0="firmaprofil" val1="0">
<csaction name="937A3F401" class="ShowHide" type="onevent" val0="nyheder" val1="1">
<csaction name="937A3F403" class="ShowHide" type="onevent" val0="nyheder" val1="0">
</csactions>
<csscriptdict>
<script><!--
CSStopExecution = false;
function CSAction(array) {
return CSAction2(CSAct, array);
}
function CSAction2(fct, array) {
var result;
for (var i=0;i<array.length;i++) {
if(CSStopExecution) return false;
var actArray = fct[array[i]];
if(actArray == null) return false;
var tempArray = new Array;
for(var j=1;j<actArray.length;j++) {
if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
if(actArray[j][0] == "VAR") {
tempArray[j] = CSStateArray[actArray[j][1]];
}
else {
if(actArray[j][0] == "ACT") {
tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
}
else
tempArray[j] = actArray[j];
}
}
else
tempArray[j] = actArray[j];
}
result = actArray[0](tempArray);
}
return result;
}
CSAct = new Object;
function CSSetStatus(action) { self.status = action[1]; }
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { return CSFindElement(s,0); }
function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
var curDoc = ly ? ly.document : document; var elem = curDoc[n];
if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {
elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
return elem;
}
function CSSetStyleVis(s,v) { if (IsIE()) CSIEStyl(s).visibility = (v == 0) ? "hidden" : "visible";
else CSNSStyl(s).visibility = (v == 0) ? 'hide' : 'show'; }
function CSGetStyleVis(s) { if (IsIE()) return (CSIEStyl(s).visibility == "hidden") ? 0 : 1;
else return (CSNSStyl(s).visibility == 'hide') ? 0 : 1;}
function CSShowHide(action) {
if (action[1] == '') return;
var type=action[2];
if(type==0) CSSetStyleVis(action[1],0);
else if(type==1) CSSetStyleVis(action[1],1);
else if(type==2) {
if (CSGetStyleVis(action[1]) == 0) CSSetStyleVis(action[1],1);
else CSSetStyleVis(action[1],0);
}
}
// --></script>
</csscriptdict>
<csactiondict>
<script><!--
CSAct[/*CMP*/ '937A2B369'] = new Array(CSSetStatus,'gå til forsiden');
CSAct[/*CMP*/ '937A2B371'] = new Array(CSSetStatus,'');
CSAct[/*CMP*/ '937A2B373'] = new Array(CSShowHide,/*CMP*/ 'forside',1);
CSAct[/*CMP*/ '937A2B375'] = new Array(CSShowHide,/*CMP*/ 'forside',0);
CSAct[/*CMP*/ '937A2B377'] = new Array(CSShowHide,/*CMP*/ 'kontakt',1);
CSAct[/*CMP*/ '937A35379'] = new Array(CSShowHide,/*CMP*/ 'kontakt',0);
CSAct[/*CMP*/ '937A35381'] = new Array(CSShowHide,/*CMP*/ 'sitemap',1);
CSAct[/*CMP*/ '937A35383'] = new Array(CSShowHide,/*CMP*/ 'sitemap',0);
CSAct[/*CMP*/ '937A35385'] = new Array(CSShowHide,/*CMP*/ 'sog',1);
CSAct[/*CMP*/ '937A35387'] = new Array(CSShowHide,/*CMP*/ 'sog',0);
CSAct[/*CMP*/ '937A35389'] = new Array(CSShowHide,/*CMP*/ 'watertechinfo',1);
CSAct[/*CMP*/ '937A35391'] = new Array(CSShowHide,/*CMP*/ 'watertechinfo',0);
CSAct[/*CMP*/ '937A35393'] = new Array(CSShowHide,/*CMP*/ 'fagomraader',1);
CSAct[/*CMP*/ '937A35395'] = new Array(CSShowHide,/*CMP*/ 'fagomraader',0);
CSAct[/*CMP*/ '937A35397'] = new Array(CSShowHide,/*CMP*/ 'firmaprofil',1);
CSAct[/*CMP*/ '937A3F399'] = new Array(CSShowHide,/*CMP*/ 'firmaprofil',0);
CSAct[/*CMP*/ '937A3F401'] = new Array(CSShowHide,/*CMP*/ 'nyheder',1);
CSAct[/*CMP*/ '937A3F403'] = new Array(CSShowHide,/*CMP*/ 'nyheder',0);
// --></script>
</csactiondict>
//EKSEMPEL PÅ BODY
<div id="watertechinfo">
<img src="hover/gaa_til_watertech_info.jpg" width="270" height="24" border="0"></div>