/*************************************************************************/
/*                                                                 		 */
/*    JAVASCRIPT DOCUMENT                                		   		 */
/*    Revision 1.0 - Januar 29. 2010. - Marija					  		 */
/*                                                             	  	     */
/*************************************************************************/



// when the DOM is ready:
$(document).ready(function () {
						
  /* -- HIDE MAIL -- */
   $('.hide-email').each(function() {
      var $email = $(this);
      var address = $email.text().replace(/\s*\[at\]\s*/, '@')
                                 .replace(/\s*\[dot\]\s*/g, '.');
      $email.html('<a href="mailto:' + address + '">' + address + '</a>');
   });
   
});

/* --- superfish -- */
    $(document).ready(function(){ 
        $("ul.sf-menu").superfish(); 
    }); 
 


/* -- SCROLL TO TOP --*/
$(document).ready(function() {
   
    $('a[href=#top]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });

});


/* --- HOME SLIDER --*/


(function($) {
        function init() {

          $(".slider").fadeTransition({pauseTime: 10000,
                                                 transitionTime: 1000,
                                                 delayStart: 10000,
                                                 pauseOnMouseOver: true,
                                                 createNavButtons: true});
                                                 
        
                                                 
     
                                                  
         
        }
        
        
        $(document).ready(init);
      })(jQuery);


/* --- INNER IMAGES -- */
 $(document).ready(function () {
var slideIntervalId = 0;
setSlideInterval = function(){
slideIntervalId = setInterval ( "$('a.ppy-next').click()", 5000 );
}
stopSlideInterval = function(){
clearInterval ( slideIntervalId );
}
$(document).ready(function () {
var options = {
caption: 'permanent',
opacity: 1,
direction: 'left'
}

$('#pop').popeye(options);
setSlideInterval();

$('div.ppy-stage').mouseenter(function(){
stopSlideInterval();
}).mouseleave(function(){
setSlideInterval();
});
});

  });
   
   
/* TABS*/

$(document).ready(function() {

	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});

});



/* SLIDE LABLES*/
  $(document).ready(function(){

	$('#contactform').slidinglabels({

		/* these are all optional */
        className    : 'slide-label', // the class you're wrapping the label & input with -> default = slider
		topPosition  : '5px',  // how far down you want each label to start
		leftPosition : '5px',  // how far left you want each label to start
		axis         : 'y',    // can take 'x' or 'y' for slide direction
		speed        : 'fast'  // can take 'fast', 'slow', or a numeric value

	});

});

