
jQuery(document).ready(function($) {
	
	bottom_height = jQuery('#main').height() +400;
	bottom_height_left = jQuery('#bottom').height() +400;
	
	if (bottom_height_left > bottom_height) {
		jQuery('#wrapper').css('height', bottom_height_left);
	}
	else {
		jQuery('#wrapper').css('height', bottom_height);
		}
	getImages(5);
	
	jQuery("#button1").click(function() {getImages(0);return false;});	
	jQuery("#button2").click(function() {getImages(1);return false;});	
	jQuery("#button3").click(function() {getImages(2);return false;});	
	jQuery("#button4").click(function() {getImages(3);return false;});	
	jQuery("#button5").click(function() {getImages(4);return false;});	
	jQuery("#button6").click(function() {getImages(5);return false;});	
	
});


	// white 0
	// red 1
	// yellow 2
	// blue 3
	// green 4

function getImages(num) {
	
	if(num == 0) { 
	
		for(i=2; i< 31; i++) {
			
			//var randomnum = Math.floor(Math.random()*28);
			//var randomimg = "/wp-content/themes/danielakirsch/images/comps/monster/"+randomnum+".png";
			jQuery("#img"+i).css("background-image","url(/wp-content/themes/danielakirsch/images/comps/monster_comps/"+i+".png)");
			//jQuery("#img"+i).css("background-image","url("+randomimg+")");	
			
			}	
		}
	
	if(num == 1) { //green
		for(i=1; i< 31; i++) {jQuery("#img"+i).css("background-image","url(/wp-content/themes/danielakirsch/images/comps/4/"+i+".png)");	}	
	}
	
	if(num == 2) { // red
		for(i=1; i< 31; i++) {jQuery("#img"+i).css("background-image","url(/wp-content/themes/danielakirsch/images/comps/1/"+i+".png)");	}	
	}
	
	if(num == 3) { // yellow
		for(i=1; i< 31; i++) {jQuery("#img"+i).css("background-image","url(/wp-content/themes/danielakirsch/images/comps/2/"+i+".png)"); }	
	}
	
	if(num == 4) { // blue
		for(i=1; i< 31; i++) {jQuery("#img"+i).css("background-image","url(/wp-content/themes/danielakirsch/images/comps/3/"+i+".png)");	}	
	}
	
	if(num == 5) { 
			for(i=1; i< 31; i++) {jQuery("#img"+i).css("background-image","url(/wp-content/themes/danielakirsch/images/comps/"+Math.floor(Math.random()*5)+"/"+i+".png)");	}	
	}
	
}
