var myOffline = document.location.href.substring(0,(document.location.href.lastIndexOf("/sw_cursos/l_ge/"))+16);

var myOnline = document.location.pathname.substring(0,(document.location.pathname.lastIndexOf("/sw_cursos/l_ge/"))+16); 

var webname = "Kurse"

var myWidthMenu = 80



function dbopc(id,nom,tit,url,pmsn,pmss,sbm) {

  this.id = id; this.nom = nom; this.url = url;

  if (tit=="") { this.tit = nom; } else { this.tit = tit; } 

  this.pmsn = pmsn; this.pmss = pmss;

  this.sbm = sbm; return this;

}

var opcmenu = new Array();

var opcsubmenu = new Array();



opcmenu[1] = new Array();

opcmenu[1][0] = new dbopc("C_cipl2001","Kurse 2001","","C_cipl2001.htm","",",'','','','','','clLevel0a','clLevel0aover','','',0",false);

opcmenu[2] = new Array();

opcmenu[2][0] = new dbopc("C_cipl2002","Kurse 2002","","C_cipl2002.htm","",",'','','','','','clLevel1a','clLevel1aover','','',0",false);

opcmenu[3] = new Array();

opcmenu[3][0] = new dbopc("I_megaloja","Laden","","http://www.ramonllull.net/sw_principal/l_ge/megaloja.htm","",",'','','','','','clLevel0a','clLevel0aover'",false);




// determina inx segons id

var socainx = new Array();

function buscarinx() {

  if (soca[0]=="") { //==0

    socainx[0]=0; socainx[1]=soca[1]; //socainx[0]=soca[0]; socainx[1]=soca[1];

  } else {

    for (inxi=1; inxi<opcmenu.length; inxi++) {

      if (opcmenu[inxi][0].id==soca[0]) {

	    socainx[0]=inxi;

		if (soca[1]=="") {

		  socainx[1]=0;

		} else {

  	      for (inxj=1; inxj<opcmenu[inxi].length; inxj++) {

	        if (opcmenu[inxi][inxj].id==soca[1]) {

		      socainx[1] = inxj;

		      break;

		    }

	      }

		}

	    break;  

	  }

    }

    if (soca.length==3) {

      for (inxk=1; inxk<opcsubmenu[socainx[0]][socainx[1]].length; inxk++) {

	    if (opcsubmenu[socainx[0]][socainx[1]][inxk].id==soca[2]) {

	      socainx[2]=inxk;

		  break;

	    }

	  }

    }  

  }

} 

buscarinx();



function escriumenu() {





  document.writeln('<table border="0" cellspacing="0" cellpadding="0">');

  document.writeln('  <tr>');

  document.writeln('    <td valign="top"><img src="../../comum/img/pix.gif" width="5" height="16" border="0"></td>');

    for (i=1; i<opcmenu.length; i++) {

  document.writeln('    <td>');

  document.writeln('      <ilayer id="layerMenu' + i + '">');

  document.writeln('      <div id="divMenu' + i + '"><img src="../../comum/img/pix.gif" width="' + myWidthMenu + '" height="16" alt="" border="0"></div>');

  document.writeln('      </ilayer>');

  document.writeln('    </td>');

    }

  document.writeln('    <td valign="top"><img src="../../comum/img/pix.gif" width="1" height="16" border="0"></td>');

  document.writeln('  </tr>');

  document.writeln('</table>');



}



function escriuopcio(i) {

  if (opcmenu[i][0].url=="") {

    document.write('<b>' + opcmenu[i][0].nom + '</b>');

  } else {

    document.write('<a href="' + opcmenu[i][0].url + '" class="link" title="' + opcmenu[i][0].tit + '">' + opcmenu[i][0].nom + '</a>');

  }

}



function escriufil() {

  txt1 = ''; txt2 = ''; txt3='';

  if (socainx[0]==0) {

    txt1 = soca[1];

  } else {

    txt1 = opcmenu[socainx[0]][0].tit;

    if (socainx[1]!=0) { txt2 = " > " + opcmenu[socainx[0]][socainx[1]].tit }

    if (socainx.length == 3) { txt3 = " > " + opcsubmenu[socainx[0]][socainx[1]][socainx[2]].tit; }

  }

  document.write(webname + " > " + txt1 + txt2 + txt3);

  document.title = (txt1 + txt2 + txt3);

}



