$(document).ready(function(){

  $('html').addClass('js');
  var url=document.URL;
  var domain=document.domain;
	$('ul.glossymenu').stickyit({
		gap: -9,
			stickyclass: "docked"
	}); 

  var url_query = url.replace('http://'+domain+'/page/', ''); 
  if (url_query!='') url_query = url_query.replace('/','')
  if ( $("#"+url_query+"_m").length ) {
    $("#"+url_query+"_m").addClass("sel");
  }	

  if ( $("a.fancyclass").length) {
    $("a.fancyclass").fancybox({
   		'zoomSpeedIn'			: 600,
   		'zoomSpeedOut'			: 500,
   		'easingIn'				: 'easeOutBack',
   		'easingOut'				: 'easeInBack',
   		'zoomOpacity' : true,
   		'imageScale': false,
   		'overlayShow' : true, 
  		'overlayOpacity' : 0.8,
 		'centerOnScroll':false          
    });
  }  
  if ( $("a.fancyclass2").length) {
    $("a.fancyclass2").fancybox({
   		'zoomSpeedIn'			: 600,
   		'zoomSpeedOut'			: 500,
   		'easingIn'				: 'easeOutBack',
   		'easingOut'				: 'easeInBack',
   		'zoomOpacity' : true,
   		'imageScale': true,
   		'overlayShow' : true, 
  		'overlayOpacity' : 0.8,
 		'centerOnScroll':false          
    });
  }  

if ( $("#ilosos").length) {
  $.localScroll();  
  $.localScroll.hash();
}
if ( $("#floatMenu").length) {
 var name = "#floatMenu";  
    var myHeight = 0;
    if (typeof(window.innerWidth) == 'number') {
      myHeight = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
      myHeight = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
      myHeight = document.body.clientHeight;
    }
  if (myHeight > 713) {        
       $(window).scroll(function () {
          if ($(document).scrollTop() > 150) {
            var offset =  $(document).scrollTop()+"px";
            $(name).animate({top:offset},{duration:1000,queue:false});
          } else {
            var offset =  "140px";
            $(name).animate({top:offset},{duration:0,queue:false});          
          }
       });  
  }
}
  
});
