//Custom JS

jQuery(function() {
	
	jQuery(".nav a").addClass("colorbox cboxElement");
	jQuery(".nav li:last-child").addClass("last");
	
});

//Gallery slider

jQuery(function(){

			jQuery.mbBgndGallery.buildGallery({
				containment:"body",
				timer:3000,
				effTimer:2000,
				controls:"#controls",
				grayScale:false,
				// If your server allow directory listing
				folderPath:"http://www.sirinec.com/wp-content/themes/Sirinec/elements/",
				onStart:function(){jQuery("#controls .play").hide();jQuery("#controls .pause").show();},
				onPause:function(){jQuery("#controls .play").show();jQuery("#controls .pause").hide();},
				onPlay:function(opt){jQuery("#controls .play").hide();jQuery("#controls .pause").show();},
				onChange:function(idx){
						var tekstovi = ["Više od nekretnine – dom iz snova", "Dostojno Vas i Vaše vizije", "Zamislite raj – neka postane Vaš", "Predobro da bi dugo čekalo na Vas", "Vatromet mogućnosti"];
						jQuery("#message").fadeOut(1000, function() {
								jQuery("#message").html(tekstovi[idx%5]).fadeIn(1000);	
							});
						jQuery("body.bgndGallery img").fadeOut(1000, function(){
								jQuery(this).fadeIn(1000);
							});
						
						}, //idx=the zero based index of the displayed photo
				onNext:function(opt){},   //opt=the options relatives to this component instance
				onPrev:function(opt){}   //opt=the options relatives to this component instance
			});
		});

// COLORBOX

jQuery(document).ready(function(){
	//Examples of how to assign the ColorBox event to elements
	jQuery(".colorbox").colorbox({width:"800px", height:"810px", iframe:true});
				
	//Example of preserving a JavaScript event for inline calls.
	jQuery("#click").click(function(){ 
		jQuery('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
		return false;
	});
});
