

function AddEventHandling(obj,eventname,funct){
	if(obj.addEventListener){
		obj.addEventListener(eventname, funct, true);
	}
	else {
		obj.attachEvent('on'+eventname, funct);
	}
}


var nTime,objFocused=false;
var objObj1,objObj2,casovac;

function DoShowPodMenu(obj,bBol){

  if (bBol) {
    var objDiv=document.getElementById(obj.id);
    objDiv.style.display='';
    objFocused=true;
    clearTimeout(casovac); 
    
  }  else {
 
   if (objFocused) {
    /*var objDiv=document.getElementById(obj.id.substr(0,obj.id.length-1));
    var objHeading=document.getElementById(objDiv.id.replace('DIV_',''));
    obj.style.display='none';
    objDiv.style.display='none';
    if (objChecked!=objHeading)  objHeading.style.color='#000000';*/
    //alert('hidding');
    objFocused=false;
    objObj1=obj;  
    casovac = setTimeout(DoLooseFocus,50);
    
   } 
  }
}



function DoFocusObject(obj){
 
 objFocused=false;
 obj.style.display='';
 clearTimeout(casovac);  
/* var objDiv0=document.getElementById(obj.id+'0');
 objDiv0.style.height=(obj.offsetHeight+400)+'px';
 objDiv0.style.width=(obj.offsetWidth+400)+'px';  
 objDiv0.style.marginLeft=(parseInt(obj.style.marginLeft.replace('px',''))-100)+'px';
 if (obj.style.marginTop!='') 
      objDiv0.style.marginTop=(parseInt(obj.style.marginTop.replace('px',''))-200)+'px';
 else
      objDiv0.style.marginTop='-2px';
 objDiv0.style.display='';*/
}


function DoCheckLooseFocus(obj,obj2){
  objObj1=obj;
  objObj2=obj2;
  casovac = setTimeout(DoLooseFocus,50);
}

function DoLooseFocus(){
  if ((!objFocused)) {
   if (objChecked!=objObj2)  objObj2.style.color='#000000';
   var objDiv0=document.getElementById(objObj1.id+'0');
   objObj1.style.display='none';
   //objDiv0.style.display='none';
   objObj1 = null;
  }
}

//////////////////////////////////////////////

var objMenuChecked;

function DoNormalButtons(obj){
  obj.style.background=obj.style.background.replace('_selected.gif','.gif');
  with(document.main){
	var objNum=eval('document.main.'+obj.id+'_1');
   if (objMenuChecked!=obj) { 
	objNum[0].src=objNum[0].src.replace('_selected.gif', '.gif' );  
    objNum[1].src=objNum[1].src.replace('_selected.gif', '.gif' );  
    objNum[2].src=objNum[2].src.replace('_selected.gif', '.gif' );      
   }	
  }	
}

function DoCheckMainButton(obj){
  obj.style.cursor='hand';
  var bBol=true;
  var objNum=eval('document.main.'+obj.id+'_1');
  if (typeof(objPodText)!='undefined'){
   bBol=(objPodText.id.replace('PODTEXT_','')!=obj.id)
  } 
  if (Hide) {
    bBol=true;
  }	
  if (obj.style.background.indexOf('selected')==-1){
	if (objMenuChecked!=obj) 
	 obj.style.background=obj.style.background.replace('.gif','_selected.gif');
    else
	 obj.style.background=obj.style.background.replace('.gif','_selected0.gif');
  }	 
  else {	 
	 if (bBol && objMenuChecked!=obj) {
	   obj.style.background=obj.style.background.replace('_selected.gif','.gif');
	 } 
  }	 
  with(document.main){
	var objNum=eval('document.main.'+obj.id+'_1');
	if (objNum[0].src.indexOf('selected')==-1){
	 if (objMenuChecked!=obj) {
      objNum[0].src= objNum[0].src.replace('.gif' ,'_selected.gif');
      objNum[1].src= objNum[1].src.replace('.gif' ,'_selected.gif');
      objNum[2].src= objNum[2].src.replace('.gif' ,'_selected.gif');
	 }
	 else {
	  objNum[0].src=objNum[0].src.replace('.gif' ,'_selected.gif');
      objNum[1].src=objNum[1].src.replace('.gif' ,'_selected.gif');
      objNum[2].src=objNum[2].src.replace('.gif' ,'_selected.gif');
	 } 
    } else	
	{
       if (bBol && objMenuChecked!=obj){	
		objNum[0].src=objNum[0].src.replace('_selected.gif', '.gif' );
        objNum[1].src=objNum[1].src.replace('_selected.gif', '.gif' );
        objNum[2].src=objNum[2].src.replace('_selected.gif', '.gif' );        
	   }	
    }
	
  }
}



///////////////////////////////////////

var itemArray = new Array();

itemArray[0] = new Array();
itemArray[0][0] = '|-';

