/*
 *Special for http://webcentre.ca/
 */
  var init_once = true;
  function getClientWidthGall(){var left = ($('body').width()-940)/2; $('#waterwheel-carousel-horizon').css('left', left);}
  function open_gall() {
	  $('#shadowDiv').show();
	  $('#waterwheel-carousel-horizon').show();
	  if(init_once) {
		$("#carousel-images").featureCarousel({
			trackerSummation : false,
			trackerIndividual : false,
			autoPlay : 0,
			topPadding : 0,
			sidePadding : 0,
			smallFeatureWidth : 0.84,
			smallFeatureHeight : 0.84,
			smallFeatureOffset : 20,
			carouselSpeed : 500,
			startingFeature : 10
        });
		init_once = false;
	  }
  }
  function close_gall(){$('#shadowDiv').hide(); $('#waterwheel-carousel-horizon').hide();}
  
  function CreateGall() {
	 $("body").prepend('<div class="shadowDiv" id="shadowDiv"></div>');
	 $("body").prepend('<div id="waterwheel-carousel-horizon" style="display:none;"></div>');
	 $("#waterwheel-carousel-horizon").append('<a class="closeGall" href="javascript:close_gall();"><img src="images/close.png" alt="" /></a>')
	 $("#waterwheel-carousel-horizon").append('<a class="viewPlan" href="compare.html"><img src="images/view_plans_gall.png" alt="" /></a>')
	 getClientWidthGall();
	 $("#waterwheel-carousel-horizon").append("<h1>webCentre.ca <span>Templates</span></h1><p>Here's a sample of the 1600+ template designs to choose from.</p>")
     $("#waterwheel-carousel-horizon").append('<div class="carousel-controls"></div>')
      	  $(".carousel-controls").append('<a class="carousel-prev" id="carousel-left" href="#"></a>')
      	  $(".carousel-controls").append('<a class="carousel-next" id="carousel-right" href="#"></a>')
     $("#waterwheel-carousel-horizon").append('<div id="carousel-images"></div>')
	 for (var i = 1; i<=20; i++){
		  var str = '<div class="carousel-feature"><img src="gallery/img-'+i+'.jpg" class="carousel-image" alt="" /></div>'
	      $("#carousel-images").append(str) 
	 }
  }
