$(function(){
	$( '.o-but a' ).click( function( ev ) {
		ev = ev || window.event;
		ev.preventDefault ? ev.preventDefault() : ev.returnValue = false;
		var parent = $( this ).parents( '.bill-block' );
		var id = parent.attr( 'id' );
		
		if( id ) {
			$( '.c-sub-grad:hidden' ).show();
			$( '.c-shadow' ).not( ':hidden' ).hide();
			var isOffline = '';

			if( $( this ).parents( '.o-but' ).hasClass( 'o-orange' ) ) {
				isOffline = '-offline';
			}

			$( '.' + id + isOffline + ':hidden' ).show();
		}
	});
	$( '.p-close' ).click( function() {
		$( '.c-shadow, .c-sub-grad' ).not( ':hidden' ).hide();
	});
	
	$('.c-sub-grad .c-shadow a.link').each(function() {
		link = '?tab='+$(this).parents( '.c-shadow' ).attr( 'class' );
		$(this).attr( 'href', link.replace(/c-shadow\ /, '') );
	});
	
});


