PricingPop={replaceHref:'/pricing.php',formPhpLocation:'index_pricing-pop.php',pathToPricingPop:'/pricing-Pop',contactHeadline:'Dont Pay Full Price!',headerBgColor:'#777777',overlayFadeIn:600,overlayFadeOut:500,overlayEasing:'',openButtonSelector:'',closeButtonSelector:'.close-overlay',resetFormEachTime:0,fadeOverlayIE:0,fadeOverlayIE6:0,obj:{},formFields:{},submitEvent:0,overlayFade:1,appendOverlay:function(){PricingPop.obj.overlay=jQuery('<div id="contact-pop-overlay"></div>').appendTo(jQuery('BODY'));PricingPop.obj.panelWrapper=jQuery('<div id="contact-pop-panel-wrapper"></div>').appendTo(PricingPop.obj.overlay);PricingPop.obj.panel=jQuery('<div id="contact-pop-panel"></div>').appendTo(PricingPop.obj.panelWrapper);PricingPop.obj.panelHeadline=$('<h2 id="contact-pop-header">'+PricingPop.contactHeadline+'</h2>').appendTo(PricingPop.obj.panel);if(PricingPop.headerBgColor!='#777777')PricingPop.obj.panelHeadline.css('backgroundColor',PricingPop.headerBgColor);PricingPop.obj.panelHeadline.append('<a href="#" class="close-overlay">X</a></h2>');PricingPop.obj.form=jQuery('<form action="'+PricingPop.formPhpLocation+'" method="get" id="contact-pop-form"></div>').appendTo(PricingPop.obj.panel);PricingPop.obj.loading=jQuery('<div id="contact-pop-loading-gif-wrapper"></div>').appendTo(PricingPop.obj.panel);PricingPop.obj.loading.append('<img src="'+PricingPop.pathToPricingPop+'/img/ajax-loader.gif" alt="" id="contact-pop-loading-gif" />');},getFormContent:function(){jQuery.get(PricingPop.formPhpLocation,{'ajaxForm':1},function(html){if(html){PricingPop.obj.loading.fadeOut(200);PricingPop.obj.form.html(html);PricingPop.attachFormEvents();}});},attachFormEvents:function(){jQuery(PricingPop.closeButtonSelector,PricingPop.obj.panel).click(function(ev){ev.preventDefault();PricingPop.hideOverlay();});if(jQuery.browser.msie){jQuery('input.submit',PricingPop.obj.form).click(function(ev){ev.preventDefault();PricingPop.submitForm();});}
else if(!PricingPop.submitEvent){PricingPop.obj.form.submit(function(ev){ev.preventDefault();PricingPop.submitForm();});PricingPop.submitEvent=1;}},checkOverlayFade:function(){if($.browser.msie&&!PricingPop.fadeOverlayIE&&!($.browser.version<7&&PricingPop.fadeOverlayIE6))return false;else return true;},showOverlay:function(){if(typeof(PricingPop.obj.overlay)=='undefined'){PricingPop.appendOverlay();PricingPop.getFormContent();}
else if(PricingPop.resetFormEachTime)PricingPop.getFormContent();if(PricingPop.overlayFade)PricingPop.obj.overlay.fadeIn(PricingPop.overlayFadeOut,PricingPop.overlayEasing);else PricingPop.obj.overlay.show();},hideOverlay:function(){if(PricingPop.overlayFade)PricingPop.obj.overlay.fadeOut(PricingPop.overlayFadeIn,PricingPop.overlayEasing);else PricingPop.obj.overlay.hide();},submitForm:function(){jQuery('input, select, textarea',PricingPop.obj.form).each(function(){PricingPop.addFormField(jQuery(this));});PricingPop.formFields['ajaxForm']=1;PricingPop.obj.form.fadeOut(200);PricingPop.obj.loading.fadeIn(200);jQuery.post(PricingPop.formPhpLocation,PricingPop.formFields,function(html){if(html){PricingPop.obj.form.html(html);PricingPop.obj.loading.fadeOut(200);PricingPop.obj.form.fadeIn(200);PricingPop.attachFormEvents();}});},addFormField:function($field){var fieldName=$field.attr('name');if(fieldName)PricingPop.formFields[fieldName]=$field.val();},init:function(){var anchorSelector='';if(typeof(PricingPop.replaceHref)!='object')PricingPop.replaceHref=[PricingPop.replaceHref];for(var i=0;i<PricingPop.replaceHref.length;i++){if(PricingPop.replaceHref[i])anchorSelector+='a[href='+PricingPop.replaceHref[i]+'], ';}
if(PricingPop.openButtonSelector)anchorSelector+=PricingPop.openButtonSelector;else anchorSelector=anchorSelector.substr(0,anchorSelector.length-2);PricingPop.obj.ctas=jQuery(anchorSelector);PricingPop.obj.ctas.click(function(ev){ev.preventDefault();PricingPop.showOverlay();});PricingPop.overlayFade=PricingPop.checkOverlayFade();var overlayImg=new Image();if(jQuery.browser.msie&&jQuery.browser.version<7)overlayImg.src=PricingPop.pathToPricingPop+'/img/overlay-ie6.png';else overlayImg.src=PricingPop.pathToPricingPop+'/img/overlay.png';}};jQuery(function(){PricingPop.init();});

