/**
 * @author Lezha
 */
var timeout=300;
var tm1=null;
var tm2=null;
var tm3=null;
var tm4=null;
var current=null;

function show(e){
   $('.submenu').hide(0);
   $(e).animate({
      height: "show",
      opacity: "show"
   }, "fast");
   return false;
}
function hide(e){
   $(e).animate({
      height: "hide",
      opacity: "hide"
   }, "normal");
   return false;
}
$(document).ready(function() {
   $("#btn_creative").mouseover( function() {
      if(tm1) { clearTimeout(tm1); tm1=null; }
      show("#sub_creative");
   });
   $("#btn_creative").mouseout( function() {
       tm1=setTimeout("hide('#sub_creative')",timeout);
   });
   $("#sub_creative").mouseover( function() {
      if(tm1) { clearTimeout(tm1); tm1=null; }
   })
   $("#sub_creative").mouseout( function() {
       tm1=setTimeout("hide('#sub_creative')",timeout);
   })
   $("#btn_communications").mouseover( function() {
      if(tm2) { clearTimeout(tm2); tm=null; }
      show("#sub_communications");
   });
   $("#btn_communications").mouseout( function() {
       tm2=setTimeout("hide('#sub_communications')",timeout);
   });
   $("#sub_communications").mouseover( function() {
      if(tm2) { clearTimeout(tm2); tm2=null; }
   })
   $("#sub_communications").mouseout( function() {
       tm2=setTimeout("hide('#sub_communications')",timeout);
   })
   $("#btn_company").mouseover( function() {
      if(tm3) { clearTimeout(tm3); tm3=null; }
      show("#sub_company");
   });
   $("#btn_company").mouseout( function() {
       tm3=setTimeout("hide('#sub_company')",timeout);
   });
   $("#sub_company").mouseover( function() {
      if(tm3) { clearTimeout(tm3); tm3=null; }
   })
   $("#sub_company").mouseout( function() {
       tm3=setTimeout("hide('#sub_company')",timeout);
   })
   $("#phone").mouseover( function() {
      if(tm4) { clearTimeout(tm4); tm4=null; }
      show("#sub_phone");
   });
   $("#phone").mouseout( function() {
       tm4=setTimeout("hide('#sub_phone')",timeout);
   });
   $("#sub_phone").mouseover( function() {
      if(tm4) { clearTimeout(tm4); tm4=null; }
   })
   $("#sub_phone").mouseout( function() {
       tm4=setTimeout("hide('#sub_phone')",timeout);
   })
})