$(document).ready(function(){
	
	
	
	$('#navsub_1240408_984370').hover(
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-1-white.png) no-repeat', 'margin-top':'-8px', 'color':'#000000','padding-top':'8px' });
			},
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-1-green.png) no-repeat', 'margin-top':'-8px', 'color':'#FFFFFF','padding-top':'8px' });
			}
		);
		
		$('#rciMenu a').hover(
			function() {
				$(this).css({ 'background':'url(/images/tab-1-white.png) no-repeat', 'margin-top':'-8px', 'color':'#000000','padding-top':'8px' });
			},
			function() {
				$(this).css({ 'background':'url(/images/tab-1-green.png) no-repeat', 'margin-top':'-8px', 'color':'#FFFFFF','padding-top':'8px' });
			}
		);
		
		$('#rciMenu ul li a').hover(
			function() {
				$(this).css({ 'background-color':'#007236', 'background-image':'none', 'color':'#FFF', 'height':'24px', 'padding':'2px 4px 2px 4px' });
			},
			function() {
				$(this).css({ 'background-color':'#FFF', 'background-image':'none','color':'#000', 'height':'24px','padding':'2px 4px 2px 4px' });
			}
		);
		
		$('#navsub_1240408_984371').hover(
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-2-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-2-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#cMenu a').hover(
			function() {
				$(this).css({ 'background':'url(/images/tab-2-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).css({ 'background':'url(/images/tab-2-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#cMenu ul li a').hover(
			function() {
				$(this).css({ 'background-color':'#007236', 'background-image':'none', 'color':'#FFF', 'height':'24px', 'padding':'2px 4px 2px 4px' });
			},
			function() {
				$(this).css({ 'background-color':'#FFF', 'background-image':'none','color':'#000', 'height':'24px','padding':'2px 4px 2px 4px' });
			}
		);
		
		$('#navsub_1240408_984372').hover(
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-3-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-3-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#rMenu a').hover(
			function() {
				$(this).css({ 'background':'url(/images/tab-3-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).css({ 'background':'url(/images/tab-3-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#rMenu ul li a').hover(
			function() {
				$(this).css({ 'background-color':'#007236', 'background-image':'none', 'color':'#FFF', 'height':'24px', 'padding':'2px 4px 2px 4px' });
			},
			function() {
				$(this).css({ 'background-color':'#FFF', 'background-image':'none','color':'#000', 'height':'24px','padding':'2px 4px 2px 4px' });
			}
		);
		
		$('#navsub_1240408_984373').hover(
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-4-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-4-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#hMenu a').hover(
			function() {
				$(this).css({ 'background':'url(/images/tab-4-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).css({ 'background':'url(/images/tab-4-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#hMenu ul li a').hover(
			function() {
				$(this).css({ 'background-color':'#007236', 'background-image':'none', 'color':'#FFF', 'height':'24px', 'padding':'2px 4px 2px 4px' });
			},
			function() {
				$(this).css({ 'background-color':'#FFF', 'background-image':'none','color':'#000', 'height':'24px','padding':'2px 4px 2px 4px' });
			}
		);
		
		$('#navsub_1240408_984374').hover(
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-5-white.png) no-repeat', 'margin-top':'-8px', 'color':'#000000','padding-top':'8px' });
			},
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-5-green.png) no-repeat', 'margin-top':'-8px', 'color':'#FFFFFF','padding-top':'8px' });
			}
		);
		
		$('#tlMenu a').hover(
			function() {
				$(this).css({ 'background':'url(/images/tab-5-white.png) no-repeat', 'margin-top':'-8px', 'color':'#000000','padding-top':'8px' });
			},
			function() {
				$(this).css({ 'background':'url(/images/tab-5-green.png) no-repeat', 'margin-top':'-8px', 'color':'#FFFFFF','padding-top':'8px' });
			}
		);
		
		$('#tlMenu ul li a').hover(
			function() {
				$(this).css({ 'background-color':'#007236', 'background-image':'none', 'color':'#FFF', 'height':'24px', 'padding':'2px 4px 2px 4px' });
			},
			function() {
				$(this).css({ 'background-color':'#FFF', 'background-image':'none','color':'#000', 'height':'24px','padding':'2px 4px 2px 4px' });
			}
		);
		
		$('#navsub_1240408_984375').hover(
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-6-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).parent('li').children('a').css({ 'background':'url(/images/tab-6-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#eMenu a').hover(
			function() {
				$(this).css({ 'background':'url(/images/tab-6-white.png) no-repeat', 'margin-top':'-16px', 'color':'#000000','padding-top':'0px' });
			},
			function() {
				$(this).css({ 'background':'url(/images/tab-6-green.png) no-repeat', 'margin-top':'-16px', 'color':'#FFFFFF','padding-top':'0px' });
			}
		);
		
		$('#eMenu ul li a').hover(
			function() {
				$(this).css({ 'background-color':'#007236', 'background-image':'none', 'color':'#FFF', 'height':'24px', 'padding':'2px 4px 2px 4px' });
			},
			function() {
				$(this).css({ 'background-color':'#FFF', 'background-image':'none','color':'#000', 'height':'24px','padding':'2px 4px 2px 4px' });
			}
		);
	
			
			$('li.headlink').hover(
			function() {
				var education = $(this).is("#eMenu");
				if(education){
					 $('ul', this).css('margin-left','-106px');
				}
				$('ul', this).css('display', 'block');						
			},
			function() { $('ul', this).css('display', 'none'); });
			
			$('li.headlink').hide;
			
			$('.captchaimg').after("<span style='font-size:11px;padding-left:24px;'>Type the characters you see in the picture above:</span>");
			
			$('#capsule').css("position","absolute");
			$('#capsuleEnd').css("position","absolute");
			$('#capsuleContent').css("position","absolute");
			
			//$('#capsule').css("left", (($(window).width() - $('#capsule').outerWidth()) / 2) + $(window).scrollLeft() + "px");
			
			//$('#capsule').width($(window).width() - $('#capsule').offset().left);
			
			//$('#capsuleEnd').css("left", "806px");			
			$('#capsuleEnd').css("left", $('#pageContent').offset().left + "px");
			$('#capsule').css("left", ($('#pageContent').offset().left + 88) + "px");
			$('#capsuleContent').css("left", ($('#pageContent').offset().left + 20) + "px");
			$('#capsule').width($(window).width() - $('#capsule').offset().left);
			
			$('#testimonials').css("left",$('#quickContactWrap').offset().left + "px");
			
			
		$('.circleBtnLink').each(function(index, element) {
            $(this).hover(function(e){ 
					var oImg = $(this).children('img').attr('src'); 
					var srcLength = oImg.length-4;
					var nImg = oImg.substring(0,srcLength);
					nImg = nImg+'-hover.png';
					$(this).children('img').attr('src',nImg);
				}, 
				function(e) {
					var oImg = $(this).children('img').attr('src');
					var srcLength = oImg.length-10;
					var nImg = oImg.substring(0,srcLength);
					nImg = nImg+'.png';
					$(this).children('img').attr('src',nImg);
				});
        });
		
		$('.formBtn').each(function(index, element) {
            $(this).hover(function(e){ 
					var oImg = $(this).attr('src'); 
					var srcLength = oImg.length-4;
					var nImg = oImg.substring(0,srcLength);
					nImg = nImg+'-hover.png';
					$(this).attr('src',nImg);
				}, 
				function(e) {
					var oImg = $(this).attr('src');
					var srcLength = oImg.length-10;
					var nImg = oImg.substring(0,srcLength);
					nImg = nImg+'.png';
					$(this).attr('src',nImg);
				});
        });
		
		$('.bannerLink').each(function(index, element) {
            $(this).hover(function(e){
				$(this).children('div').stop().animate({ opacity: 0.5 },300);
			},
			function(e) {
				$(this).children('div').stop().animate({ opacity: 0 },300);
			});
		});
		
		$('input[type="text"]').each(function(index, element) {
				
				var oVal = $(this).val();
				
                $(this).focus(function(e) {
                    
					if($(this).val() == oVal)
					{
						$(this).val('');
						$(this).css('color','#252525');
					}
                });
				
				$(this).blur(function(e) {
					if($(this).val() == '')
					{
						$(this).css('color','#959595');
						$(this).val(oVal);
					}
				});
            });
			
			$('textarea').each(function(index, element) {
				
				var oVal = $(this).val();
				
                $(this).focus(function(e) {
                    $(this).val('');
					$(this).css('color','#252525');
                });
				
				$(this).blur(function(e) {
					if($(this).val() == '')
					{
						$(this).css('color','#959595');
						$(this).val(oVal);
					}
				});
            });
		
	});
	
	
	
$(window).resize(function() {
			//$('#capsule').css("left", (($(window).width() - $('#capsule').outerWidth()) / 2) + $(window).scrollLeft() + "px");
			//$('#capsuleEnd').css("left", ((($(window).width() - $('#capsuleEnd').outerWidth()) / 2) + $(window).scrollLeft() - 66) + "px");		
			$('#capsuleEnd').css("left", $('#pageContent').offset().left + "px");
			$('#capsule').css("left", ($('#pageContent').offset().left + 88) + "px");
			$('#capsuleContent').css("left", ($('#pageContent').offset().left + 20) + "px");
			$('#capsule').width($(window).width() - $('#capsule').offset().left);
			$('#testimonials').css("left",$('#quickContactWrap').offset().left + "px");
	
});


