function auto_form(form_type) {
  ensure_modal_link('Callback', form_url_for(form_type));      
  if (!has_seen_shadowbox()) {
    create_shadowbox();
    set_shadowbox_expiration();
  }
}

function auto_signup_form() {
  auto_form('signup');	
}

function auto_callback_form() {
  auto_form('callback');
}

Evt.onDOMReady(function () {                     

  // HACK: Make cruise chick open callback window
  if (document.location.href.match(/\/cbooking\//)) {
    var callback_img = Dom.getFirstChildBy(Dom.get('contentright'), function(node) { 
      return Dom.hasClass(node, 'cruiseConsultantBeta');
    });
    Evt.on(callback_img, 'click', open_callback_window);
  }
  
  if (document.location.href.match(/bookedGuestLanding.html/) && YAHOO.util.Cookie.get('NCLWEBInt')) {
    YAHOO.util.Cookie.set('seen_modal', true, {domain: 'ncl.com', path: '/', expires: Date.today().addDays(1)}); 
  }   	                 
});
  
Evt.on(window, 'load', function () {                    
  // HACK: Show different phone number for Friends and Family
  if (Dom.get('ffAgencyId')) {      
    if (Dom.get('cruiseConsultantSearching300')) {
	    Dom.get('cruiseConsultantSearching300').src = '/csimages/942/712/FF_helpNumber_1.jpg';
    }
    
    if (Dom.get('cruiseConsultantSearchingDetail300')) {
	    Dom.get('cruiseConsultantSearchingDetail300').src = '/csimages/942/712/FF_helpNumber_1.jpg';
    }
    
    if (Dom.getElementsByClassName('cruiseConsultantBeta') && 0 < Dom.getElementsByClassName('cruiseConsultantBeta').length) {
	    Dom.getElementsByClassName('cruiseConsultantBeta')[0].src = '/csimages/815/590/FF_helpNumber_2.jpg';
    }
  }
  
  // Temporary place for auto-modal until next deployment
  if (!document.location.href.match(/agent/i) && 
	(document.location.href.match(/Sky2008/i) ||
	document.location.href.match(/cruisesearch/i) ||
	document.location.href.match(/MexicanRivieraStar/i) ||
	document.location.href.match(/HawaiiPOA/i) ||
	document.location.href.match(/BahamasSky/i) ||
	document.location.href.match(/CaribbeanNCL/i) ||
	document.location.href.match(/Promo/i) ||
      document.location.href.match(/Cruises/i) ||		
	document.location.href.match(/SouthAmericaSun/i) ||
	document.location.href.match(/BermudaMAJ/i) ||		
	document.location.href.match(/RevBan/i) ||		
	((document.location.href.match(/WLCN/i)) && !(document.location.href.match(/CLIA_WLCN/i))))){
    auto_signup_form();
  } 
});


