window.addEvent('domready', function() {

  /* external links */
  var objs = $$('a');
  objs.each(function(obj, i) {
    if (obj.get('href') && (obj.get('rel') == 'external')){
      obj.set('target', '_blank');
    }
  });

  /* IE hovers */
  if (Browser.Engine.trident){
    var objs = $$('button');
    objs.each(function(obj, i) {
      obj.addEvent("mouseover", function(event) {
        this.addClass('hover');
      });
    	obj.addEvent("mouseout", function(event) {
        this.removeClass('hover');
      });
    });
    var objs = $$('input').extend($$('textarea'));
    objs.each(function(obj, i) {
      obj.addEvent("focus", function(event) {
        this.addClass('focus');
    	});
    	obj.addEvent("blur", function(event) {
        this.removeClass('focus');
    	});
    });
  }

  if (Browser.Engine.trident4){
    $$('img.fixPNG').each(Browser.fixPNG);
  }

  /*var objs = $$('#fl-nav a');
  objs.each(function(obj, i) {
   obj.addEvent("mouseover", function(event) {
      var img = this.getElements('img')[0];
    });
  	obj.addEvent("mouseout", function(event) {
      var img = this.getElements('img')[0];
    });
  });*/

  if ($chk($('nav'))) {
    fobj = new Swiff('swf/nav.swf', {
      id: 'fObject',
      width: 160,
      height: 205,
      version: 8,
      container: 'nav',
      params: {
      	wmode: 'transparent',
      	bgcolor: '#000000'
      },
      vars: {
      	navID: $$('html')[0].get('id'),
        baseURL: $$('base')[0].get('href')
      }
    });
  }

  if ($chk($('fl-logo'))) {
    fobj = new Swiff('swf/logo.swf', {
      id: 'c2logo',
      width: 480,
      height: 270,
      version: 8,
      container: 'fl-logo',
      params: {
      	bgcolor: '#000000'
      },
      vars: {
      	vurl: 'logo.flv'
      }
    });
  }

  if ($chk($('flashmap'))) {
    fobj = new Swiff('swf/map_290909.swf', {
      id: 'fMap',
      width: 270,
      height: 230,
      version: 8,
      container: 'flashmap',
      params: {
        wMode: 'opaque',
      	bgcolor: '#899990'
      }
    });
  }

  var searchform = $$('#console input');
  var searchform_value = 'Enter keyword';
  searchform.addEvent('focus', function(event) {
    if ($(this).get('value') == searchform_value){
      $(this).set('value', '');
    }
  });
  var searchform = $$('#console button');
  searchform.addEvent('click', function(event) {
    if ($$('#console input')[0].get('value') == searchform_value){
      $$('#console input')[0].set('value', '');
    }
  });
  
  if ($chk($('fl-n'))){
  	var obj = $('fl-nav');
	  var Tip = new Tips(obj.getElements('a'), {
			className: 'tool-tip',
			offsets: {
				'x': -66,
				'y': 16
			}
		});
	  var mGR = new MerryGoRound(obj, {
	   selector : 'a'
	  });
	}

});

Cufon.replace('h2', {
  fontFamily: 'Eurostile'
});
Cufon.replace('#index h3', {
  fontFamily: 'Eurostile'
});
Cufon.replace('#wedding-videos h3', {
  fontFamily: 'Eurostile'
});
Cufon.replace('#my-big-day-links h3', {
  fontFamily: 'Eurostile'
});
Cufon.replace('#email-link h3', {
  fontFamily: 'Eurostile'
});