<!--//--><![CDATA[//><!--
				  
				  
// ----- jQuery Init -------------------------------------------------------//


		jQuery(document).ready(function($) { 
																							
				$("ul.sf-menu").superfish().find('ul').bgIframe({opacity:false}); // ----- superfish vertical menu--------//
				
				$("div.scrollable").scrollable({nextPage:'.goNextPage', prevPage:'.goPrevPage',size:1,clickable:false}).autoscroll({steps:1,autoplay:true,interval:7000}).circular();	// ----- scrollable header banners --------//
				
				$("div.scrollable2").scrollable({nextPage:'.goNextPage2', prevPage:'.goPrevPage2',size:1,clickable:false}).autoscroll({steps:1,autoplay:true,interval:9000}).circular();	// ----- scrollable featured banners --------//
				
				$("div.scrollableGallery").scrollable({nextPage:'.goNextPage3', prevPage:'.goPrevPage3',size:4});	// ----- scrollable image gallery --------//
				
                $("div.scrollableGallery  > .items a").click(function(e){ 	// ----- scrollable image gallery --------//
                    e.preventDefault();
                    // calclulate large image's URL based on the thumbnail URL (flickr specific)
                    var url = $(this).attr("href")
                    // get handle to element that wraps the image and make it semitransparent
                    var wrap = $("#imageGallery");
					$("#imageGallery img.large").fadeTo("fast", 0.1);
					wrap.find("div.description").html($(this).attr("title"));
                    // the large image from flickr
                    var img = new Image();
                    // call this function after it's loaded
                    img.onload = function(){
                        // make wrapper fully visible
                       $("#imageGallery img.large").fadeTo("fast", 1);
                        // change the image
                        wrap.find("img.large").attr("src", url);
                    };
                    // begin loading the image from flickr
                    img.src = url;
                    // when page loads simulate a "click" on the first image
                }).filter(":first").click();
				
				
				$("ul#product-nav a").each(function() { // ----- product menu --------//
						if(jQuery("ul#product-nav a").next())
							{
								jQuery(this).addClass("expand");
							}
						});
						jQuery(".expand").click().toggle(
							function(event) {
								jQuery(this).addClass("active");
								jQuery(this).next().addClass("expanded");
									if (jQuery(this).attr("href") != "#")
										{
											document.location = jQuery(this).attr("href");
										}
									},
							function(event) {
								jQuery(this).removeClass("active");
								jQuery(this).next().removeClass("expanded");
						}
					)
				});
		
// ----- Browser hacks and fixes -------------------------------------------------------//
		  
		jQuery(document).ready(function($) { 
			if(jQuery.browser.msie) {
				if(jQuery.browser.version < 8.0 ) {
					$("fieldset.advancedSearch label").css("margin-bottom", "6px");
					$(".rightGrayBox select").css("padding", "0px");
				}
			}
			if(jQuery.browser.opera) {
					$("fieldset.advancedSearch label").css("margin-bottom", "6px");
			}
  		});		

// ----- DW -------------------------------------------------------//	
				
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// ----- IE6 background image flicker fix -------------------------------------------------------//

(function() {
			var m = document.uniqueID && document.compatMode && !window.XMLHttpRequest && document.execCommand;
				try{ if(!!m){ m("BackgroundImageCache", false, true)}}catch(oh){};
			}
		)();

// ----- add bookmark -------------------------------------------------------//

