// JavaScript Document
$(document).ready(function() {
	//quick little function to make the yellow_button_arrow classes look pretty.
	$(".yellow_button_arrow").each(function(){
		$(this).wrapInner("<span class='yellow_button_arrow_content'></span>");
		$(this).prepend("<span class='yellow_button_arrow_start'></span>");
		$(this).append("<span class='yellow_button_arrow_end'></span>");
		$(this).after("<span class='clear'></span>");
		$(this).before("<span class='clear'></span>");
		//now set the height of all the elements inside the h3 to the same height as the others.
		var main_button_height = $(this).children(".yellow_button_arrow_content").height();
		new_height = "height: "+eval(main_button_height+11)+"px !important;";
		$(this).children(".yellow_button_arrow_start").attr("style", new_height);
		$(this).children(".yellow_button_arrow_end").attr("style", new_height);
		$(this).attr("style", new_height);
		//max-width for ie6
		if($.browser.msie && parseInt($.browser.version) <= 6) {
			if ($(this).children(".yellow_button_arrow_content").width() > 360) {
				$(this).children(".yellow_button_arrow_content").width("360px");
			}
		}
	});
	
	$(".yellow_button_check").each(function(){
		$(this).wrapInner("<span class='yellow_button_check_content'></span>");
		$(this).prepend("<span class='yellow_button_check_start'></span>");
		$(this).append("<span class='yellow_button_check_end'></span>");
		$(this).after("<span class='clear'></span>");
		$(this).before("<span class='clear'></span>");
		//now set the height of all the elements inside the h3 to the same height as the others.
		var main_button_height = $(this).children(".yellow_button_check_content").height();
		new_height = "height: "+eval(main_button_height+11)+"px !important;";
		$(this).children(".yellow_button_check_start").attr("style", new_height);
		$(this).children(".yellow_button_check_end").attr("style", new_height);
		$(this).attr("style", new_height);
		//max-width for ie6
		if($.browser.msie && parseInt($.browser.version) <= 6) {
			if ($(this).children(".yellow_button_check_content").width() > 360) {
				$(this).children(".yellow_button_check_content").width("360px");
			}
		}
	});
	
	$(".grey_button").each(function(){
		$(this).wrapInner("<span class='grey_button_content'></span>");
		$(this).prepend("<span class='grey_button_start'></span>");
		$(this).append("<span class='grey_button_end'></span>");
		$(this).after("<span class='clear'></span>");
		$(this).before("<span class='clear'></span>");
		//now set the height of all the elements inside the h3 to the same height as the others.
		var main_button_height = $(this).children(".grey_button_content").height();
		new_height = "height: "+eval(main_button_height+11)+"px !important;";
		$(this).children(".grey_button_start").attr("style", new_height);
		$(this).children(".grey_button_end").attr("style", new_height);
		$(this).attr("style", new_height);
		//max-width for ie6
		if($.browser.msie && parseInt($.browser.version) <= 6) {
			if ($(this).children(".grey_button_content").width() > 360) {
				$(this).children(".grey_button_content").width("360px");
			}
		}
	});

	$(".grey_button_notes").each(function(){
		$(this).wrapInner("<span class='grey_button_notes_content'></span>");
		$(this).prepend("<span class='grey_button_notes_start'></span>");
		$(this).append("<span class='grey_button_notes_end'></span>");
		$(this).after("<span class='clear'></span>");
		$(this).before("<span class='clear'></span>");
		//now set the height of all the elements inside the h3 to the same height as the others.
		var main_button_height = $(this).children(".grey_button_notes_content").height();
		new_height = "height: "+eval(main_button_height+11)+"px !important;";
		$(this).children(".grey_button_notes_start").attr("style", new_height);
		$(this).children(".grey_button_notes_end").attr("style", new_height);
		$(this).attr("style", new_height);
		//max-width for ie6
		if($.browser.msie && parseInt($.browser.version) <= 6) {
			if ($(this).children(".grey_button_notes_content").width() > 360) {
				$(this).children(".grey_button_notes_content").width("360px");
			}
		}
	});

	$(".blue_button_video").each(function(){
		$(this).wrapInner("<span class='blue_button_video_content'></span>");
		$(this).prepend("<span class='blue_button_video_start'></span>");
		$(this).append("<span class='blue_button_video_end'></span>");
		$(this).after("<span class='clear'></span>");
		$(this).before("<span class='clear'></span>");
		//now set the height of all the elements inside the h3 to the same height as the others.
		var main_button_height = $(this).children(".blue_button_video_content").height();
		new_height = "height: "+eval(main_button_height+11)+"px !important;";
		$(this).children(".blue_button_video_start").attr("style", new_height);
		$(this).children(".blue_button_video_end").attr("style", new_height);
		$(this).attr("style", new_height);
		//max-width for ie6
		if($.browser.msie && parseInt($.browser.version) <= 6) {
			if ($(this).children(".blue_button_video_content").width() > 360) {
				$(this).children(".blue_button_video_content").width("360px");
			}
		}
	});
	
	$(".green_button_donations").each(function(){
		$(this).wrapInner("<span class='green_button_donations_content'></span>");
		$(this).prepend("<span class='green_button_donations_start'></span>");
		$(this).append("<span class='green_button_donations_end'></span>");
		$(this).after("<span class='clear'></span>");
		$(this).before("<span class='clear'></span>");
		//now set the height of all the elements inside the h3 to the same height as the others.
		var main_button_height = $(this).children(".green_button_donations_content").height();
		new_height = "height: "+eval(main_button_height+11)+"px !important;";
		$(this).children(".green_button_donations_start").attr("style", new_height);
		$(this).children(".green_button_donations_end").attr("style", new_height);
		$(this).attr("style", new_height);
		//max-width for ie6
		if($.browser.msie && parseInt($.browser.version) <= 6) {
			if ($(this).children(".green_button_donations_content").width() > 360) {
				$(this).children(".green_button_donations_content").width("360px");
			}
		}
	});

});