function menu_hover(){
var menu_c = $('hid');
var menu_a = menu_c.getParent('li');
menu_c.set('morph', {link : 'cancel',duration : '200'});

menu_c.setStyle('opacity', 0);
menu_c.setStyle('margin-top','-8px');

menu_a.addEvents({
'mouseenter': function() {
              menu_c.morph({
                      'opacity' : 1,
                      'margin-top' : '-3px'
              });
              
              },
              
'mouseleave': function() {
              menu_c.morph({
                      'opacity' : 0,
                      'margin-top' : '-8px'
              });}              
  
  
  

});}

function clearText(field){

    if (field.defaultValue == field.value){field.value = '';field.setStyle('color','black');}
    else{if (field.value == ''){ field.value = field.defaultValue;field.setStyle('color','#959595');}}
}

function clearTextarea(field){

    var txt = "Zpráva";
    if (field.value.replace(/^\s*|\s*$/g,'') == txt.replace(/^\s*|\s*$/g,'')) {field.value ='';field.className="active";}
    else if (field.value.replace(/^\s*|\s*$/g,'') == '') {field.value = txt; field.className="";}
}


function textarea(){

$('message').setAttribute('wrap','virtual');
$('message').addEvents({
              'blur': function() {
                clearTextarea(this);
              },
              'focus' : function() {
                clearTextarea(this);
              }   
          });

$('tel_input').addEvents({
              'blur': function() {
                clearText(this);
              },
              'focus' : function() {
                clearText(this);
              }   
          });
$('name_input').addEvents({
              'blur': function() {
                clearText(this);
              },
              'focus' : function() {
                clearText(this);
              }   
          });
}

function clr_fields(){


$('tel_input').addEvents({
              'blur': function() {
                clearText(this);
              },
              'focus' : function() {
                clearText(this);
              }   
          });
$('name_input').addEvents({
              'blur': function() {
                clearText(this);
              },
              'focus' : function() {
                clearText(this);
              }   
          });
}




function slider_init() {
       
        //slider variables for making things easier below
        var itemsHolder = $('container');
        var myItems = $$(itemsHolder.getElements('.item'));
       
        //controls for slider
        var theControls = $('controls');
        var numNavHolder = $(theControls.getElement('.middle'));
        var thePlayBtn = itemsHolder;
        var thePrevBtn = $(theControls.getElement('.left_btn'));
        var theNextBtn = $(theControls.getElement('.right_btn'));
       
       
        //create instance of the slider, and start it up       
        var mySlider = new SL_Slider({
            slideTimer: 7000,
            orientation: 'horizontal',      //vertical, horizontal, or none: None will create a fading in/out transition.
            fade: true,                    //if true will fade the outgoing slide - only used if orientation is != None
            isPaused: false,
            container: itemsHolder,
            items: myItems,
            numNavActive: true,
            numNavHolder: numNavHolder,
            playBtn: thePlayBtn,
            prevBtn: thePrevBtn,
            nextBtn: theNextBtn
        });
        mySlider.start();
                    
    }
function slider_init_1() {
           
        //slider variables for making things easier below
        var itemsHolder = $('container');
        var myItems = $$(itemsHolder.getElements('.ref_bubble'));
       
        //controls for slider
        var theControls = $('controls');
        var numNavHol = $('logos');
        var numNavHolder = numNavHol.getChildren();
        //alert(numNavHolder.length);
        //var thePlayBtn = $(theControls.getElement('.play_btn'));
        //var thePrevBtn = $(theControls.getElement('.left_btn'));
        //var theNextBtn = $(theControls.getElement('.right_btn'));
           
       
        //create instance of the slider, and start it up       
        var mySlider = new SL_Slider_1({
            slideTimer: 7000,          //
            orientation: 'none',      //vertical, horizontal, or none: None will create a fading in/out transition.
            fade: true,              //if true will fade the outgoing slide - only used if orientation is != None
            isPaused: false,
            container: itemsHolder,
            items: myItems,
            numNavActive: true,
            numNavHolder: numNavHolder//,
            //playBtn: null,
            //prevBtn: null,
            //nextBtn: null
        });
        mySlider.start();
       
       
        //adding a little animated rollover highlight to the play and prev/next buttons
    /*    var origBkgdColor = thePlayBtn.getStyle('background-color');
        var newBkgdColor = "#80301D";
        var btnArray = new Array(thePlayBtn, thePrevBtn, theNextBtn);
       
        btnArray.each(function(e, i){
            e.set('tween', {duration: 350, transition: 'cubic:out', link: 'cancel'});
            e.addEvents({
                'mouseenter' : function() {
                    this.tween('background-color', newBkgdColor);
                },
                'mouseleave' : function() {
                    this.tween('background-color', origBkgdColor);
                }
            });
        });*/
   
   
                     
    }
   



