function initFBLike(){
	if ($('FBLike') != null) {
		$('FBLike').update('<iframe src="http://www.facebook.com/plugins/like.php?href='+escape(location.href)+'&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>');
	}
}
var g,gtl; //Growler
document.observe("dom:loaded", function() {
	if ($('footer') != null) {
		Effect.Appear.delay(4,'footer', { duration: 3.0});	
	}
	g = new k.Growler({width: '266px'});
	gtl = new k.Growler({width: '460px', location: 'tl'});
	new ProtoFish('mainMenu', '200', 'hover', false, true, true);
	if ($('myGallery') != null) {
		var myGallery = new Gallery($('myGallery'), {
			showArrows: true,
			showCarousel: true,
			showInfopane: true,
			thumbHeight: 66,
			thumbWidth: 100,
			embedLinks: false,
			middlePause: true,
			fadeDuration: 1.0,
			timed: true,
			delay: 6000,
			slideInfoZoneOpacity: 0.7,
			carouselMinimizedOpacity: 0.4,
			carouselMinimizedHeight: 20,
			carouselMaximizedOpacity: 0.7,
			destroyAfterPopulate: true,
			baseClass: 'swGallery',
			withArrowsClass: 'withArrows',
			useThumbGenerator: true,
			thumbGenerator: 'utils/resizer.php'
			});
	}
	initFBLike();
	if ($('logo') != null) {
		Effect.Appear('logo', { duration: 2.0});
	}
	if ($('data') != null) {
		Effect.ScrollTo.delay(1.1, 'data');
	}
	return false();
});	

Element.addMethods('iframe', {
document: function(element) {
  element = $(element);
  if (element.contentWindow)
      return element.contentWindow.document;
  else if (element.contentDocument)
      return element.contentDocument;
  else
      return null;
},
$: function(element, frameElement) { 
  element = $(element);
  var frameDocument = element.document();
  if (arguments.length > 2) {
      for (var i = 1, frameElements = [], length = arguments.length; i < length; i++)
          frameElements.push(element.$(arguments[i]));
      return frameElements;
  }
  if (Object.isString(frameElement))
      frameElement = frameDocument.getElementById(frameElement);
  return frameElement || element;
}
});
document.domain = "jhorstphotography.com";
function oniFrameLoad(id){
try {
//	if ($(id).src.length > 46) {
//		window.location.hash = $(id).src.substring(46);
//	}
	if($(id).contentDocument){
		$(id).height = $(id).contentDocument.body.offsetHeight + 35;
		//$(id).contentDocument.body.scroll = 'no';
	} else {
		$(id).height = $(id).contentWindow.document.body.scrollHeight;
		//$(id).contentWindow.document.body.scroll = 'no';
	}
	//$(id).scrolling = "no";
	//$(id).verticalscrolling = "no";
	//$(id).setStyle({'overflow-y': 'hidden', 'overflow-x': 'hidden'});
} catch(err) {};
}

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17563879-1']);
  _gaq.push(['_setDomainName', '.jhorstphotography.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
