
jQuery(document).ready(function() {

	/* Automated sidebar top/bottom finishing graphics */

	if(!(jQuery.browser.msie && jQuery.browser.version=="6.0")){

	jQuery('.sidebar').wrapInner('<div class="sidebar"></div>').prepend('<div class="top_sidebar_mask"></div>').append('<div class="bottom_sidebar_mask"></div>').removeClass('sidebar');

	//jQuery('.sidebar_mirror').wrapInner('<div class="sidebar_mirror"></div>').prepend('<div class="top_sidebar_mask_mirror"></div>').append('<div class="bottom_sidebar_mask_mirror"></div>').removeClass('sidebar_mirror');

	};
	/* Inner HR autofill */

	jQuery('.inner_main .hr').append('<div class="inner_hr"></div>');

	/* Hack for all browsers to load the slider nicier way. The #slider has default property of display:none in css(for nice IE loading), then when js is loaded it changes to block (so Opera can

	render height of the slider properly while loading images), and then hides it again. Later, when all images are loaded - the fadeIn function kicks in. */

	jQuery('#slider').css({display: "block"}).hide();

	

	/* Spyglass icon on hover over images */

	jQuery('.zoomer img').hover(function(){
		//jQuery(this).animate({"opacity": "1"},{queue:true,duration:50});

	}, function() {
		//jQuery(this).animate({"opacity": ".3"},{queue:true,duration:50});

	});

	jQuery("area[rel^='prettyPhoto']").add('.zoomer').prettyPhoto();

});

/* End of onstart functions */

/* Start of functions initialized after full load of page */

jQuery(window).load(function(){
	/* Load the slider nicely with fade-in effect and wait till all images are loaded */
	jQuery('#slider').fadeIn(900);

	jQuery('.inner_main .loader').css({display: "none"});

	/* Innitialize Nivo Slider */

	jQuery('#slider').nivoSlider({

	directionNav:false,

	captionOpacity:0.85,

	slices:10,

	pauseTime:6000,

	keyboardNav:true,

	pauseOnHover:true

	});
	/* Add special rounded corners to the Slider */

	jQuery('.inner_main .nivoSlider').append('<div class="slider_cover_tl png_bg"></div><div class="slider_cover_tr png_bg"></div><div class="slider_cover_br png_bg"></div><div class="slider_cover_bl png_bg"></div>');
	/* Make the Slider navigation bullets align to center automaticly */

	var dotsMargin = jQuery('.inner_main .nivo-controlNav').width();
	jQuery('.inner_main .nivo-controlNav').css('margin-left', -dotsMargin/2);
});
