﻿
/*   
ajax popup form Version 1.0.2
Author: alex wang
Author URI: http://www.birghtyoursite.com/
Modified for Traducta Inc. Bryan Montpetit
*/

jQuery.fn.center = function () {
    this.css("position","absolute");
    this.css("top", ( jQuery(window).height() - this.height() ) / 16+jQuery(window).scrollTop() + "px");
    this.css("left", ( jQuery(window).width() - this.width() ) / 2+jQuery(window).scrollLeft() + "px");
    return this;
}

    jQuery(document).ready(function(){ 
    
    jQuery(window).scroll( function() { 
     
     jQuery('#ajaxpopform').css("top", ( jQuery(window).height() - jQuery('#ajaxpopform').height() ) / 2+jQuery(window).scrollTop() + "px");;
     
     
     } );  
    jQuery(window).resize(function(){
        jQuery('#ajaxpopform').center();
    }); 
    jQuery('.ajaxpopform .cancel span').click(function(){
        jQuery('#ajaxpopform').fadeOut(500);
    });
    jQuery('.submit-button .form-submit-button span').click(function(){  
      jQuery('#ajaxpopform').submit();
    })
    jQuery('.popup-button').click(function(){
        jQuery(this).stop();
        jQuery('#ajaxpopform').center();
        jQuery('#ajaxpopform').fadeIn(500);
        jQuery(this).blur();
    });
 
    });


