﻿////---------------------------------- M E N U ------------------------------------
//var oTrap=document.all.tags('UL');
////tabliczka[1]="gogo"
//function clickExpandCollapse()
//{	
//	//if(oTrap.length>0){oTrap=tabliczka} 
//	if(ExpandCollapse.innerHTML=='rozwiñ kategorie'){
//		for(i=0;i<oTrap.length;i++){
//			if((oTrap(i).tagName=='UL') && (document.all(oTrap(i).sourceIndex-3).className=='tocHead')){
//				oTrap(i).className = 'tocItemShow';
//				document.all(oTrap(i).sourceIndex-2).innerHTML='&minus;';}}
//		ExpandCollapse.innerHTML='zwiñ kategorie';}
//	else{
//		for(i=0;i<oTrap.length;i++){
//			if((oTrap(i).tagName=='UL') && (document.all(oTrap(i).sourceIndex-3).className=='tocHead')){
//				oTrap(i).className = 'tocItemHide';
//				document.all(oTrap(i).sourceIndex-2).innerHTML='+';}}
//		ExpandCollapse.innerHTML='rozwiñ kategorie';}
//		//tabliczka=oTrap
//}
//function fnFlash(oTitle){
//	//if(oTrap.length>0){oTrap=tabliczka;}
//	oList=document.all(oTitle.sourceIndex+3);
//	oIMG=document.all(oTitle.sourceIndex+1);
//	if(oList.className=='tocItemHide'){
//		oList.className='tocItemShow';
//		oIMG.innerHTML='&minus;';}
//	else{
//		oList.className='tocItemHide';
//		oIMG.innerHTML='+';}
//	//tabliczka=oTrap;
//}

//---------------------------------------------------------------------------------------

var nn4, ie4, nn6, t, x, y;
nn4=(document.layers)?true:false;
ie4=(document.all)?true:false;
nn6=((document.getElementById)&&(!ie4))?true:false;

function show(nr, modx, mody){
  mouseMove;
  if(nn6){
    // alert((x+modx)+'px  '+(y+mody)+'px');
    document.getElementById(nr).style.left       = (x+modx)+'px';
    document.getElementById(nr).style.top        = (y+mody)+'px';
    document.getElementById(nr).style.visibility = 'visible';
  }
  if(nn4){
    document.layers[ktory].left    = x+modx;
    document.layers[ktory].top     = y+mody;
    document.layers[nr].visibility = 'show';
  }
  if (ie4) {
      if (x != undefined) {
          document.all[nr].style.left = x + modx;
          document.all[nr].style.top = y + mody;
          document.all[nr].style.visibility = 'visible';
      } 
  }
}

function hide(nr){
  if(nn6) document.getElementById(nr).style.visibility='hidden';
  if(nn4) document.layers[nr].visibility='hide';
  if(ie4) document.all[nr].style.visibility='hidden';
}

function init(){
  document.onmousemove = mouseMove;
  if(nn4) document.captureEvents(Event.MOUSEMOVE);
}

function mouseMove(e){
  mousePosition(e);
}

function mousePosition(e){
  if(nn4 || nn6){
    x = e.pageX;
    y = e.pageY;
  }
  if(ie4){
    x=event.x+document.body.scrollLeft;
    y=event.y+document.body.scrollTop;
  }
}

$(document).ready(
function()
{
    init();
}
);