function bubble_init() {
    
      var myPages = $$('.bottom_cell');
      var myBubbles = $$('.bubble');
      var text = $$('.bubble_text');
      myBubbles.setStyle('opacity', 0);
      text.setStyle('opacity', 1);
      // Add our events to the pages
      
      myPages.each(function(el, i) {
          el.set('morph', {link : 'cancel'});
          el.addEvents({
              'mouseenter': function() {
                text[i].setStyle('opacity',1);
                  myBubbles[i].morph({
                      'opacity' : 1,
                      'margin-top' : '-70px'
                     
                  });
                  text[i].morph({'opacity' : 1});
              },
              'mouseleave' : function() {
                  myBubbles[i].morph({
                      'opacity' : 0,
                      'margin-top' : '-55px'
                     
                  });
                  text[i].morph({'opacity' : 1});
              }   
          });
      });
  }
 

 
  function per(el){
  el.morph({'background-position' : '3px 0'})
  .morph({'background-position' : '-2px 0'})
  .morph({'background-position' : '3px 0'})
  .morph({'background-position' : '-2px 0'})
  .morph({'background-position' : '3px 0'})
  .morph({'background-position' : '0 0'});
  }

function btext(el){

if (el.className=="more"){
el.innerHTML="Zobrazit méně";
el.className="less";
el.getParent('a').getElement('.barrow').className="bbarrow";
}

else if (el.className=="less"){
el.innerHTML="Zobrazit více";
el.className="more";
el.getParent('a').getElement('.bbarrow').className="barrow";
}
} 

function dropdown(){
var myMenu= new Fx.Slide('dropdown1');
var myMenu2= new Fx.Slide('dropdown2');
var span1=$('ddb1').getElement('span');
var span2=$('ddb2').getElement('span');
myMenu.hide();
myMenu2.hide();


$('ddb1').addEvent('click', function(e){
//span1.innerHTML="Zobrazit další";
e = new Event(e);
myMenu.toggle().chain(function(){btext(span1);});
e.stop();
//;
});
$('ddb2').addEvent('click', function(e){
e = new Event(e);
myMenu2.toggle().chain(function(){btext(span2);});
e.stop();
});
}
 
 
 
 
function graph_init(){
    var icons = $$('div.content','#m_cell');
      var myBubbles = $$('.bubble');
      var hovers = $$('.hovercell');
  //    var arrows = $$('.arrow_cont');
      myBubbles.setStyle('opacity', 0);
    hovers.setStyle('opacity', 0);
      // Add our events to the pages
      icons.each(function(el, i) {
          el.set('morph', {link : 'cancel'});
          el.addEvents({
              'mouseenter': function() {
               
                  myBubbles[i].morph({
                      'opacity' : 1,
                      'margin-top' : '-120px'
                     
                  });
               
      //          arrows[i].set('morph', {link : 'chain'});
          //      per(arrows[i]);
                  if (i+1<hovers.length){
                  hovers[i+1].morph({'opacity' : 1});
                  }
                  
                  //alert(hovers.length + "/n" + (i+1));
              },
              'mouseleave' : function() {
                  myBubbles[i].morph({
                      'opacity' : 0,
                      'margin-top' : '-105px'
                     
                  });
                  if (i+1<hovers.length){ hovers[i+1].morph({'opacity' : 0});}
              }   
          });
      });
  }
 
 

function hover_init() {
if (!Browser.Engine.trident){
      var hovers = $$('#cross_cont .icell');
      var backs = $$('#IT_cross,#WP_cross');
    hovers.setStyle('opacity', 0);
      // Add our events to the pages
 
      backs.each(function(el, i) {
      //    alert("on");
          el.set('morph', {link : 'cancel'});
          el.addEvents({
              'mouseenter': function() {
  //            alert("on");
                  hovers[i].morph({
                      'opacity' : 1
                  });
                 
              },
              'mouseleave' : function() {
  //            alert("of");
                  hovers[i].morph({
                      'opacity' : 0
                     
                     
                  });

              }   
          });
      });
  }}

