$(function() {
	if (!$.browser.msie) $("#mainBoxes div.img").append("<img src='" + templateUrl + "images/shadow-inner.png' class='shadow' />");
	else if ($.browser.msie && $.browser.version == 6) $('#logo a,a.buttonLarge').ifixpng();
	

    $('.flexslider').flexslider({
          animation: "slide"
          // controlsContainer: ".flex-container"
    });
	
		// 
		//     $('#headerImages').cycle({
		// 	fx: 'fade'
		// });
	
	$("#mainBuy tbody tr:odd").addClass("odd")
	
	$('#search input[type=text]').clearDefault();
	
	// google maps
	if ($("#gMap").length) {
		var latlng = new google.maps.LatLng(59.40982,5.2733);
		var myOptions = {
			zoom: 14,
			scrollwheel: false,
			center: latlng,	
		    disableDefaultUI: true,
		    navigationControl: true,
			mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("gMap"), myOptions);
		var marker = new google.maps.Marker({
			position: latlng, 
			map: map,
			title:"Her finner du Haubo"
		});	
	}
});

(function($){
	$.fn.clearDefault = function(){
		return this.each(function(){
			var default_value = $(this).val();
			$(this).focus(function(){
				if ($(this).val() == default_value) $(this).val("");
			});
			$(this).blur(function(){
				if ($(this).val() == "") $(this).val(default_value);
			});
		});
	};
})(jQuery);
