$(document).ready(function(){

// height 100%
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
$("#footer_bg").css("min-height", viewportHeight);

// news archive

$("h1.archive_header a").click(function(){

var rel = '#archive_'+$(this).attr("rel");

	if($(rel).css("display") == 'block'){

	$(rel).slideUp();
	$("img", this).attr("src","/images/news_archive_open.gif");

	}

	else{

	$(rel).slideDown();
	$("img", this).attr("src","/images/news_archive_close.gif");

	}

});

// checkbox

$('.services_form_row_right').each(function(index) {

var current_id = $("input", this).attr("id");
$(this).html('<input type="hidden" name="'+current_id+'" id="'+current_id+'" value="0" /><a rel="'+current_id+'"></a>');

});


$('.services_form_row_right a').live('click', function(){

var current_rel = '#'+$(this).attr("rel");

	if($(this).attr("class") == 'checked'){

	$(current_rel).val('0');
	$(this).removeClass('checked');
	$(this).css("background-position", "0 0");
	
	}
	
	else{
	
	$(current_rel).val('1');
	$(this).addClass('checked');
	$(this).css("background-position", "0 -16px");
	
	}

});



});

$(window).resize(function(){

// height 100%
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
$("#footer_bg").css("min-height", viewportHeight);

});
