//移動系
function selfAction(URL){ 
	self.location.href=URL;
}
function parentAction(URL){ 
	parent.location.href=URL;
}
//削除系
function checkDialog(URL,str){
	if(confirm(str)){
		parent.location.href=URL;
	}else{
		return 0;
	}
}
function deleteEvent(URL){
	if(confirm("本当に削除してもいいですか？")){
		parent.location.href=URL;
	}else{
		return 0;
	}
}
function deleteSelfEvent(URL){
	if(confirm("本当に削除してもいいですか？")){
		self.location.href=URL;
	}else{
		return 0;
	}
}
function deleteComment(url,message){
	if(message != ""){
		var afterMessage = "";
		messageArray = message.split("<br />");
		for(i = 0;i < messageArray.length;i++){
			if(i != 0){
				afterMessage += "\n";
			}
			afterMessage += messageArray[i];
		}
		if(confirm(afterMessage)){
			parent.location.href=url;
		}else{
			return 0;
		}
	}
}

/*********************************************************
	別ウィンドウを開く
	URL:	リンク先
*********************************************************/
function openWindow(URL){
	window.open(URL,"","scrollbars=1,resizable=1");
}
function openFullWindow(URL){
	var examinationWindow;
	myX = screen.width;
	myY = screen.height;
	myAgent = navigator.userAgent;
	if(myAgent.indexOf("Win") != -1){//Windows
		if(myAgent.indexOf("Firefox") != -1){//firefox
			myOption = "top=0,left=0,screenX=0,screenY=0,width="+myX+",height="+myY+",scrollbars=yes,resizable=no";
		}else if(myAgent.indexOf("Netscape") != -1){//Netscape
			myOption = "top=0,left=0,screenX=0,screenY=0,width="+myX+",height="+myY+",scrollbars=yes,resizable=no";
		}else{//それ以外
			myOption = "fullscreen=1,scrollbars=0";
		}
	}else{//Mac
		myOption = "top=0,left=0,screenX=0,screenY=0,width="+myX+",height="+myY+",scrollbars=yes,resizable=no";
	}
	examinationWindow = window.open(URL,"subWin",myOption);
	examinationWindow.focus();
}
/*********************************************************
	ボタンを非表示にする
	Target:	ロックするＩＤ
	Count:	ループ回数
*********************************************************/
function lock(Target,Count){
	if(Count == "0"){
		$(Target).disabled=true;
	}else{
		for(i = 0;i < Count;i++){
			$(Target+i).disabled=true;
		}
	}
}

/********************************************************
	説明文表示パネル
*********************************************************/
function explainOpenAction(target,no,count){
	for(i = 1;i <= count;i++){
		if($(target+"_"+i) != null){
			$(target+"_"+i).style.display = "none";
		}
	}
	if($(target+"_"+no) != null){
		$(target+"_"+no).style.display = "block";
	}
}

function explainCloseAction(target){
	if($(target) != null){
		$(target).style.display = "none";
	}
}

/******************* 印刷関係 ******************/
function printAction(URL){
	$('printButton').disabled = true;
	$('printMessage').style.display = "block";
	printIFrame.location.href = URL;
}

function selfPrintOut(){
	self.focus();
	self.print();
}

function printUnlockAction(){
	parent.$('printButton').disabled = false;
	parent.$('printMessage').style.display = "none";
}
/************************************************
	カレンダー
*************************************************/
// サブウィンドウの表示方法を指定する
var calendarWin;
function openCalendarWindow(URL) {
	l = 725; // 表示するx座標
	t = 155; // 表示するy座標
	w = 255; // 横幅
	h = 292; // 縦幅
	
	calendarWin = window.open(URL,"CalenadarWindow",
		"screenX="+l+",screenY="+t+",left="+l+",top="+t+",width="+w+",height="+h+", scrollbars=no,location=no,menubar=no,toolbar=no, status=no,directories=no,resizable=yes");
	calendarWin.focus();
}

function calendarAction(url){
	opener.self.location.href=url;
	//opener.window.focus();
}

function calendarCheck(target){
	if(opener.$(target) == null){
		window.close();
	}
}
