jQuery( function() {
	
   	/*if (jQuery('#main_image').length) {
		Slideshow.init();
	}*/

        $($('.accordion h2')[0]).next().toggle('fast');
	
	jQuery('.accordion h2').click(function() {
		jQuery(this).next().toggle('fast');
		jQuery(this).parent().toggleClass('open');
		return false;
	});
	
	if (jQuery('.accordion .item').hasClass('open')) {
		//jQuery(this).find('.info_content').css('display', 'block');
	}
	
	/*
	if ( jQuery.browser.msie && (parseInt(jQuery.browser.version, 10)<9) ) {
		jQuery('.sales_network tr:even').each(function() {
			jQuery(this).addClass('even');
		});
	}
	
	if (jQuery('#eminent_carousel').length) {
		jQuery('#eminent_carousel').jcarousel({
			'scroll':5,
			'animation':'slow',
			itemFirstInCallback: {
			  onBeforeAnimation: function(){  },
			  onAfterAnimation: function(){ setOverviewScroll(); }
			}
		});
	}
	
	if(jQuery("div.gallery_zoom").length) Magnifier.init();
	*/

        /**
         * Fancybox
         * */

        // image
        $("a.lightbox").fancybox(/*{
            'zoomSpeedIn'   : 300,
            'zoomSpeedOut'  : 300,
            'overlayShow'   : true
        }*/);

        // iframe content
        $("a.lightbox-page").fancybox({
            'zoomSpeedIn'   : 300,
            'zoomSpeedOut'  : 300,
            'overlayShow'   : true,
            'width'         : 650,
            'height'        : 280,
            'titleShow'     : false,
            'autoScale'     : true,
            'type'          : 'iframe'
        });

	if (jQuery('.slider_1 #box-slider').length) {
		Slideshow.showControls = false;
		Slideshow.autostart = true;
   		Slideshow.init();
	}

   	if (jQuery('.slider_2 #box-slider').length) {
   		Slideshow.showAdditionalInfo = true;
   		Slideshow.init();
	}

	jQuery('.accordion h2').click(function() {
		jQuery(this).next().toggle('fast');
		jQuery(this).parent().toggleClass('open');
		return false;
	});

	if (jQuery('.accordion .item').hasClass('open')) {
		//jQuery(this).find('.info_content').css('display', 'block');
	}

});

/*function setOverviewScroll() {
	var offset = -(parseInt(jQuery('#eminent_carousel').css('left'))/168);
	jQuery('#overview_scroll .active').css({
		'left': offset*15+'px'
	});
	return false;
}
*/
/*var Magnifier={
	init:function(root){
		var _this=this;
		this.move_pane=jQuery("div.gallery_image");
		this.zoom_pane=jQuery("div.gallery_zoom");

		this.bar=jQuery("<span>").appendTo(this.move_pane).css({display:"none", background:"#fff", opacity:0.35, border:"1px solid #777", position:"absolute", top:0, left:0, cursor:"pointer"});

		this.items=jQuery('.gallery_thumbnails a').click(function(){return _this.set(this)});

		this.set(this.items[0]);

		this.move_pane.hover(function(){_this.over(this)},function(){_this.out(this)}).mousemove(function(e){_this.move(e)});

	},
	set:function(obj){
		jQuery('div.gallery_thumbnails a.active').removeClass("active");
		jQuery(obj).addClass("active");
		jQuery('div.gallery_image div.active').removeClass("active");
		jQuery(obj.hash).addClass("active");
		this.curent_img_small=jQuery(obj.hash+" img")[0];
		this.curent_img_large=jQuery("#"+obj.target+" img")[0];
		this.curent_zoom_pane=jQuery("#"+obj.target);

		return false;
	},
	over:function(obj){
		this.curent_zoom_pane.show();
		var bar_width=Math.round(this.curent_img_small.width/(this.curent_img_large.width/this.zoom_pane.width()));
		var bar_height=Math.round(this.curent_img_small.height/(this.curent_img_large.height/this.zoom_pane.height()));
		this.bar.css({display:"block", width:bar_width, height:bar_height});
	},
	out:function(obj){
		this.curent_zoom_pane.hide();
		this.bar.css({display:"none"});
	},
	move:function(e){
		var top=e.pageY-this.move_pane.offset().top-(this.bar.height()/2);
		var left=e.pageX-this.move_pane.offset().left-(this.bar.width()/2);
		var max_top=this.move_pane.height()-this.bar.height();
		var max_left=this.move_pane.width()-this.bar.width();
		if(top<0) top=0;
		if(top>max_top) top=max_top;
		if(left<0) left=0;
		if(left>max_left) left=max_left;
		this.bar.css({top:top, left:left});
		jQuery(this.curent_img_large).css({top:-top*(this.curent_img_large.height/this.curent_img_small.height), left:-left*(this.curent_img_large.width/this.curent_img_small.width)});
	}
}
*/

