// JavaScript Document
// variables
	// global: speed used for jquery animations and effects
		var animspeed = 'fast';
	// client grid
		var int_grid_counter = 0;
	
		
	
// jquery actions
	//$(document).ready(function(){
	function init() {
			// page-specific: client grid (clients section landing page)
			// use a shim div to adjust placement of items. more info:
			// http://exanimo.com/css/vertical-centering-with-a-floated-shim
				$('dd.desc').prepend('<div class="shim"></div>');
			// adjust items in right two columns to not overflow the browser window.
				$('ul#client-grid li').each(function(){
					int_grid_counter++;
					if(int_grid_counter > 3){
						$(this).addClass('rlim');
					}
					if(int_grid_counter>4){
						int_grid_counter = 0;
					}
				});
			// manage the display of items
				$('ul#client-grid li').hover(
					/** mouseover */
					function(){
						$('dd.desc',this).fadeIn(animspeed);
						$(this).addClass('current');
						if($('a',this).get(0)){
							$(this).bind(
								'click',
								function(){
									location.href=$('a',this).get(0).getAttribute('href');
								}
							);
						}
						$('ul#client-grid li').not('.current').addClass('translucent');
					},
					/** mouseout */
					function(){
						$('dd.desc',this).fadeOut(animspeed);
						if($('a',this).get(0)){
							$(this).unbind('click').removeClass('pointer');
						}
						$(this).removeClass('current');
						$('ul#client-grid li.translucent').removeClass('translucent');
					}
				);
		//});
	}



// IE was chocking on the document.ready sometimes (not consistant)
if($.browser.msie) {
	window.onload = init;
} else {
	$(document).ready( 
		function() { 
			init(); 
		} 
	);
}

