//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
// bublinky s nahladmi
 var BubbleTips = {
   opacity : "0.85",
   bubbleNode : null,
   activateTipOn : function(type, jaz){
     //alert(jaz);
     var jazyk = jaz;
		 var bubble = document.createElement("span");
     bubble.style.position = "absolute";
     bubble.style.zIndex = "9";
     this.bubbleNode = bubble;
     document.getElementsByTagName("body")[0].appendChild(bubble);
     var tipTags = document.getElementsByTagName(type);
     for(var i=0;i<tipTags.length;i++){
       this.bindBubbleTip(tipTags[i], jazyk);
     }
   },
  bindBubbleTip : function(elem, jaz) {
      var tipText = elem.getAttribute("title");
      //alert(jaz);
      if(tipText==1){
			  if(jaz=='sk'){
					tipText="Dátum a čas vyplenia registračného formulára";
				}
			  if(jaz=='en'){
					tipText="Date and time of your registration";
				}				
			}
      if(tipText==2){
			  if(jaz=='sk'){
			  	tipText="Dátum a čas aktivovania Vašej osobnej zóny (kde sa teraz nachádzate) administrátorom";			  	
				}
			  if(jaz=='en'){
					tipText="Date and time when was your personal zone activated by administrator";
				}				
			}
      if(tipText==3){			  
			  if(jaz=='sk'){
					tipText="Dátum kedy ste odovzdali prihlášku za člena OZ Sieť ChemNet";
				}
			  if(jaz=='en'){
					tipText="Date and time when you delivered application list to become member of Sieť ChemNet civic organisation";
				}				
			}
      if(tipText==4){			  
			  if(jaz=='sk'){
					tipText="Dátum a čas (v tvare r-m-d h:m:s) kedy administrátor vykonal zmenu vo Vašom pripojení";
				}
			  if(jaz=='en'){
					tipText="Date and time (in format y-m-d h:m:s) when administrator has edited your connection";
				}				
			}
      if(tipText==5){			  
			  if(jaz=='sk'){
					tipText="Druh zmeny vo Vašom pripojení";
				}
			  if(jaz=='en'){
					tipText="Type of change";
				}				
			}
      if(tipText==6){			  
			  if(jaz=='sk'){
					tipText="Dátum (v tvare r-m-d) kedy Vaše pripojenie končí";
				}
			  if(jaz=='en'){
					tipText="Date (in format y-m-d) of your connection expiration";
				}				
			}
      if(tipText==7){			  
			  if(jaz=='sk'){
					tipText="Dátum (v tvare r-m-d) kedy Vaše pripojenie končí";
				}
			  if(jaz=='en'){
					tipText="Date (in format y-m-d) of your connection expiration";
				}				
			}
      if(tipText==8){			  
			  if(jaz=='sk'){
					tipText="Suma uhradená za pripojenie";
				}
			  if(jaz=='en'){
					tipText="Amount paid for connection";
				}				
			}
      if(tipText==9){			  
			  if(jaz=='sk'){
					tipText="Poznámka k danej akcii od administrátora";
				}
			  if(jaz=='en'){
					tipText="Note made by administrator to given action";
				}				
			}
      if(tipText==10){			  
			  if(jaz=='sk'){
					tipText="Osobné číslo z Akademického Informačného Systému (AIS)";
				}
			  if(jaz=='en'){
					tipText="Personal student's number from Academic Information System (AIS)";
				}				
			}
      if(tipText==11){			  
			  if(jaz=='sk'){
					tipText="Túto možnost využite iba vtedy, ak nemáte pridelené AIS číslo. Pokiaľ máte AIS riadne pridelené ste povinný ho zadať!";
					//Som študent, zamestnanec alebo zahraničný hosť univerzity a nemám pridelené AIS, ale na požiadanie dodám príslušné potvrdenie.
				}
			  if(jaz=='en'){
					tipText="Use this option in case you don't have assigned AIS (Academic Information System) number. If you have AIS number, you are obliged to enter it!";
					//I'm student, university employee or abroad guest of university and I don't have assigned AIS (Academic Information System) number, but I will deliver confirmation about my status if I will be asked.
				}				
			}
      if(tipText==null || tipText.length==0){
        tipText=" ";
      }
      elem.removeAttribute("title");
      var bubble = this.createElem("span","bubbleTooltip");
      var tipTop = this.createElem("span","top");
      tipTop.appendChild(document.createTextNode(tipText));
      bubble.appendChild(tipTop);
      bubble.appendChild(this.createElem("span","bottom"));
      Effects.setOpacity(bubble,this.opacity);
      elem.tooltip = bubble;
      elem.onmouseover = ToolTipEvents.showTooltip;
      elem.onmouseout = ToolTipEvents.hideTooltip;
      elem.onmousemove = ToolTipEvents.followMouse;
    },
    createElem : function(tag,className){
      var elem = document.createElement(tag);
      elem.className = className;
      elem.style.display = "block";
      elem.style.fontWeight= "bold";
      return elem;
    }
  };

     var ToolTipEvents = {
      offsetLeft : (-25),
      offsetTop : (10),
      posRef : function(){
        return ((document.documentElement.scrollTop)?
        document.documentElement : document.body)
        },
      showTooltip : function(e){
        ToolTipEvents._cleanup();
       BubbleTips.bubbleNode.appendChild(this.tooltip);
       Effects.fadeIn(this.tooltip,BubbleTips.opacity);
       ToolTipEvents.followMouse(e);
     },
     hideTooltip : function(e){
       Effects.fadeOut(this.tooltip, ToolTipEvents._cleanup);
     },
     followMouse : function(e){
       if(e == null){ e = window.event };
       var posx = ToolTipEvents.offsetLeft;
       var posy = ToolTipEvents.offsetTop;
       if(e.pageX || e.pageY){
         posx += e.pageX;
         posy += e.pageY;
       } else if(e.clientX || e.clientY) {
         posx += e.clientX + posRef.scrollLeft;
         posy += e.clientY + posRef.scrollTop;
       }
       BubbleTips.bubbleNode.style.top = (posy) + "px";
       BubbleTips.bubbleNode.style.left = (posx) + "px";
     },
     _cleanup : function(){
       var bubble = BubbleTips.bubbleNode;
       if( bubble.childNodes.length > 0 ){
         bubble.removeChild(bubble.firstChild);
       }
     }
   };

    var Effects = {
     fadeIn : function (elem,maxOpac){
       elem.fadeIn = Effects._fadeIn;
       elem.maxOpac = maxOpac;
       elem.curOpac = 0;
       this.cancelCurrent();
       elem.fadeIn();
     },
     fadeOut : function (elem,fadeDoneF){
       elem.fadeOut = Effects._fadeOut;
       elem.fadeOutDone = fadeDoneF;
       this.cancelCurrent();
       elem.fadeOut();
     },
     cancelCurrent : function() {
       clearTimeout(window.evtId);
     },
     _fadeIn : function() {
       if( (+this.curOpac) < (+this.maxOpac) ){
         this.curOpac = (+this.curOpac)+(0.05);
         Effects.setOpacity(this,this.curOpac);
         window.fadeInElem = this;
         window.evtId = setTimeout(function(){
           this.fadeInElem.fadeIn()
           },30);
         
       } else {
         Effects.setOpacity(this,this.maxOpac);
         window.fadeInElem = null;
       }
     },
     _fadeOut : function() {
       if( (+this.curOpac) > 0 ){
         this.curOpac = Math.max(0,(+this.curOpac)-(0.05));
         Effects.setOpacity(this,this.curOpac);
         window.fadeOutElem = this;
         window.evtId = setTimeout(function(){
           this.fadeOutElem.fadeOut()
           },30);
       } else if(this.fadeOutDone) {
         this.fadeOutDone();
         window.fadeOutElem = null;
       }
     },
     setOpacity : function (elem,opac){
       elem.style.filter="alpha(opacity:"+((+opac)*100)+")";
       elem.style.KHTMLOpacity=opac;
       elem.style.MozOpacity=opac;
       elem.style.opacity=opac;
     }
   };
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------


