// JavaScript Document

(function($){

	$(document).ready(function(){

		// set year in copyrights.
		$('#footer .copy').html('Copyright &copy; 2005-'+ (new Date().getFullYear() || '2010') +' PL Tokyo Health Care Center. All Rights Reserved.');
		
		// font-size
		$('#header .fontsize .middle').click(
			function(){
				setActiveStyleSheet('font_middle'); return false;
			}
		);
		$('#header .fontsize .large').click(
			function(){
				setActiveStyleSheet('font_large'); return false;
			}
		);
		
		// form
		$('#content .heading_form .up').hide(0);
		$('#content .table_box').hide(0);
		
		$('#content .heading_form .up').click(
			function(){
				$(this).parents('.heading_form').next('.table_box').slideUp(500);
				$(this).hide(0).parent().children('.down').show(0);
				return false;
			}
		);
		
		$('#content .heading_form .down').click(
			function(){
				$(this).parents('.heading_form').next('.table_box').slideDown(500);
				$(this).hide(0).parent().children('.up').show(0);
				return false;
			}
		);

		$('#content .heading_form .down').each(
			function(){
				$(this).parents('.heading_form').next('.table_box').slideDown(0);
				$(this).hide(0).parent().children('.up').show(0);
				return false;
			}
		);
		
		$('.table_box input[type="text"]').each(
			function(){ 
				if ( '' != $(this).val() )
				{
					$(this).addClass('include_value').parents('.table_box').slideDown(0).prev('.heading_form').find('.down').hide(0).parent().children('.up').show(0);
				};
			}
		);
		
		// popup
		$('#content .popup').click(
		   function(){
			   window.open(this.href,'schedule',' status=no, toolbar=no, location=no, menubar=no, scrollbars=yes, resizable=no, height=590, width=635');
			   return false;
		   }
		);

		$('#content .blank').click(
		   function(){
			   window.open(this.href,'_blank');
			   return false;
		   }
		);

		// for ie6.
		var browser_ver = navigator.userAgent.indexOf('MSIE 6', 0);
		if ( browser_ver >= 0 ){
			try {  
				// alert (browser_ver);
				document.execCommand('BackgroundImageCache', false, true);  
			} catch(e) {} 
		};
	});

})(jQuery);

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17968409-1']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

