var $=jQuery
(function($){var methods={init:function(options){var settings=$.extend({modal:false,openModalElement:null,appendTo:'body',subdomain:null},options);return this.each(function(){if(!settings.modal){$(settings.appendTo).append('
');var gf_inline_container=$('body').find('.gf_main_container');gf_inline_container.append('');var eventMethod=window.addEventListener?"addEventListener":"attachEvent";var eventer=window[eventMethod];var messageEvent=eventMethod=="attachEvent"?"onmessage":"message";eventer(messageEvent,function(e){document.getElementById('gf_embed_iframe').height=e.data+'px';},false);}
else{$('body').append('');var gf_modal_container=$('body').find('.gf_modal_container');var scroll_pos;var ios=false;if(navigator.userAgent.match(/(iPod|iPhone|iPad)/)){ios=true;}
function add_iframe(){gf_modal_container.find('.gf_iframe_container').append('');$('html').addClass('gf-modal-open');if(ios){scroll_pos=$(window).scrollTop();$('html').addClass('gf-modal-fixed').css('top',-scroll_pos);}
gf_modal_container.addClass('loading');$('#gf_embed_iframe').load(function(){gf_modal_container.addClass('shown');gf_modal_container.removeClass('loading');});}
function remove_iframe(){gf_modal_container.find('.gf_iframe_container').children('iframe').remove();$('html').removeClass('gf-modal-open');if(ios){$('html').removeClass('gf-modal-fixed').css('top','auto');$(document).scrollTop(scroll_pos);}}
if(settings.openModalElement){$(settings.openModalElement).click(function(){add_iframe();});}
else{$('*[data_gf_modal="true"]').click(function(){add_iframe();})}
gf_modal_container.click(function(){close_modal();}).find('.gf_iframe_container').click(function(e){return false;});function close_modal(){gf_modal_container.addClass('fade-out');setTimeout(function(){gf_modal_container.removeClass('shown fade-out');remove_iframe()},301);}
$('body').on('touchmove',function(e){if($('.gf-modal-open').has($(e.target)).length)e.preventDefault();});}});}};$.fn.giveforms_embed=function(methodOrOptions){if(methods[methodOrOptions]){return methods[methodOrOptions].apply(this,Array.prototype.slice.call(arguments,1));}else if(typeof methodOrOptions==='object'||!methodOrOptions){return methods.init.apply(this,arguments);}else{$.error('Method '+methodOrOptions+' does not exist on jQuery.tooltip');}};}(jQuery));