function escriumapa() {

document.write('<table border="0" cellspacing="0" cellpadding="0">');

  for (j=1; j<opcmenu.length; j++) {

    if ((opcmenu[j].length-1)==0) {

document.write('  <tr>');

document.write('    <td align="right" valign="middle" class="txtmapa"><a href="' + opcmenu[j][0].url + '" class="link">' + opcmenu[j][0].nom + '</a></td>');

document.write('    <td valign="middle"><img src="../../comum/img/pix.gif" width="4" height="1"></td>');

document.write('    <td valign="middle"><img src="../../comum/img/pix.gif" width="12" height="1"></td>');

document.write('    <td>&nbsp;</td>');

document.write('  </tr>');

    } else {

      for (i=1; i<opcmenu[j].length; i++) {

	    if (opcmenu[j][i].url=="") {

	       txt = '<b>' + opcmenu[j][i].nom + '</b>';

	    } else {

	       txt = '<a href="' + opcmenu[j][i].url + '" class="link">' + opcmenu[j][i].nom + '</a>';

	    }

        img = 'm'; if (i==1) img = 't';  if (i==(opcmenu[j].length-1)) img = 'b';

document.write('  <tr>');

	    if (i==1) {

document.write('    <td align="right" valign="middle" rowspan="' + (opcmenu[j].length-1) + '" class="txtmapa">' + opcmenu[j][0].nom + '</td>');

document.write('    <td valign="middle" rowspan="' + (opcmenu[j].length-1) + '"><img src="../../comum/img/pix.gif" width="4" height="1"></td>');

document.write('    <td valign="middle" rowspan="' + (opcmenu[j].length-1) + '"><img src="../../comum/img/punt.gif" width="12" height="1"></td>');

	    }

document.write('    <td>');

	    if (opcmenu[j][i].sbm) {

document.write('      <table border="0" cellspacing="0" cellpadding="0">');

document.write('        <tr>');

		  if (img=='m' || img=='b') {

		    imgb = 'background="../../comum/img/punt_l.gif"'

		  } else { imgb = '' }

document.write('          <td ' + imgb + ' valign="bottom"><img src="../../comum/img/punt_' + img + '_s.gif" width="18" height="8"></td>');

document.write('          <td rowspan="2">');

document.write('            <table border="0" cellspacing="0" cellpadding="0">');

		  for (k=1; k<opcsubmenu[j][i].length; k++) {

		    if (opcsubmenu[j][i][k].url=="") {

		      txt2 = '<b>' + opcsubmenu[j][i][k].nom + '</b>';

		    } else {

		      txt2 = '<a href="' + opcsubmenu[j][i][k].url + '" class="link">' + opcsubmenu[j][i][k].nom + '</a>';

		    }

		    img2 = 'm'; if (k==1) img2 = 't';  if (k==(opcsubmenu[j][i].length-1)) img2 = 'b';

document.write('              <tr>');

		    if (k==1) {

document.write('                <td valign="middle" rowspan="' + (opcsubmenu[j][i].length-1) + '" class="txtmapa"><b>' + txt + '</b></td>');

document.write('                <td valign="middle" rowspan="' + (opcsubmenu[j][i].length-1) + '"><img src="../../comum/img/pix.gif" width="4" height="1"></td>');

document.write('                <td valign="middle" rowspan="' + (opcsubmenu[j][i].length-1) + '"><img src="../../comum/img/punt.gif" width="12" height="1"></td>');

		    }

document.write('                <td><img src="../../comum/img/punt_' + img2 + '.gif" width="18" height="16"></td>');

document.write('                <td valign="middle" class="txtmapa">' + txt2 + '</td>');

document.write('              </tr>');

		  }

document.write('            </table>');		

document.write('          </td>');

document.write('        </tr>');

document.write('        <tr>');

		  if (img=='m' || img=='t') {

		    imgb = 'background="../../comum/img/punt_l.gif"'

		  } else { imgb = '' }

document.write('          <td ' + imgb + ' valign="top"><img src="../../comum/img/punt_' + img + '_i.gif" width="18" height="8"></td>');

document.write('        </tr>');

document.write('      </table>');		

	    } else {

document.write('      <table border="0" cellspacing="0" cellpadding="0">');

document.write('        <tr>');

document.write('          <td><img src="../../comum/img/punt_' + img + '.gif" width="18" height="16"></td>');

document.write('          <td valign="middle" class="txtmapa"><b>' + txt + '</b></td>');

document.write('        </tr>');

document.write('      </table>');		

	    }

document.write('    </td>');

document.write('  </tr>');

      }

    }

  }

document.write('</table>');		



}

