$(document).ready(function(){
	$('#calendar a:last').css('border', 'none');
	$('#inner_nav a:last').css('border', 'none');
	$('#foot_nav a:first').css('margin-left', '40px');
	$("#foot_nav a:last").css({border : 'none', padding : '0px'});
    
	$('#okAll :input').focus(function(){
		if($(this).val() == $(this).attr('rel')){
			$(this).val('');
		}
	}).blur(function(){
		if($(this).val() == ''){
			var atty = $(this).attr('rel');
			$(this).val(atty);
		}
	});    
    
    $('#faq div').hide();
	j = 1;
	$('#faq a').each(function(i){
		testy = $(this).attr('href');
		if(testy == '#'){
			$(this).next().attr('id', 'faq_'+j);
			$(this).attr('rel', j);
			$(this).css({'text-decoration' : 'none', 'font-weight' : 'bold'});
			$(this).before('<br />');
			$(this).after('<br />');
		}
		j++;
	});
	
	$('#faq a').click(function(){
		var whatLink = $(this).attr('href');
						
		var relID = $(this).attr('rel');
		var faqID = 'faq_'+relID;
		
		if($('#'+faqID).is(':hidden')){
			$('#'+faqID).slideDown('slow');
		}else{
			$('#'+faqID).slideUp('slow');
		}
		
		if(whatLink == '#'){
			return false;
		}
	});

   	$('#slide').innerfade({
		speed: 'slow',
		timeout: 4000,
		type: 'sequence',
		containerheight: '482px'
	});
	
	var h1 = $("#main_box").height();
	var h2 = $("#content_right").height();
	
	if(h1 >= h2){
		if(h1 >= 274){
			var putHeight = h1 - 274;
		}else{
			var putHeight = 0;
		}
	}else{
		if(h2 >= 274){
			var putHeight = h2 - 274;
		}else{
			var putHeight = 0;
		}
	}
	
	$("#shad_mid").css('height', putHeight);
    $('.button_bg').hover(
      function () {
        $(this).css('background-image', 'none');
        $('img', this).css('border-color', '#b1b1b1');
      }, 
      function () {
        $(this).css('background-image', 'url(images/button_bg.png)');
        $('img', this).css('border-color', '#ffffff');
      }
    );
});