// JavaScript Document

var Site = {
	  
		init: function(){
			  
        /* target="_blank" replacement for all elements (not only a) */
        $$('._blank').each(function(element){
				    element.addEvent('click', function(event){
						    event.stop();
								window.open(element.get('href'));
						});
				});
				
				
				/* Clickable boxes */
				this.clickableBoxes = $$('.gallery-categories li');
				if (this.clickableBoxes){
					  this.clickableBoxes.setStyle('cursor', 'pointer');
						this.clickableBoxes.each(function(element){
								element.addEvent('click', function(event){
										window.location = element.getElement('a').get('href');
								});
						});
				}
				
				/* SmoothScroll */
				new SmoothScroll({
					duration: 700,
				  transition: Fx.Transitions.Quint.easeInOut
			  });
				
				/* Homepage Flash */
				if ($('flash')){
					$('flash-replacement').destroy();
					new Swiff('flash-hp.v2.swf', {
						id: 'homepage-flash',
						container: 'flash',
						width: 980,
						height: 270,
						params: {
								wmode: 'opaque'
						}
					});
				}
				
				/* Otevirani dveri */
				if ($('flash-nk-panty')){
					new Swiff('/vestavene-skrine/otevirani/flash/oteviraci-nk-dvere.swf', {
					  container: 'flash-nk-panty',
						width: 238,
						height: 389,
						params: {
							  wmode: 'transparent'
						}
					});
					$('flash-nk-panty').setStyle('margin', '0px auto');
				}
				
				if ($('posuvne-dvere-v-ramu')){
					new Swiff('/vestavene-skrine/otevirani/flash/posuvne-dvere-v-ramu.swf', {
					  container: 'posuvne-dvere-v-ramu',
						width: 238,
						height: 389,
						params: {
							  wmode: 'transparent'
						}
					});
					$('posuvne-dvere-v-ramu').setStyle('margin', '0px auto');
				}
				
				if ($('otocne-dvere-v-ramu')){
					new Swiff('/vestavene-skrine/otevirani/flash/otocne-dvere-v-ramu.swf', {
					  container: 'otocne-dvere-v-ramu',
						width: 238,
						height: 389,
						params: {
							  wmode: 'transparent'
						}
					});
					$('otocne-dvere-v-ramu').setStyle('margin', '0px auto');
				}				
				
				
				

		}
};

var Zoomer = {
	  init: function(){
			  ReMooz.assign('.remooz, .img-table a, .gallery a, .gallery-caption a', {
					'origin': 'images',
					'shadow': 'onOpen', // fx is faster because shadow appears after resize animation
					'resizeFactor': 0.9, // resize to maximum 80% of screen size
					'cutOut': false, // don't hide the original
					'opacityResize': 0, // opaque resize
					'dragging': true, // disable dragging
					'centered': true // resize to center of the screen, not relative to the source element
				});
		}
};



window.addEvent('domready', function(){

 // Site.init();
	
	Zoomer.init();
	
	//if ($('form-contact') || $('form-order')) FormValidation.init();

});