itemArray[1] = new Array();
itemArray[1][0] = 'o|dance/rap';
itemArray[1][1] = 'd|dětská';
itemArray[1][2] = 'F|židovská';
itemArray[1][3] = 'E|keltská';
itemArray[1][4] = 'e|ostatní';
itemArray[1][5] = 'c|folk/country';
itemArray[1][6] = 'g|gospel/soul';
itemArray[1][7] = 'w|chvály';
itemArray[1][8] = 'b|jazz/blues';
itemArray[1][9] = 'm|mluvené slovo';
itemArray[1][10] = 'p|pop';
itemArray[1][11] = 'r|rock/metal';
itemArray[1][12] = 'v|vánoční';
itemArray[1][13] = 'i|filmová/instrumentální';
itemArray[1][14] = '{1}|KLASIKA - stará hudba';
itemArray[1][15] = '{2}|KLASIKA - duchovní hudba';
itemArray[1][16] = '{G}|KLASIKA - gregoriánský chorál';
itemArray[1][17] = '{W}|KLASIKA - pravoslavná';
itemArray[1][18] = '{L}|KLASIKA - tradiční církevní zpěvy';
itemArray[1][19] = '{M}|KLASIKA - mše, kantáty, oratoria atd.';
itemArray[1][20] = '{3}|KLASIKA - varhanní hudba';
itemArray[1][21] = '{4}|KLASIKA - antologie';
itemArray[1][22] = '{5}|KLASIKA - koncerty';
itemArray[1][23] = '{6}|KLASIKA - orchestrální hudba';
itemArray[1][24] = '{7}|KLASIKA - vokální a vokálně-instr. hudba';
itemArray[1][25] = '{8}|KLASIKA - komorní hudba';
itemArray[1][26] = '{9}|KLASIKA - česká hudba';

itemArray[2] = new Array();
itemArray[2][0] = 'o|dance/rap';
itemArray[2][1] = 'd|dětská';
itemArray[2][2] = 'F|židovská';
itemArray[2][3] = 'E|keltská';
itemArray[2][4] = 'e|ostatní etnická';
itemArray[2][5] = 'c|folk/country';
itemArray[2][6] = 'g|gospel/soul';
itemArray[2][7] = 'w|chvály';
itemArray[2][8] = 'b|jazz/blues';
itemArray[2][9] = 'm|mluvené slovo';
itemArray[2][10] = 'p|pop';
itemArray[2][11] = 'r|rock/metal';
itemArray[2][12] = 'v|vánoční';
itemArray[2][13] = 'i|filmová/instrumentální';
itemArray[2][14] = '{1}|KLASIKA - stará hudba';
itemArray[2][15] = '{2}|KLASIKA - duchovní hudba';
itemArray[2][16] = '{G}|KLASIKA - gregoriánský chorál';
itemArray[2][17] = '{W}|KLASIKA - pravoslavná';
itemArray[2][18] = '{L}|KLASIKA - tradiční církevní zpěvy';
itemArray[2][19] = '{M}|KLASIKA - mše, kantáty, oratoria atd.';
itemArray[2][20] = '{3}|KLASIKA - varhanní hudba';
itemArray[2][21] = '{4}|KLASIKA - antologie';
itemArray[2][22] = '{5}|KLASIKA - koncerty';
itemArray[2][23] = '{6}|KLASIKA - orchestrální hudba';
itemArray[2][24] = '{7}|KLASIKA - vokální a vokálně-instr. hudba';
itemArray[2][25] = '{8}|KLASIKA - komorní hudba';
itemArray[2][26] = '{9}|KLASIKA - česká hudba';

itemArray[3] = new Array();
itemArray[3][0] = 'x|hrané';
itemArray[3][1] = 'y|dokumentární';
itemArray[3][2] = 'z|hudební';
itemArray[3][3] = 'd|dětské';

itemArray[4] = new Array();
itemArray[4][0] = '|-';

itemArray[5] = new Array();
itemArray[5][0] = 'k|bible, biblistika';
itemArray[5][1] = 'n|beletrie';
itemArray[5][2] = 'l|teologie, spiritualita';
itemArray[5][3] = 'q|životní styl, psychologie';
itemArray[5][4] = 's|ostatní (kalendáře, pohledy..)';
itemArray[5][5] = 'é|poezie'; 
itemArray[5][6] = 'ý|společenské vědy'; 
itemArray[5][7] = 'u|historie, životopisy';
itemArray[5][8] = 'd|pro děti a mládež'; 
itemArray[5][9] = 'í|výchova dětí, pedagogika';





itemArray[6] = new Array();
itemArray[6][0] = '|-';

function doit(destSel, selVal)
{

  delOption(0 , destSel);
  var theArray2Use = itemArray[selVal];

  for (var i = 0; i < theArray2Use.length; i++)
  {
     theData = theArray2Use[i].split("|");
     fillSel(destSel, theData);
  }
}


function fillSel(destSel, theData)
{

  var txt, val;
  var Len = destSel.options.length;

  var val = theData[0];
  var txt = theData[1].substr(0,50);
   
  destSel.options[Len] = new Option(txt);
  destSel.options[Len].value = val;
}

function delOption(oneItem, selObj)
{
  selObj.options.length = 1;
}


// roletkove menu	
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
