if (Drupal.jsEnabled) {

	$(document).ready(function() {
		
		$('input[type="checkbox"], input[type="radio"]').css('border', 'none');
		
		if (typeof document.body.style.maxHeight != "undefined") {

		}
		else {
			$('.on').onImagesLoad({
					 callback: function(){							
							$('body').css('visibility', 'visible');
						}			
			});
		}
		
		more_link_hover('.more_link img');
		
		$('.solution_item').hover(function(){
			if($(this).find('.thumbnail_image .on img').attr('src') != undefined) {
				$(this).find('.thumbnail_image .off').hide();
				$(this).find('.thumbnail_image .on').show();
			}
		}, function () {
			if($(this).find('.thumbnail_image .on img').attr('src') != undefined) {
				$(this).find('.thumbnail_image .on').hide();
				$(this).find('.thumbnail_image .off').show();
			}
		});
		
		var share_config = {    
	     sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
	     interval: 100, // number = milliseconds for onMouseOver polling interval    
	     over: shareOver, // function = onMouseOver callback (REQUIRED)    
	     timeout: 100, // number = milliseconds delay before onMouseOut    
	     out: shareOut // function = onMouseOut callback (REQUIRED)    
		};

		//$("#share").hoverIntent( share_config );
		
	});
	
	function hover(obj, ext, obj2) {
		if(obj2 != undefined) {
			obj2 = ', '+obj2;
		}
		else {
			obj2 = '';
		}
		$(obj+obj2).mouseover( function() {
			if($(obj).attr('alt') == 'off') {
				if(!obj2) {
					obj = this;
				}
				$(obj).attr('src', $(obj).attr('src').replace('_off.' + ext, '_on.' + ext));
				$(obj).attr('alt', 'on');
			}
		}).mouseout(function() {
			if($(obj).attr('alt') == 'on') {
				if(!obj2) {
					obj = this;
				}
				$(obj).attr('src', $(obj).attr('src').replace('_on.' + ext, '_off.' + ext));
				$(obj).attr('alt', 'off');
			}
		});
	}
	
	function hover2(obj) {
		$(obj+'[class!="selected"]').mouseover(function(){
			$(this).parent().find('.on').show();
			$(this).parent().find('.off').hide();
		}).mouseout(function(){
			$(this).parent().find('.off').show();
			$(this).parent().find('.on').hide();
		});
	}

	function hover3(obj) {		
		$(obj+'[class!="selected"]').mouseover(function(){
			$(this).parent().parent().parent().find('.on').show();
			$(this).parent().parent().parent().find('.off').hide();
		}).mouseout(function(){
			$(this).parent().parent().parent().find('.off').show();
			$(this).parent().parent().parent().find('.on').hide();
		});
	}

	function hover4(obj) {
		$(obj+'[class!="selected"]').mouseover(function(){
			$(this).parent().parent().find('.on').show();
			$(this).parent().parent().find('.off').hide();
		}).mouseout(function(){
			$(this).parent().parent().find('.off').show();
			$(this).parent().parent().find('.on').hide();
		});
	}
	
	function shareOver() {
		return addthis_open(this, '', '[URL]', '[TITLE]');
	}

	function shareOut() {
		addthis_close();
	}
	
	$('#share').click(function(){
		return addthis_sendto();
	});
	
	function more_link_hover(obj) {
		$(obj).mouseover(function(){
			$(this).parent().parent().parent().find('.on').css('display', 'block');
			$(this).parent().parent().parent().find('.off').css('display', 'none');			
		}).mouseout(function(){
			$(this).parent().parent().parent().find('.off').css('display', 'block');			
			$(this).parent().parent().parent().find('.on').css('display', 'none');
		});
	}
	
}