/* subindex.js: JavaScript for displaying subdocuments under the miscellaneous
 * main titles, like Klubben, Softboll, Baseboll etc */
/* Main, declare variables */
var tit = '';
var txt1 = '';
var txt2 = '';
var txt3 = '';
var txt4 = '';
var txt5 = '';
var txt6 = '';
var url1 = '';
var url2 = '';
var url3 = '';
var url4 = '';
var url5 = '';
var url6 = '';

/* Function initall. Set button texts and classnames for unvisible buttons. */
function initall() {
   var i;
   var nam;
   var txt;

   for (i = 1; i < 7; i++) {
      nam = 'but' + i;
      txt = eval('txt' + i);
      document.getElementById(nam).value = txt;
      if (txt == '') {
         document.getElementById(nam).className = 'noshow';
         nam = 'tdr' + i;
         document.getElementById(nam).className = 'noshow';
      }
   }         

   setactive(document.getElementById('but1'), '1');
}
	
/* Function setactive: Change class for the active tab and display its document */	    
function setactive(but, pag) {
   var myurl;
   var nam;
   var ifx;
      
   for (i = 1; i < 7; i++) {
      nam = 'but' + i;
      if (document.getElementById(nam).value != '') {
         document.getElementById(nam).className = 'but';
         nam = 'tdr' + i;
         document.getElementById(nam).className = 'actbut';
      }
   }         

   but.className = 'actbut';
   
  
   myurl = eval('url' + pag);
   
   ifx = document.getElementById('ifr');

   if (myurl.substring(0,5) == 'http:') {
      open(myurl);
      /* ifx.location = '../empty.htm'; */
      ifx.src  = '../empty.htm';
   }
   else {
      /* ifx.location = myurl; */
      ifx.src = myurl; 
   }
}
	
/* Function hoverit: Change class for the mouse over tab */
function hoverit(nam) {
    if (nam.className == 'but')
        nam.className = 'hovbut';
}	

/* Function hoverit: Change class for the mouse out tab */
function unhover(nam) {
    if (nam.className == 'hovbut')
        nam.className = 'but';
}
	
/* Function showbody: Write the body of the document */
function showbody(title) {
    document.writeln("<h3 height=10%>" + title + "</h3>");
    document.writeln("<table cellpadding='0' cellspacing='0' border='0'>");
    document.writeln("  <tr>");
    document.writeln("    <td><input type='button' id='but1' name='but1' onMouseOver='hoverit(this)' onMouseOut='unhover(this)' onClick='setactive(this, 1)'></td>");
    document.writeln("    <td id='tdr1'></td>");
    document.writeln("    <td><input type='button' id='but2' name='but2' onMouseOver='hoverit(this)' onMouseOut='unhover(this)' onClick='setactive(this, 2)'></td>");
    document.writeln("    <td id='tdr2'></td>");
    document.writeln("    <td><input type='button' id='but3' name='but3' onMouseOver='hoverit(this)' onMouseOut='unhover(this)' onClick='setactive(this, 3)'></td>");
    document.writeln("    <td id='tdr3'></td>");
    document.writeln("    <td><input type='button' id='but4' name='but4' onMouseOver='hoverit(this)' onMouseOut='unhover(this)' onClick='setactive(this, 4)'></td>");
    document.writeln("    <td id='tdr4'></td>");
    document.writeln("    <td><input type='button' id='but5' name='but5' onMouseOver='hoverit(this)' onMouseOut='unhover(this)' onClick='setactive(this, 5)'></td>");
    document.writeln("    <td id='tdr5'></td>");
    document.writeln("    <td><input type='button' id='but6' name='but6' onMouseOver='hoverit(this)' onMouseOut='unhover(this)' onClick='setactive(this, 6)'></td>");
    document.writeln("    <td id='tdr6'></td>");
    document.writeln("  </tr>");
    document.writeln("</table>");
    document.writeln("<iframe frameborder='0' id='ifr' name='ifr' src='../empty.htm' height=85% width=100%></iframe>");
}
	
/* Function showhead: Write some data in the head part of the document */
function showhead(title) {
    document.writeln("<title>" + title + "index</title>");
    document.writeln("<LINK rel='stylesheet' type='text/css' href='../stilmall.css' title='style1'>");
}

/* Function showhead: Write some data in the head part of the document */
function showheadeng(title) {
    document.writeln("<title>" + title + "index</title>");
    document.writeln("<LINK rel='stylesheet' type='text/css' href='../../stilmall.css' title='style1'>");
}
	


