  window.close_shadow = Shadowbox.close;    
  var ShadowboxOptions = {
    overlayOpacity: 0.65, 
    noTroubleshooting: true,
    viewportPadding: 0, 
    assetURL: 'http://callback.ncl.com/',
    text: {
	  title: "this is the title",
      cancel: 'Cancel', 
      loading: 'Loading',
      close: '',
      next: '<span class="shortcut">N</span>ext',
      prev: '<span class="shortcut">P</span>revious',
      errors: {
        single: 'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',
        shared: 'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',
        either: 'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'
      }
    }
  };
    
  function has_seen_shadowbox() {
    return YAHOO.util.Cookie.get("seen_modal");
  }  
  
  function isFamilyAndFriends() {
    return (Dom.get("ffAgencyId") != null);
  }  
  
  function shadowbox_link() {
    return Dom.get('modal_link');
  }
  
  function ensure_modal_link(type, link) {
    if (shadowbox_link()) {
      shadowbox_link().parentNode.removeChild(shadowbox_link());
    }
    return ce('a', {
        'id': 'modal_link', 
        'rel': 'shadowbox;width=719;height=489;',
        'href': link,
	    'title': "<img  src='http://callback.ncl.com/images/close.gif' />",
	    'style': 'visibility:hidden'
    }, type, document.body);
  }
  
  function set_shadowbox_expiration(date_to_expire) {    
	var options = {path: "/"};
	if (date_to_expire) { options.expires = date_to_expire; }
  	YAHOO.util.Cookie.set("seen_modal", "true", options);
  }
  
  function create_shadowbox() {
    if(isFamilyAndFriends()){return;}
    if (!shadowbox_link()) {return;} 
    Shadowbox.init(ShadowboxOptions);                      
    Shadowbox.open(Dom.get('modal_link'));
    Evt.onAvailable("shadowbox_title_inner", function(){
	    Evt.on(Dom.get("shadowbox_title_inner"), "click", function(){
		    Shadowbox.close();
	    });
    });
  }

  function form_url_for(form_type) {return 'http://callback.ncl.com/' + form_type + '?no_close=true&ref=' + document.location.href;}  

  function open_callback_window(e) { 
	if (e) {Evt.stopEvent(e);}
	ensure_modal_link('Callback', form_url_for('callback'));      
    create_shadowbox();
  }    
  
  function open_signup_window(e) { 
    if (e) {Evt.stopEvent(e);}
	ensure_modal_link('Signup', form_url_for('signup'));      
    create_shadowbox();    
  }    

Evt.onDOMReady(function () {            
    var phone_img = Dom.get("toll_free_image_btn");
    if (phone_img)
    {
        Evt.on(phone_img, 'click', open_callback_window);
    }
});
  