
jQuery(document).ready(function() {

	/* Design tweaks */
	// $('li.headlink:first a:first').css('border', '0px');
	// $('li.headlink ul').css('opacity', 0.9);
	// $('li.headlink a').css('position', 'relative');
	
	/* Generate divs for background */
	// $('li.headlink').prepend("<div> </div>");
	// $('li.headlink div').css('opacity', 0);

	/*
	$('li.headlink').hover(function(){		
		$(this).children('div:first').stop();
		$(this).children('div:first').animate({ 
			opacity: 1
		}, 600 );

	},function(){
		$(this).children('div:first').stop();
		$(this).children('div:first').animate({ 
			opacity: 0
		}, 300 );
	});*/
	
	//dropdown menu effect slowly
	$('li.headlink ul').css('height', '0px');
	
	$('li.headlink').hover(function() {
			$(this).children("ul").stop();
			$(this).children("ul").animate( { height:"300px" }, 1500 );
	}, function(){
			$(this).children("ul").stop();			
			$(this).children("ul").animate( { height:"0px" }, 1000 , function(){
				$(this).css('display','none');
			});
	});
	
	/* Slideshow */

	
	/* selector */
	
	$('div.selector').prepend("<div class=\"effect\"> </div>");
	$('div.selector').append("<div class=\"hover\"> </div>");
	
	$('div.selector div.effect').css('opacity', 0);
	
	$('div.selector div.hover').hover(function() {
			$(this).siblings("div.effect").css('opacity', 0);
			$(this).siblings("div.effect").stop();
			$(this).siblings("div.effect").animate( { opacity: 1 }, 700 );
	}, function(){
			$(this).siblings("div.effect").stop();			
			$(this).siblings("div.effect").animate( { opacity: 0 }, 500 , function(){
			});
	});
	
	$.validationEngineLanguage.hrLang();
	
	$("[class^=validate]").validationEngine({
		success : function() { return callSuccessFunction() }, 
		failure : function() { return callFailFunction()  } 
	})
	
	$(".containerPlus").buildContainers({
        containment:"document",
        elementsPath:"js/mbContainerPlus/elements/",
        onResize:function(o){},
        onClose:function(o){ callCloseFunction() },
        onCollapse:function(o){},
        onIconize:function(o){},
        onDrag:function(o){}
      });
	
	$("#messagebox").css('position', 'absolute');
	$("#messagebox").mb_BringToFront();
	
	$("#messagebox a.button_1").click(function() {
		$("#messagebox").mb_close();
		
		return false;
	});
	
    jQuery('#mySlideGallery').jcarousel({
    	
    });

	$("a[rel^='prettyPhoto']").prettyPhoto();

});









