$(document).ready(function(){
	$('input[type=hidden]').each(function(){
		$(this).css('display', 'none');
	});
		
	$(':input').focus(function(){
		if($(this).val() == $(this).attr('rel')){
			$(this).val('');
		}
	}).blur(function(){
		if($(this).val() == ''){
			var atty = $(this).attr('rel');
			$(this).val(atty);
		}
	});

	var wind = $(window).height();
	var bod = $('#content').height();
	
	if(wind > bod){
		$('#topbg').css('min-height', wind+'px');
	}else{
		$('#topbg').css('min-height', bod+'px');
	}
	
	var onC = '#c9c9c9';
	var offC = '#7b7b7b';
	//SHOW HIDE PASSWORD BOX
		$('input[name=Password]').css('display', 'none');
		
		$('input[name=PassShow]').focus(function(){
			$(this).css('display', 'none');
			$('input[name=Password]').css('display', 'block');
			$('input[name=Password]').focus();
		});
		
		$('input[name=Password]').blur(function(){
			if($(this).val() == ''){
				$(this).css('display', 'none');
				$('input[name=PassShow]').css('display', 'block');
				$('input[name=PassShow]').css('color', offC);
				$('input[name=PassShow]').val('Password');
			}
		});
	//SHOW HIDE PASSWORD BOX

	//CALCULATOR
	$('#button').click(function(){
		var cases = $('input[name=Cases]').val();
		
		if(isNaN(cases)){
			alert('You need to input a numeric number.');
		}else{
			var week = cases * 15.666;
			var week = week.toFixed(2);
			var Fweek = '$'+week;
			
			var year = week * 12;
			var year = year.toFixed(2);
			var Fyear = '$'+year;

			$('input[name=Week]').val(Fweek);
			$('input[name=Year]').val(Fyear);
		}
	});
	
	$("a[rel='example1']").colorbox();
	
});
