// 2.1 Static invite-widget-production.js
if(!inviteButtons) throw new Error("You appear to be missing the core invite javascript file in the head of the document.");
//alert("inviteModalInDom: " + inviteModalInDom + ", inviteIE: " + inviteIE);
if(inviteIE) {
	//we need to postpone adding the modal to the dom until after onload.
	if(!inviteAddedToOnloadInIE && !inviteModalInDom) {
		//if we're doing autolaunch in ie...wait until later.
		if(!inviteAutoLaunch) {
			i_addLoadEvent(inviteOnLoad);
			inviteAddedToOnloadInIE=true;//only do this once.
		}
	}
} else {
	//we can add the modal now if needed.
	if(!inviteModalInDom) {
		inviteModal.write();
		inviteModalInDom = true;
	}
}
var inviteOptions = { version:typeof invite_widget_version=='string'?invite_widget_version:'',
	inviteId:typeof invite_id=='string'?invite_id:'',
	partnerId:typeof invite_partner_id=='string'?invite_partner_id:'',
	url:window.location.href,
	title:typeof invite_title=='string'?invite_title:'',
	location:typeof invite_location=='string'?invite_location:'',
	date:typeof invite_date=='string'?invite_date:'',
	eventUrl:typeof invite_event_url=='string'?invite_event_url:'',
	artist:typeof invite_artist=='string'?invite_artist:'',
	venue:typeof invite_venue=='string'?invite_venue:'',
	venueUrl:typeof invite_venue_url=='string'?invite_venue_url:'',
	timeStart:typeof invite_start_time=='string'?invite_start_time:'',
	timeEnd:typeof invite_end_time=='string'?invite_end_time:'',
	timeShow:typeof invite_show_time=='string'?invite_show_time:'',
	timeDoors:typeof invite_door_time=='string'?invite_door_time:'',
	imageUrl:typeof invite_image_url=='string'?invite_image_url:'',
	seating:typeof invite_seating=='string'?invite_seating:'',
	audience:typeof invite_audience=='string'?invite_audience:'',
	ticketsRequired:typeof invite_tickets_required=='string'?invite_tickets_required:'',
	ticketUrl:typeof invite_tickets_url=='string'?invite_tickets_url:'',
	ticketsGeneral:typeof invite_tickets_general_admission=='string'?invite_tickets_general_admission:'',
	ticketsReserved:typeof invite_tickets_reserved=='string'?invite_tickets_reserved:'',
	minPrice:typeof invite_tickets_min_price=='string'?invite_tickets_min_price:'',
	maxPrice:typeof invite_tickets_max_price=='string'?invite_tickets_max_price:'',
	presaleDate:typeof invite_tickets_presale_date=='string'?invite_tickets_presale_date:'',
	presaleCode:typeof invite_tickets_presale_code=='string'?invite_tickets_presale_code:'',
	onsaleDate:typeof invite_tickets_onsale_date=='string'?invite_tickets_onsale_date:'',
	ticketAvailability:typeof invite_tickets_availability=='string'?invite_tickets_availability:'',
	audioUrl:typeof invite_audio_sample_url=='string'?invite_audio_sample_url:'',
	skin:typeof invite_widget_skin=='string'?invite_widget_skin:'button_large',
	socialNetworks:typeof invite_widget_networks=='string'?invite_widget_networks.toLowerCase():'all'
};

var tmpButton = new InviteButton(inviteModal, inviteOptions);
tmpButton.write();
inviteButtons.push(tmpButton);

//check if we should autolaunch NOW...not in ie.
if(inviteAutoLaunch && (inviteButtons.length == 1)) {
	if(inviteIE) {
		i_addLoadEvent(inviteAutoLaunchIE);
		inviteAddedToOnloadInIE=true;//only do this once.
	} else {
		//let's launch it now.  the first one.
		loadInviteInModal(0);
	}
}

//wipe all vars to be fresh for next invite.
invite_widget_version=null;
invite_widget_skin=null;
invite_widget_networks=null;
invite_widget_window=null;
invite_widget_text=null;
invite_partner_id=null;
invite_title=null;
invite_event_url=null;
invite_artist=null;
invite_venue=null;
invite_venue_url=null;
invite_location=null;
invite_date=null;
invite_start_time=null;
invite_end_time=null;
invite_show_time=null;
invite_door_time=null;
invite_image_url=null;
invite_seating=null;
invite_audience=null;
invite_tickets_required=null;
invite_tickets_url=null;
invite_tickets_general_admission=null;
invite_tickets_reserved=null;
invite_tickets_min_price=null;
invite_tickets_max_price=null;
invite_tickets_presale_date=null;
invite_tickets_presale_code=null;
invite_tickets_onsale_date=null;
invite_tickets_availability=null;
invite_audio_sample_url=null;
