
$(document).ready(function(){
	/* IMAGE SWAPS  example of usage: give img the .buttonswap class and make sure to get the on (mouse on) and off (mouse off) */
	$(".buttonSwap").hover(
	function()
	 {this.src = this.src.replace("_up","_down");},
	 function()
	 {this.src = this.src.replace("_down","_up");}
	);


/* Drop Down Menu */
       $('.headerSecondaryMenu ul li').hover(  
        function () {  
            //show its submenu  
            $('ul', this).stop(true, true).slideDown(250);  
          },   
        function () {  
            //hide its submenu  
            $('ul', this).stop(true, true).slideUp(150);           
        }  
    	);  


/* FORM text behavior  http://buildinternet.com/2009/01/changing-form-input-styles-on-focus-with-jquery/ */

    $('input[type="text"]').addClass("idleField");  
    $('input[type="text"]').focus(function() {  
        $(this).removeClass("idleField").addClass("focusField");  
        if (this.value == this.defaultValue){  
            this.value = '';  
        }  
        if(this.value != this.defaultValue){  
            this.select();  
        }  
    });  
    $('input[type="text"]').blur(function() {  
        $(this).removeClass("focusField").addClass("idleField");  
        if ($.trim(this.value == '')){  
            this.value = (this.defaultValue ? this.defaultValue : '');  
        }  
    });  



/* Fade images on rollover */

	$(".fadeImage").hover(function(){
	    $(this).stop().animate({"opacity": .4},200);
	},function(){
	    $(this).stop().animate({"opacity": 1},600);
	});


/* split ul when has the class .twoColumnList */

	$('.twoColumnList').easyListSplitter({ colNumber: 2});
	$('.twoColumnList').show();


/* home page image rotation */

$('.homeClientBoxImage').cycle({ 
    timeout:  3000,
    pause:  1,
    speed:  1500});


$('.ivlBoxImage').cycle({ 
    timeout:  5500,
    pause:  1,
    speed:  1500});


/*  SEARCH BOX CLEAR Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
  * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
  * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
  *
  * $LastChangedDate$
  * $Rev$
  *
  * Version 0.2
  *
  * Usage:
  *   $("input[name=q]")
  *      .val("Search")    // set an initial value if it doesn't already exist
  *      .clearonfocus();  // prepare the element for clearing on focus
  */
 jQuery.fn.clearonfocus = function() {
     return this
         .bind('focus', function() {
             // Set the default value if it isn't set
             if ( !this.defaultValue ) this.defaultValue = this.value;
             // Check to see if the value is different
             if ( this.defaultValue && this.defaultValue != this.value ) return;
             // It isn't, so remove the text from the input
             this.value = '';
         })
         .bind('blur', function() {
             // If the value is blank, return it to the defaultValue
             if ( this.value.match(/^\s*$/) )
                 this.value = this.defaultValue;
         });
 };


$('#s').val("Search Site").clearonfocus();


});
