jQuery(document).ready(function() {
 jQuery('.warning').remove();
jQuery(function(){
   var path = location.pathname.substring(1);
   if ( path )
     jQuery('#top_nav a[href$="' + path + '"]').attr('class', 'selected');
	 });
jQuery(".add_it").append('<input class="text required" type="text" name="email" id="email" size="26" maxlength="50" tabindex="4" />');	 
jQuery("select, input:checkbox, input:radio, input:file").uniform();
jQuery('#FormName #email').example('enter your E-mail Address', {className: 'inactive'});
jQuery('#FormName #website').example('http://', {className: 'inactive'});
jQuery('#FormName #chat, #listen #additional_info').example('(if applicable)', {className: 'inactive'});
jQuery('button[type=reset]').click(function() {jQuery('#FormName').resetForm();});

function letteRip2() {
        jQuery('#sendMe').html("<div id='message'></div>");
        jQuery('#message').html("<h3 id='scent'>Contact Form Submitted!</h3><h4>you should be receiving a confimation copy of the form soon</h4>")
        .hide()
        .fadeIn(1500, function() {
          jQuery('#message').append("<img id='checkmark' src='http://smartpilldesign.com/images/check.png' />"); 
          });

          
       //return true;
};

/**/
jQuery('#sp_key').hover(function(){
         // on hover
         jQuery(this).bgFade('fadeIn');
         }, function () {
         // off hover
         jQuery(this).bgFade('fadeOut');
         });





function comAway() {
var $cheesesteak = jQuery('#comment_form');
$cheesesteak.hide()
};


//comAway();




jQuery('#sp_flash').flash({
	swf: '/assets/ssp/slideshow_sp2.swf', 
	params: {bgcolor: '#333333'},
	flashvars: { xmlfile: '/photos/xml_category?cat=<?php echo $cat_num;?>' }
	});



var dataString = jQuery("#FormName").serialize();

function letteRip() {
        jQuery('#sendMe').html("<div id='message'></div>");
        jQuery('#message').html("<h3 id='scent'>Contact Form Submitted!</h3><h4>you should be receiving a confimation copy of the form soon</h4>")
        .hide()
        .fadeIn(1500, function() {
          jQuery('#message').append("<img id='checkmark' src='http://smartpilldesign.com/images/check.png' />");

          });
       return true;
}

jQuery("#FormName").RSV({
			displayType: "display-html",
         // onCompleteHandler: letteRip,
          errorFieldClass: "errorField",
         // displayType: "alert-one",
                       rules: [
                        "required,name,Please enter your name.",
                        "required,email,Please enter your email address.",
                        "valid_email,email,Please enter a valid email address.",
                        "required,contact_type,Please select your Communication Preference.",
                        "required,svc,Please select the type of service you are interested in."
                ]
        });


// jQuery SmoothScroll | Version 09-11-02
//ignore links in #sp_do
jQuery('a[href*=#]').not('#sp_do a').click(function() {

   // duration in ms
   var duration=1000;

   // easing values: swing | linear
   var easing='swing';

   // get / set parameters
   var newHash=this.hash;
   var target=$(this.hash).offset().top;
   var oldLocation=window.location.href.replace(window.location.hash, '');
   var newLocation=this;

   // make sure it's the same location      
   if(oldLocation+newHash==newLocation)
   {
      // animate to target and set the hash to the window.location after the animation
      jQuery('html:not(:animated),body:not(:animated)').animate({ scrollTop: target }, duration, easing, function() {

         // add new hash to the browser location
         window.location.href=newLocation;
      });

      // cancel default click action
      return false;
   }

});

/*
jQuery('#top_nav li a').hover(function () {
                        // on hover
                       jQuery(this).stop().fadeTo(500, 0);
                    }, function () {
                        // off hover
                        jQuery(this).stop().fadeTo(700, .9);
                    });
*/
}); //close onload



