// JavaScript Document
var stat="true";
function check(x,n) {
	//document.write("x : "+x+" n : "+n);
	if(stat=="true"){
		for (var i = 1; i <= n; i++) {
			box = eval("document."+x+".chk"+i);
			if (box.checked == false){box.checked = true};
		}
		stat="false";
		return "x";
	}else{
		for (var i = 1; i <= n; i++) {
			box = eval("document."+x+".chk"+i);
			if (box.checked == true){box.checked = false};
		}
		stat="true";
		return "y";
	}
	
}

// Tiny Mce
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,advimage,pagebreak,advhr,advlink,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
		//plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,blockquote,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		force_p_newlines : 1,
		force_br_newlines : 0,
		file_browser_callback : "tinyBrowser",
		
		relative_urls : false
	});

// date picker & other jquery function

	$(document).ready(function () {
		$("#general_birthdate,#family_birthdate,#report_date").datepicker({
		dateFormat: 'YMD-'
		});
	});


// suckerfish 
	sfHover = function() {
		var sfEls = document.getElementById("nav").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);

// check character
	

