text: (function($) {
        "use strict";
  
        var window_height = $(window).height();
        var window_width = $(window).width();
  
        /* window.load()
        ==================*/
        $(window).load(function(){
  
                  /* PRELOADER
                  ===================*/
                  if ( $('#preloader').length != 0 ) {
                       setTimeout(function(){
                              $('#preloader').fadeOut(1000);
                       }, 1500);
                  }
                  
                  /* NAVIGATION
                  ===================*/
                  jQuery('.scrollto a, a.scroll').click(function(){
                       var id = jQuery(this).attr("href");
                       var overlay_menu = $('div.overlay-menu');
                       //if top nav exist
                       if ( $('#top-nav').length != 0 ) {
                               jQuery('html,body').stop().animate({scrollTop: jQuery("div"+id).offset().top},'slow', function(){
                                         if ( navigator.userAgent.indexOf('iPad') != -1 ) {
                                                   var yPos = window.pageYOffset;
                                                   var jQueryfixedElement = jQuery('div#top-nav');
                                                   jQueryfixedElement.css({ "position": "relative" });
                                                   window.scroll(0,yPos);
                                                   jQueryfixedElement.css({ "position": "fixed" });
                                         }
                                         if ( overlay_menu.hasClass('open') ) {
                                                   overlay_menu.removeClass('open');
                                                   overlay_menu.addClass('close');
                                                   setTimeout(function(){
                                                         overlay_menu.removeClass('close');
                                                   }, 2000);
                                         }
                               });
                       } else { jQuery('html,body').stop().animate({scrollTop: jQuery("div"+id).offset().top},'slow'); }
  
  
                  return false;
                  });
                  
                  /* PARALLAX EFFECT
                  ===================*/
                  $('.parallax').each(function(){
                          var parallax_bg = $(this).attr('data-background');
                          $(this).css('background-image','url(' + parallax_bg + ')');
                  });
  
                  /*-- Screenshot carousel --*/
                  if ( window_width >= 800 ) { var screenshot_width = 300; } //DESKTOP
                  if ( window_width <= 800 && window_width > 700  ) { var screenshot_width = 200; } //iPad
                  if ( window_width <= 700 && window_width > 500  ) { var screenshot_width = 245; } //iPhone5 Landscape
                  if ( window_width <= 500 && window_width > 425  ) { var screenshot_width = 195; } //iPhone4 Lanscape
                  if ( window_width <= 425 && window_width > 385  ) { var screenshot_width = 175; } //iPhone6 Plus Portait
                  if ( window_width <= 400  ) { var screenshot_width = 280; }
                  $('#screenshot-carousel').flexslider({
                             
                             namespace: "carousel-",             //{NEW} String: Prefix string attached to the class of every element generated by the plugin
                             selector: ".carousel-slider > li",  //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
                             animation: "slide",             //String: Select your animation type, "fade" or "slide"
                             easing: "swing",               //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
                             direction: "horizontal",        //String: Select the sliding direction, "horizontal" or "vertical"
                             reverse: false,                 //{NEW} Boolean: Reverse the animation direction
                             animationLoop: false,             //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
                             smoothHeight: false,            //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
                             startAt: 0,                     //Integer: The slide that the slider should start on. Array notation (0 = first slide)
                             slideshow: false,                //Boolean: Animate slider automatically
                             slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds
                             animationSpeed: 600,            //Integer: Set the speed of animations, in milliseconds
                             initDelay: 0,                   //{NEW} Integer: Set an initialization delay, in milliseconds
                             randomize: false,               //Boolean: Randomize slide order
              
                             // Usability features
                             pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
                             pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
                             useCSS: false,                   //{NEW} Boolean: Slider will use CSS3 transitions if available
                             touch: true,                    //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
                             video: false,                   //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
              
                             // Primary Controls
                             controlNav: false,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
                             directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)
                             prevText: "&lt;",                //String: Set the text for the "previous" directionNav item
                             nextText: "&gt;",               //String: Set the text for the "next" directionNav item
              
                             // Secondary Navigation
                             keyboard: true,                 //Boolean: Allow slider navigating via keyboard left/right keys
                             multipleKeyboard: false,        //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
                             mousewheel: false,              //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
                             pausePlay: false,               //Boolean: Create pause/play dynamic element
                             pauseText: 'Pause',             //String: Set the text for the "pause" pausePlay item
                             playText: 'Play',               //String: Set the text for the "play" pausePlay item
              
                             // Special properties
                             controlsContainer: "",          //{UPDATED} Selector: USE CLASS SELECTOR. Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be ".flexslider-container". Property is ignored if given element is not found.
                             manualControls: "",             //Selector: Declare custom control navigation. Examples would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
                             sync: "",                       //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
                             asNavFor: "",                   //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
              
                             // Carousel Options
                             itemWidth: screenshot_width,     //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
                             itemMargin: 30,                  //{NEW} Integer: Margin between carousel items.
                             minItems: 1,                    //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
                             maxItems: 8,                    //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
                             move: 1,                        //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
              
                             // Callback API
                             start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide
                             before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation
                             after: function(){},            //Callback: function(slider) - Fires after each slider animation completes
                             end: function(){},              //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
                             added: function(){},            //{NEW} Callback: function(slider) - Fires after a slide is added
                             removed: function(){}           //{NEW} Callback: function(slider) - Fires after a slide is removed
              
                  });
                  
                  /*-- Swipebox for screenshots --*/
                  /*-- /*-- $('a.gallery-item').swipebox(); --*/
                  /*-- $('a.gallery-item2').swipebox(); --*/
                  
                  /*-- Testimonials slider --*/
                  $('#testimonials-slider').flexslider({
        
                             namespace: "testimonials-",     //{NEW} String: Prefix string attached to the class of every element generated by the plugin
                             selector: ".testimonial-slides > li",       //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
                             animation: "fade",              //String: Select your animation type, "fade" or "slide"
                             easing: "swing",                //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
                             direction: "vertical",          //String: Select the sliding direction, "horizontal" or "vertical"
                             reverse: false,                 //{NEW} Boolean: Reverse the animation direction
                             animationLoop: true,            //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
                             smoothHeight: true,            //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
                             startAt: 0,                     //Integer: The slide that the slider should start on. Array notation (0 = first slide)
                             slideshow: true,                //Boolean: Animate slider automatically
                             slideshowSpeed: 10000,           //Integer: Set the speed of the slideshow cycling, in milliseconds
                             animationSpeed: 600,            //Integer: Set the speed of animations, in milliseconds
                             initDelay: 0,                   //{NEW} Integer: Set an initialization delay, in milliseconds
                             randomize: false,               //Boolean: Randomize slide order
              
                             // Usability features
                             pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
                             pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
                             useCSS: false,                  //{NEW} Boolean: Slider will use CSS3 transitions if available
                             touch: true,                    //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
                             video: false,                   //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
              
                             // Primary Controls
                             controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
                             directionNav: false,             //Boolean: Create navigation for previous/next navigation? (true/false)
                             prevText: "&lt;",               //String: Set the text for the "previous" directionNav item
                             nextText: "&gt;",               //String: Set the text for the "next" directionNav item
              
                             // Secondary Navigation
                             keyboard: true,                 //Boolean: Allow slider navigating via keyboard left/right keys
                             multipleKeyboard: false,        //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
                             mousewheel: false,              //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
                             pausePlay: false,               //Boolean: Create pause/play dynamic element
                             pauseText: 'Pause',             //String: Set the text for the "pause" pausePlay item
                             playText: 'Play',               //String: Set the text for the "play" pausePlay item
              
                             // Special properties
                             controlsContainer: "#testimonial-controls",  //{UPDATED} Selector: USE CLASS SELECTOR. Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be ".flexslider-container". Property is ignored if given element is not found.
                             manualControls: "",             //Selector: Declare custom control navigation. Examples would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
                             sync: "",                       //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
                             asNavFor: "",                   //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
              
                             // Callback API
                             start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide
                             before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation
                             after: function(){},            //Callback: function(slider) - Fires after each slider animation completes
                             end: function(){},              //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
                             added: function(){},            //{NEW} Callback: function(slider) - Fires after a slide is added
                             removed: function(){}           //{NEW} Callback: function(slider) - Fires after a slide is removed
        
                  });
                  
                  /*-- Team carousel --*/
                  if ( window_width >= 1200 ) { var item_width = 255; }
                  if ( window_width <= 1200 && window_width > 700  ) { var item_width = 225; }
                  if ( window_width <= 700 && window_width > 500  ) { var item_width = 250; }
                  if ( window_width <= 500 && window_width > 400  ) { var item_width = 200; }
                  if ( window_width <= 425 && window_width > 385  ) { var item_width = 180; }
                  if ( window_width <= 400  ) { var item_width = 300; }
                  $('#team-carousel').flexslider({
                       
                             namespace: "carousel-",             //{NEW} String: Prefix string attached to the class of every element generated by the plugin
                             selector: ".carousel-slider > li",  //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
                             animation: "slide",             //String: Select your animation type, "fade" or "slide"
                             easing: "swing",               //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
                             direction: "horizontal",        //String: Select the sliding direction, "horizontal" or "vertical"
                             reverse: false,                 //{NEW} Boolean: Reverse the animation direction
                             animationLoop: false,             //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
                             smoothHeight: false,            //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
                             startAt: 0,                     //Integer: The slide that the slider should start on. Array notation (0 = first slide)
                             slideshow: false,                //Boolean: Animate slider automatically
                             slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds
                             animationSpeed: 600,            //Integer: Set the speed of animations, in milliseconds
                             initDelay: 0,                   //{NEW} Integer: Set an initialization delay, in milliseconds
                             randomize: false,               //Boolean: Randomize slide order
              
                             // Usability features
                             pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
                             pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
                             useCSS: false,                   //{NEW} Boolean: Slider will use CSS3 transitions if available
                             touch: true,                    //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
                             video: false,                   //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
              
                             // Primary Controls
                             controlNav: false,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
                             directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)
                             prevText: "&lt;",                //String: Set the text for the "previous" directionNav item
                             nextText: "&gt;",               //String: Set the text for the "next" directionNav item
              
                             // Secondary Navigation
                             keyboard: true,                 //Boolean: Allow slider navigating via keyboard left/right keys
                             multipleKeyboard: false,        //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
                             mousewheel: false,              //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
                             pausePlay: false,               //Boolean: Create pause/play dynamic element
                             pauseText: 'Pause',             //String: Set the text for the "pause" pausePlay item
                             playText: 'Play',               //String: Set the text for the "play" pausePlay item
              
                             // Special properties
                             controlsContainer: "",          //{UPDATED} Selector: USE CLASS SELECTOR. Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be ".flexslider-container". Property is ignored if given element is not found.
                             manualControls: "",             //Selector: Declare custom control navigation. Examples would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
                             sync: "",                       //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
                             asNavFor: "",                   //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
              
                             // Carousel Options
                             itemWidth: item_width,                   //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
                             itemMargin: 20,                  //{NEW} Integer: Margin between carousel items.
                             minItems: 1,                    //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
                             maxItems: 8,                    //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
                             move: 1,                        //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
              
                             // Callback API
                             start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide
                             before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation
                             after: function(){},            //Callback: function(slider) - Fires after each slider animation completes
                             end: function(){},              //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
                             added: function(){},            //{NEW} Callback: function(slider) - Fires after a slide is added
                             removed: function(){}           //{NEW} Callback: function(slider) - Fires after a slide is removed
  
                  });
                  
                  /*-- Load team members --*/
                  $('a.load-member').click(function(){
                           var source = $(this).attr("href");
                           $('html,body').stop().animate({scrollTop: $("div#team").offset().top - 100},'slow', function(){
                                     $('#member-loader').slideDown(400,function(){
                                               $('#member-holder').load(source,function(){
                                                         $('#member-loader').slideUp(400,function(){
                                                                   $('#member-holder').slideDown(400,function(){
                                                                             $(".member-icons .icons ul li a").tipTip({ delay: 100 });
                                                                             $('#close-member a').click(function(){
                                                                                       $('#member-holder').slideUp(400,function(){
                                                                                                 $('#member-holder').empty();
                                                                                       });
                                                                             return false;
                                                                             });
                                                                   });
                                                         });
                                               });
                                     });
                           });
                  return false;
                  });
                  
                  /*-- Load services --*/
                  $('.service-teaser a.more-link').click(function(){
                           var source = $(this).attr("href");
                           $('#services .section_intro').slideUp(400, function(){
                                     $('#service-loader').slideDown(400,function(){
                                               $('html,body').stop().animate({scrollTop: $("div#services").offset().top - 70},'slow', function(){
                                                         $('#serivceitem-holder').load(source,function(){
                                                                   $('#service-loader').slideUp(400,function(){
                                                                             $('#serivceitem-holder').slideDown(400,function(){
                                                                                       $('.close-service a').click(function(){
                                                                                                 $('#serivceitem-holder').slideUp(400,function(){
                                                                                                           $('#serivceitem-holder').empty();
                                                                                                           $('#services-intro').slideDown();
                                                                                                 });
                                                                                       return false;
                                                                                       });
                                                                             });
                                                                   });
                                                         });
                                               });
                                     });
                           });
                  return false;
                  });
  
        }); //END: window.load()
  
  
        /* document.ready()
        ==================*/
        $(document).ready(function(){
  
                  /*-- Show Top Menu --*/
                  if ( $('#top-nav').length != 0 ) { 
                      $(window).scroll(function(){
                            var pagetop = jQuery(this).scrollTop();
                            if (pagetop >= 450) {
                                     jQuery('div#top-nav').slideDown();
                                     }
                            if (pagetop <= 450) {
                                     jQuery('div#top-nav').css("display","none");
                                     }
                      });
                  }
                  
                  /*-- Append Mobile menu into top nav bar --*/
                  var overlay_menu = $('div.overlay-menu');
                  var menuButton = $('div.menu-button').clone();
                  var topNav = $('div#top-nav');
                  $(menuButton).attr('id','open-menu');
                  $(topNav).append(menuButton);
                  $('#open-menu').click(function(){
                            $(overlay_menu).toggleClass('open');
                  });
  
                  /*-- FitVids --*/
                  $(".responsive-video").fitVids();
                  
                  /*-- Image background --*/
                  if ( $('.image-background').length != 0 ) {
                       var background_url = $('.image-background').attr("data-background");
                       $('.image-background').backstretch(background_url);
                  }
                  
                  /*-- Video background --*/
                  if ( $('.video-background').length != 0 ) {
                       if ( window_width >= 960 && navigator.userAgent.indexOf('iPad') == -1 ) {
                           var video_url = $('.video-background').attr("data-video");
      	                 $('.video-background').tubular({
                                    videoId: video_url,
                                    start: 38
                           });
                       }
                       if ( window_width < 960 ) {
                           var background_url = $('.video-background').attr("data-alt");
                           $('.video-background').backstretch(background_url);
                       }
                  }
                  
                  /*-- Adjust logo on really small screens --*/
                  if ( window_width < 380 && $('#navigation').length == 0 ) {
                       $('#logo').css({"float":"none","margin":"0 auto"});
                       $('#logo img').css("margin","0 auto");
                  }
                  
                  /*-- Validate Subscribe form --*/
                  var placeholder_text = 'Your Email';
                  $('input#mce-EMAIL').click(function() {
  
                       var form_mail = $('input#mce-EMAIL').val();
                       if (form_mail == placeholder_text) { $('input#mce-EMAIL').val(''); }
  
                  });
                  
                  /*-- Tool tips --*/
                  /*-- $("#social-icons ul li a").tipTip({ delay: 100 }); --*/
  
                  /*-- Validate Contact form --*/
                  var name_value   = 'Name *'; //default placeholder text for the name field
                  var mail_value   = 'Email *'; //default placeholder text for the email field
                  var subject_value = 'Subject *'; //default placeholder text for the subject field
                  var message_value= 'Message *'; //default place holder text for the textarea
        
                  var missing_name = 'What is your name'; //error message, if the name field is empty
                  var missing_mail = 'Email address is missing!'; //error message, if the mail field is empty
                  var invalid_mail = 'Oh no! Invalid email address!'; //error message, if the user's email address is invalid
                  var missing_subject = 'The subject is missing!'; //error message, if the subject field is empty
                  var missing_message = 'Any Message!?'; //error message, if the textarea is empty
        
                  var error_color   = '#990000'; //text color of the error messages
                  var default_color = '#7E7E7E'; //default text color of the contact form
        
                  $('input#form-name').click(function() {
        
                             var form_name = $('input#form-name').val();
              
                             if (form_name == missing_name)
                                {
                                $('input#form-name').css("color" , default_color);
                                $('input#form-name').val('');
                                }
                                else if (form_name == name_value)
                                        {
                                        $('input#form-name').val('');
                                        $('input#form-name').css("color" , default_color);
                                        }
        
                  });
        
                  $('input#form-mail').click(function() {
        
                             var form_mail = $('input#form-mail').val();
              
                             if (form_mail == missing_mail || form_mail == invalid_mail)
                             {
                             $('input#form-mail').css("color" , default_color);
                             $('input#form-mail').val('');
                             }
                             else if (form_mail == mail_value)
                                     {
                                     $('input#form-mail').val('');
                                     $('input#form-mail').css("color" , default_color);
                                     }
        
                  });
             
                  $('input#form-subject').click(function() {
        
                             var form_subject = $('input#form-subject').val();
              
                             if (form_subject == missing_subject)
                             {
                             $('input#form-subject').css("color" , default_color);
                             $('input#form-subject').val('');
                             }
                             else if (form_subject == subject_value)
                                     {
                                     $('input#form-subject').val('');
                                     $('input#form-subject').css("color" , default_color);
                                     }
        
                  });
        
                  $('textarea#form-message').click(function() {
        
                             var message_content = $('textarea#form-message').val();
              
                             if (message_content == missing_message || message_content == message_value)
                                {
                                $('textarea#form-message').css("color" , default_color);
                                $('textarea#form-message').val('');
                                }
                  });
        
                  $('#contact-form button#button').click(function() {
        
                             var name = $('input#form-name').val();
                             var email = $('input#form-mail').val();
                             var subject = $('input#form-subject').val();
                             var comments = $('textarea#form-message').val();
              
                             if (name == "" || name == missing_name || name == name_value)
                                {
                                $('input#form-name').css("color" , error_color);
                                $('input#form-name').val(missing_name);
                                }
              
                             if (email == "" || email == invalid_mail || email == mail_value)
                                {
                                $('input#form-mail').css("color" , error_color);
                                $('input#form-mail').val(missing_mail);
                                }
                                
                             if (email != mail_value && email != missing_mail ) {
                                var atpos=email.indexOf("@");
                                var dotpos=email.lastIndexOf(".");
                                if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length)
                                   {
                                   $('input#form-mail').css("color" , error_color);
                                   $('input#form-mail').val(invalid_mail);
                                   return false;
                                   }
                             }
                             
                             if (subject == "" || subject == missing_subject || subject == subject_value)
                                {
                                $('input#form-subject').css("color" , error_color);
                                $('input#form-subject').val(missing_subject);
                                }
              
                             if (comments == "" || comments == message_value || comments == missing_message)
                                {
                                $('textarea#form-message').css("color" , error_color);
                                $('textarea#form-message').val(missing_message);
                                }
              
                             if ( name == "" || name == missing_name || name == name_value || email == "" || email == invalid_mail || email == mail_value || email == missing_mail || comments == "" || comments == message_value || comments == missing_message || subject == "" || subject == missing_subject || subject == subject_value ) { return false; }
              
                             var atpos=email.indexOf("@");
                             var dotpos=email.lastIndexOf(".");
                             if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length)
                                {
                                $('input#form-mail').css("color" , error_color);
                                $('input#form-mail').val(invalid_mail);
                                return false;
                                }
              
                             $("div#contact-form input[type='text']").remove();
                             $('div#contact-form textarea').remove();
                             $('div#contact-form button').remove();
                             $('p#required').remove();
                             $('div#result').append('<div id="contact-loading"></div>');
              
                             $.ajax({
                                       type: 'post',
                                       url: 'mail.php',
                                       data: 'name=' + name + '&email=' + email + '&subject=' + subject + '&comments=' + comments,
              
                                       success: function(results) {
                                                 $('div#contact-loading').remove();
                                                 $('div#result').html(results);
                                       }
                             });
        
                  });//send click process ends here
  
        });  //END: document.ready()
  
  
  })(jQuery);