$(window).load(function(){
	
	//altering table rows
	$("table tr:even").addClass("alt-row");
	
	//styling last td
	$("table th:last-child").css("border", "none");
	$("table td:last-child").css("border", "none");
	
	// setup height of content
	editHeight($('#content_inner'), 68, 54);
	
	//contact form antispam
	$('#human_chck').val(1);
	
	//bulk actions
	$('.bulk-actions select.second').hide();
	$('.bulk-actions select.first').click(function(){
		var obj = $('.bulk-actions select.first :selected').attr('class');
		if(obj == 'nextSelect'){
			$('.bulk-actions select.second').show();
		}else{
			$('.bulk-actions select.second').hide();
		}
	});
	
	//fix content floated images
	$('#content_inner img').each(function(){
		var float = $(this).css('float');
		if(float == 'left')$(this).css('marginRight','5px');
		if(float == 'right')$(this).css('marginLeft','5px');
	});
	
	//partners to new window
	$('#partners a').click(function() { window.open($(this).attr('href')); return false; });
});

function editHeight(obj,bgHeight,bgMinHeight)
{
	var height = obj.height();
	var rest = height % bgHeight;
	if(rest < bgMinHeight)
	{
		height += bgMinHeight - rest;
		obj.height(height);
	}
}