function bookmarkMe(myUrl, myTitle) {
	
        if(window.sidebar) {
			
               //******************************//
               // Firefox is used
               // We can just prompt the user
               // to add a regular bookmark...
                //******************************//

               alert('Please press CTRL+D to bookmark this page!');

               //******************************//
               // ... or we can add a 'sidebar' bookmark.
               // To do it, use the line below,
               // instead of the line above:
               //******************************//

               // window.sidebar.addPanel(myTitle, myUrl, '');

               //******************************//
               // In the second case, you can
               // give the visitor additional information.
               // to do it, uncomment the lines below
               //******************************//

               // var msg = "Firefox has just added the bookmark ";
               // msg += "that will open in the sidebar by default.\n";
               // msg += "If you want it to open in the main window instead, ";
               // msg += "please go to Bookmarks, right-click the recently ";
               // msg += "added bookmark, choose 'Properties' and uncheck the ";
               // msg += "'load this bookmark in the sidebar' option.\n\n";
               // msg += "Sorry, this in unavoidable with Firefox so far.";
               // alert(msg);
        }
        else if(window.opera && window.print)
        {
               //******************************//
               // Opera is used
               //******************************//

               var bkmark = document.createElement('a');
               bkmark.setAttribute('rel','sidebar');
               bkmark.setAttribute('href', myUrl);
               bkmark.setAttribute('title', myTitle);
               bkmark.click();
        }
        else if(document.all)
        {
               //******************************//
               // Most probably IE, but even if it's not,
               // we don't want an error to pop up
               // so we use the try-catch structure
               //******************************//

               try
               {
                       window.external.AddFavorite(myUrl, myTitle);
               }
               catch(e)
               {
                       //******************************//
                       // oops! not IE. Prompt user for action.
                       //******************************//

                       var msg = "Sorry, your browser doesn't allow scripts ";
                       msg += "to add bookmarks.\n";
                       msg += "Please use your browser's keyboard shortcut ";
                       msg += "(most commonly CTRL+D) to add a bookmark.";
                       alert(msg);
               }
        }
}

// ----- set homepage -------------------------------------------------------//

function IsBrowser(strBrowserName) {
	 var booBrowserFound = false;
	 if (navigator.userAgent.indexOf(strBrowserName) != -1) {
		 booBrowserFound = true;
		 }
	 return booBrowserFound;
		 }

function setAsHomepage(pocetna) {
 
	if( IsBrowser("MSIE") ) {
		 pocetna.style.behavior='url(#default#homepage)';
		 pocetna.setHomePage('http://www.luxurycroatia.com/');
	 } 
	 
	 else if( IsBrowser("Opera") || IsBrowser("Firefox") ) {
			var msg = "Sorry, your browser doesn't allow scripts ";	
			msg += "to change default homepage.\n";
			msg += "Please drag this link onto Home Page icon in your browser.";
			alert(msg);
			}
}

// ----- Booking.com -------------------------------------------------------//

		function checkDate(){
			var currentDate = new Date();
			var currentYear = 1900 + currentDate.getYear();
			var dailyMS = 24 * 60 * 60 * 1000;
			var arrivalDate = new Date(currentDate.getTime());
			var departureDate = new Date(currentDate.getTime() + 1 * dailyMS);
			var arrivalYear = 1900 + arrivalDate.getYear();
			var arrivalMonth = 1 + arrivalDate.getMonth();
			var arrivalDay = arrivalDate.getDate();
			var departureYear = 1900 + departureDate.getYear();
			var departureMonth = 1 + departureDate.getMonth();
			var departureDay = departureDate.getDate();
			var checkin_monthday = $("#checkin_monthday");
			var checkin_month = $("#checkin_month");
			var checkin_year = $("#checkin_year");
			var checkout_monthday = $("#checkout_monthday");
			var checkout_month = $("#checkout_month");
			var checkout_year = $("#checkout_year");
			if ((checkin_monthday[0].selectedIndex == 0) && (checkin_month[0].selectedIndex == 0) && (checkin_year[0].selectedIndex == 0) &&
			(checkout_monthday[0].selectedIndex == 0) &&
			(checkout_month[0].selectedIndex == 0) &&
			(checkout_year[0].selectedIndex == 0)) {
			
				checkin_monthday[0].options[arrivalDay - 1].selected = true;
				checkin_month[0].options[arrivalMonth - 1].selected = true;
				checkin_year[0].options[arrivalYear - currentYear].selected = true;
				checkout_monthday[0].options[departureDay - 1].selected = true;
				checkout_month[0].options[departureMonth - 1].selected = true;
				checkout_year[0].options[departureYear - currentYear].selected = true;
			}
		}
		
		$(function(){
			if($(".bookNow").length > 0) {
				//	checkin_year checkout_year
				var html = "";
				var currentDate = new Date();
				var currentYear = currentDate.getYear();
				if (currentYear < 2000) {
					currentYear += 1900;
				}
				for (var cnt = 0; cnt <= 1; cnt++) {
					html += '<option value="' + currentYear + '">' + currentYear + '</option>'
					currentYear++;
				}
				$("#checkin_year").html(html);
				$("#checkout_year").html(html);
				checkDate();
			}
		})

//--><!]]>



