/*		1. FANCYBox -------------------------*/

$(document).ready(function() {
			$("#various3").fancybox({
				'width'				: '65%',
				'height'			: '80%',
				'overlayColor'		: '#000',
				'overlayOpacity'	: '0.2',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
			$("#various2").fancybox({
				'width'				: '65%',
				'height'			: '80%',
				'overlayColor'		: '#000',
				'overlayOpacity'	: '0.2',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
			$("#various1").fancybox({
				'width'				: '65%',
				'height'			: '83%',
				'overlayColor'		: '#000',
				'overlayOpacity'	: '0.2',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
			
			$("a[class=grouped_elements]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : ''			) + '</span>';
				}
			});

		});
		
		
/*		2. MM_preloadImages -------------------------*/

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}



/*		3. MegaMenu -------------------------*/

      jQuery(function(){
        var SelfLocation = window.location.href.split('?');
        switch (SelfLocation[1]) {
          case "justify_right":
            jQuery(".megamenu").megamenu({ 'justify':'right' });
            break;
          case "justify_left":
          default:
            jQuery(".megamenu").megamenu();
        }
      });
	  
