Modernizr.load([
{
	load: '/manager/include/scripts/jquery/jquery.extras.common.js'
}, {
	load: '/manager/include/scripts/jquery/jquery.mbBookShowcase.js'
}, {
	load: '/manager/include/scripts/jquery/jquery.superfish.js'
}, {
	load: '/manager/include/scripts/scripts.js',
    	complete: function () {
      		$(function () {
      			
			//if(scripts_isIE6) $(document).pngFix();
		
			$("a[rel^='lightbox']").prettyPhoto({
					animationSpeed: 'slow',
					padding: 40,
					opacity: 0.85,
					showTitle: false,
					allowresize: true,
					counter_separator_label: '/',
					theme: 'light_rounded'
			});
			
			$("a.ro").mbRollover();
			
			$('#nav').superfish({
			        delay:       1000,                            // one second delay on mouseout 
			        animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
			        speed:       'fast',                          // faster animation speed 
			        autoArrows:  false,                           // disable generation of arrow mark-up 
			        dropShadows: false                            // disable drop shadows
			});
			
			if ($.fn.mbBookShowcase) {
			        $("#tray-wrapper").mbBookShowcase({
			            targetTray: 'showcaseTrays', //div id of tray in your php fetch file trays.php
			            detailsImg: 'book',
			            itemClass: 'book',
			            imgClass: 'bookImg',
			            mOvrClass: 'book-ovr',
			            selClass: 'book-sel',
			            phpFetchFile: 'trays.php',
			            klass: 'mbBookShowcase',
			            bookId: g_showcaseRecord,
			            followLink: true,
			            loadTrayFromExternalFile: true
				}, function() {
			            var str = this.clickid;
			            str = str.substring(1);
			            $("#showcaseHiddenRecord").val(str);
			            if (this.event == "click") {
			                $.ajax({
			                    url: "/showcaseSaveItem.php?record=" + str,
			                    error: function(jqXHR, textStatus, errorThrown){
			                    	if(typeof console != "undefined")
			                    		console.log("Error: " + jqXHR.statusText + " -- " + textStatus + ", trown = " + errorThrown);
			                    }
			                });
			            }
			        });
			
			        $("#book").live('click', function () {
			            document.showcaseForm.submit();
			        });
			}
			
			if (!("placeholder" in document.createElement("input")))
			{
				$('input[placeholder]').placeholder();
			}
			
			var marqlen = $('#marquee .marquee').length;
			if( $('#marquee').length > 0 )
   			{
   				
    				if(marqlen > 1) startFlip($(".marquee").length);
    				var $hotwrap;
    				$(".marquee").hover(function(){
    					resetFlip();
    					$hotwrap = $(this).children("div.lyrRel").children("div.hotspotwrap");
    					$hotwrap.fadeIn(function(){
    						$(this).children("div.hotspot").each(function(){
    							$hotspot = $(this);
    							$hotspot.fadeIn(1000, function(){
    								//$(this).animate({top: "-=20px"}, 1000);
    							});
    						});
    					});
    				}, function(){
    					if(marqlen > 1) startFlip($(".marquee").length);
    					$hotwrap.fadeOut();
    				});
    			}
    			var theform = document.quickSearchForm;
    			$("#srchsubmit").click(function(){
				$input = $("#srchinput input");
				if( $input.attr("value") == $input.attr("placeholder") ) 
					$input.attr("value", "");
						
				theform.submit();
			});
			
			if( $("#ctaLeft").length > 0) {
				var ht = $("#featuredLeft").height();
				var minht = ht + 143;
				//alert(minht);
				$("#mainContent").css("min-height", minht + "px"); 
			}
			
			if($("html").hasClass("ie7"))
			{
				$(".clearfix").removeClass("clearfix").addClass("clear");
			}

      		});
	}
}
]);

/*
loaded in details since only place being used currently
$(window).load(function(){
    	var html = '<iframe src="http://www.facebook.com/plugins/like.php?app_id=250327578312530&amp;href='+current_url+'&amp;send=false&amp;layout=button_count&amp;width=73&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:73px; height:21px;" allowTransparency="true"></iframe>';
    	$('#share-box-fblike').append(html);
    	// if using async version of addthis init here:
    	addthis.init();
});
*/

(function() {
  var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
  po.src = 'https://apis.google.com/js/plusone.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
