
// Create tabs at index.html


$(document).ready(function() {
		$("#tabs").tabs({
			load: function(event, ui) {
			
			$("button, input:submit, a", ".demo").button({
            icons: {
                primary: 'ui-icon-document'
            }
        });  
        
        var accOpts = {
  alwaysOpen:false,
  autoHeight:true,
  collapsible: true,
  fillSpace: true
};
		$("#effect").hide();
		$("#effect2").hide();		 
	    $("#testar").hide();

	    $("#testar").fadeIn(2500, function () {
	            $("#effect").fadeIn(1000);
	            $("#effect2").fadeIn(2000);
	    });


	$(function() {
		$("#accordion").accordion(accOpts);
	});
	
	$(function() {
		$("#accordionResizer").resizable({
			resize: function() {
				$("#accordion").accordion("resize");
			},
			minHeight: 140
		});
	});

  $(function() {
    //$('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
    //$('img.image1').data('ad-title', 'Title through $.data');
   // $('img.image2').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
   // $('img.image3').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
    var galleries = $('.ad-gallery').adGallery({
  loader_image: 'loader.gif',
  width: 800, // Width of the image, set to false and it will read the CSS width
  height: 400, // Height of the image, set to false and it will read the CSS height
  effect: 'fade',
  thumb_opacity: 0.7
});
    $('#switch-effect').change(
      function() {
        galleries[0].settings.effect = $(this).val();
        return false;
      }
    );
    $('#toggle-slideshow').click(
      function() {
        galleries[0].slideshow.toggle();
        return false;
      }
    );
  });
  
   $(function() {
    //$('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
    //$('img.image1').data('ad-title', 'Title through $.data');
   // $('img.image2').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
   // $('img.image3').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
    var galleries = $('.ad-gallery2').adGallery({
  loader_image: '../images/loader.gif',
  width: 545, // Width of the image, set to false and it will read the CSS width
  height: 490, // Height of the image, set to false and it will read the CSS height
  effect: 'fade',
  image_wrapper: false,
  gallery_info: false,
  wrapper: false,
  nav: false,
  thumb_opacity: 0.7,
    slideshow: {
    enable: false
   }

});
   });


        
/*
var galleries = $('.ad-gallery').adGallery({
  loader_image: 'loader.gif',
  width: 600, // Width of the image, set to false and it will read the CSS width
  height: 400, // Height of the image, set to false and it will read the CSS height
  thumb_opacity: 0.7, // Opacity that the thumbs fades to/from, (1 removes fade effect)
                      // Note that this effect combined with other effects might be resource intensive
                      // and make animations lag
  start_at_index: 0, // Which image should be displayed at first? 0 is the first image
  animate_first_image: false, // Should first image just be displayed, or animated in?
  animation_speed: 400, // Which ever effect is used to switch images, how long should it take?
  display_next_and_prev: true, // Can you navigate by clicking on the left/right on the image?
  display_back_and_forward: true, // Are you allowed to scroll the thumb list?
  scroll_jump: 0, // If 0, it jumps the width of the container
  slideshow: {
    enable: true,
    autostart: true,
    speed: 5000,
    start_label: 'Start',
    stop_label: 'Stop',
    stop_on_scroll: true, // Should the slideshow stop if the user scrolls the thumb list?
    countdown_prefix: '(', // Wrap around the countdown
    countdown_sufix: ')',
    onStart: function() {
      // Do something wild when the slideshow starts
    },
    onStop: function() {
      // Do something wild when the slideshow stops
    }
  },
  effect: 'slide-hori', // or 'slide-vert', 'resize', 'fade', 'none' or false
  enable_keyboard_move: true, // Move to next/previous image with keyboard arrows?
  cycle: false, // If set to false, you can't go from the last image to the first, and vice versa
  // All callbacks has the AdGallery objects as 'this' reference
  callbacks: {
    // Executes right after the internal init, can be used to choose which images
    // you want to preload
    init: function() {
      // preloadAll uses recursion to preload each image right after one another
      this.preloadAll();
      // Or, just preload the first three
      //this.preloadImage(0);
      //this.preloadImage(1);
      //this.preloadImage(2);
    },
    // This gets fired right after the new_image is fully visible
    afterImageVisible: function() {
      // For example, preload the next image
      var context = this;
      this.loading(true);
      this.preloadImage(this.current_index + 1,
        function() {
          // This function gets executed after the image has been loaded
          context.loading(false);
        }
      );

      // Want slide effect for every other image?
      if(this.current_index % 2 == 0) {
        this.settings.effect = 'slide';
      } else {
        this.settings.effect = 'fade';
      }
    },
    // This gets fired right before old_image is about to go away, and new_image
    // is about to come in
    beforeImageVisible: function(new_image, old_image) {
      // Do something wild!
    }
  }
});

*/
 	
			},
			cache: false,
			ajaxOptions: {
				cache: false,
				error: function(xhr, status, index, anchor) {
					$(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible. If this wouldn't be a demo.");
				}
			}
		});
	});

			
// The fade in animation at index.html
	$(window).load(function () {
//		$("#effect").hide();
//		$("#effect2").hide();		 
//	    $("#testar").hide();
	       
//	    $("#testar").fadeIn(2500, function () {
//	            $("#effect").fadeIn(1000);
//	            $("#effect2").fadeIn(2000);
//	    });
	});

// Open the dialogs

	$.fx.speeds._default = 500;
	$(function() {
		$('#dialog').dialog({
			autoOpen: false,
			show: 'clip',
			hide: 'clip'
		});
		
		$('#opener').click(function() {
			$('#dialog').dialog('open');
			return false;
		});
	});
	
	$(function() {
		$('#contactdialog').dialog({
			autoOpen: false,
			show: 'clip',
			hide: 'clip'
		});
		
		$('#contactopener').click(function() {
			$('#contactdialog').dialog('open');
			return false;
		});
	});
	
	$(function() {
		$('#languagedialog').dialog({
			autoOpen: false,
			show: 'clip',
			hide: 'clip'
		});
		
		$('#languageopener').click(function() {
			$('#languagedialog').dialog('open');
			return false;
		});
	});

// Create button at wallmounted.html

 $(function() {
		$("button, input:submit, a", ".demo").button({
            icons: {
                primary: 'ui-icon-document'
            }
        });    
	});
// Create slideshow at wallmounted.html
/*
  $(function() {
    //$('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
    //$('img.image1').data('ad-title', 'Title through $.data');
   // $('img.image2').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
   // $('img.image3').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
    var galleries = $('.ad-gallery').adGallery();
    $('#switch-effect').change(
      function() {
        galleries[0].settings.effect = $(this).val();
        return false;
      }
    );
    $('#toggle-slideshow').click(
      function() {
        galleries[0].slideshow.toggle();
        return false;
      }
    );
  });
  */
 

