﻿/*@cc_on
eval((function(props) {
  var code = [];
  for (var i = 0, l = props.length;i<l;i++){
    var prop = props[i];
    window['_'+prop]=window[prop];
    code.push(prop+'=_'+prop)
  }
  return 'var '+code.join(',');
})('document self top parent alert setInterval clearInterval setTimeout clearTimeout'.split(' ')));
@*/

/*
画像のポップアップ表示
*/
function DispPic(url) {
    w = window.open('PicWindow.aspx?url='+url,'_blank','left=20,top=20,width=760,height=560,resizable=yes,scrollbars=yes,menubar=no,status=no,toolbar=no'); 
}

/**
 *	入力エリア判定(INPUTタグ)
 */
function isInput() {
	// テキスト、パスワード、ファイル参照は「true」を返す
	for (i = 0; i < document.all.tags("INPUT").length; i++) {
		if (document.all.tags("INPUT")(i).name == window.event.srcElement.name &&
			(document.all.tags("INPUT")(i).type == "text" || document.all.tags("INPUT")(i).type == "password" || document.all.tags("INPUT")(i).type == "file") &&
			document.all.tags("INPUT")(i).readOnly == false){
			return true;
		}
	}
	// 上記以外は「false」を返す
	return false;
}

/**
 *	入力エリア判定(TEXTAREAタグ)
 */
function isTextArea() {
	// テキストエリアは「true」を返す
	for (i = 0; i < document.all.tags("TEXTAREA").length; i++) {
		if (document.all.tags("TEXTAREA")(i).name == window.event.srcElement.name && 
		    document.all.tags("TEXTAREA")(i).readOnly == false){
			return true;
		}
	}
	// 上記以外は「false」を返す
	return false;
}

/**
 *	リンクエリア判定(Aタグ)
 */
function isAnchorArea() {
	// リンクエリアは「true」を返す
	for (i = 0; i < document.all.tags("A").length; i++) {
		if (document.all.tags("A")(i).name == window.event.srcElement.name && 
		    document.all.tags("A")(i).readOnly == false){
			return true;
		}
	}
	// 上記以外は「false」を返す
	return false;
}

///**
// *	キー押下時の制御
// */
//function onKeyDown(e) {
//	if (navigator.appName == "Microsoft Internet Explorer") {
//		// [BackSpace(戻る,進む)] 押下禁止
//		if ( event.keyCode == 8 ) {
//			// ※入力エリアのみ許可
//			if (isInput()    == true) return true;
//			if (isTextArea() == true) return true;
//			return false;
//		}
//		// [Enter] 押下禁止
//		if( event.keyCode == 13 ) {
//			// ※入力エリア、リンクエリアのみ許可
//			if (isTextArea() == true) return true;
//			if (isAnchorArea() == true) return true;
//			return false;
//		}
//		// [F3(Webページ検索)][F5(再読込)][F6(フレーム移動)]  押下禁止
//		if ( event.keyCode == 114 || event.keyCode == 116 || event.keyCode == 117 ) {
//			event.keyCode = null;
//			return false ;
//		}
//		// [Alt+○] 押下禁止
//		if ( event.altKey == true ) {
//				// ←(戻る), →(進む), HOME(スタートページ)のみ禁止
//			if ( event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 36 ) {
//				// alert('ショートカットキーは使えません' );
//				return false ;
//			}
//			// ※上記以外許可
//			return true;
//		}
//		// [Ctrl+○] 押下禁止
//		if (event.ctrlKey == true ) {
//			// R(再読込), N(新規ﾌﾞﾗｳｻﾞ), I(お気に入り表示), D(お気に入り登録)
//			// B(お気に入り整理), H(履歴), O/L(URL入力), E(Webﾍﾟｰｼﾞ検索), Tab(ﾌﾚｰﾑ移動) のみ禁止
//			if ( event.keyCode == 82 || event.keyCode == 78 || event.keyCode == 73 ||
//			     event.keyCode == 68 || event.keyCode == 66 || event.keyCode == 72 ||
//			     event.keyCode == 79 || event.keyCode == 76 || event.keyCode == 69 ||
//			     event.tabKey == true ) {
//				// alert('ショートカットキーは使えません' );
//				return false;
//			}
//			// ※上記以外許可
//			return true;
//		}
//		return true;
//	
//	} else if (navigator.appName == "Netscape") {
//		if (e.which == 8) {
//			return false;
//		}
//	}
//}
//window.document.onkeydown = onKeyDown;

///**
// *	ホイールボタン使用時の制御
// */
//function onMouseWheel() {
//	if (navigator.appName == "Microsoft Internet Explorer") {
//		// Shift(戻る,進む) 禁止
//		if ( event.shiftKey == true ) {
//			return false;
//		}
//	}
//}
//window.document.onmousewheel = onMouseWheel;

///**
// *	ドラッグ&ドロップ禁止
// */
//function onDragDrop(e) {
//	if (navigator.appName == "Microsoft Internet Explorer") {
//		return false;
//	}
//}
//window.document.ondragdrop = onDragDrop;

///**
// *	コンテキストメニュー使用禁止
// */
//function onContextMenu() {
//	if (navigator.appName == "Microsoft Internet Explorer") {
//		return false;
//	}
//}
//// 開発時にはソースを見たいのでコメント化(リリース時にはコメント化解除)
//window.document.oncontextmenu = onContextMenu;

///**
// *	サブミット用非可視コントロール動的生成
// */
//function writePostBackParts() {
//	if (navigator.appName == "Microsoft Internet Explorer") {
//		var theform = document.form1;
//		if ((document.form1.__EVENTTARGET) == undefined) {
//		    theform.innerHTML += '<input type="hidden" id="__EVENTTARGET" name="__EVENTTARGET" value="" />';
//		}
//		if ((document.form1.__EVENTARGUMENT) == undefined) {
//		    theform.innerHTML += '<input type="hidden" id="__EVENTARGUMENT" name="__EVENTARGUMENT" value="" />';
//		}
//	}
//}

///**
// *	サブミット用
// */
//function doPostBack (eventTarget, eventArgument) {
//    writePostBackParts();
//	var theform = document.form1;
//	theform.__EVENTTARGET.value = eventTarget;
//	theform.__EVENTARGUMENT.value = eventArgument;
//    posted = 1;
//	theform.submit();
//}

///**
// *	ログアウト画面へ遷移（未使用）
// */
//function logout () {
//	location.href('../dmc/****.aspx');
//}

///**
// *	ダブルポスト防止
// */
//var posted = 0;
//function isPosted(){
//	if(posted == 0){
//		posted = 1;
//		return true;
//	}else{
//		return false;
//	}
//}

///**
// *	スクロールの表示・非表示を設定
// *	ダイアログ表示のスクリプトが優先される為、以下の構文は使用できない
// */
//function scrollbar(a){
//	if(document.body){
//		document.body.scroll=a?"auto":"no"
//		if(window.innerHeight){
//			document.body.style.height=a?"auto":window.innerHeight-32
//			document.body.style.width=a?"auto":window.innerWidth-32
//			document.body.style.overflow=a?"visible":"hidden"
//		}
//	}else
//		if(document.height){
//			if(a&&document._height){
//				document.height=document._height
//				delete document._height
//				document.width=document._width
//				delete document._width
//				window.onresize=window._resize
//		}
//		if(!a){
//			if(!document._height){
//				document._height=document.height
//				document._width=document.width
//				window._resize=window.onresize
//				window.onresize=new Function("if(window._resize)_resize();scrollbar(false)")
//			}
//			document.height=window.innerHeight
//			document.width=window.innerWidth
//		}
//	}
//}

/**
 	表示位置中央寄せ(通常)
 */
function  moveCenter() {
	// window.open()起動時
	x = (screen.width  - window.width) / 2;
	y = (screen.height - window.height) / 2;
	try{
		moveTo(x,y);
	} catch(e){
	}
}

/**
 *	表示位置中央寄せ(モーダルダイアログ)
 */
function  moveCenterDialog() {
	// showModalDialog()起動時
	x = (screen.width  - window.width) / 2;
	y = (screen.height - window.height) / 2;
	try{
		window.dialogLeft = x + "px";
		window.dialogTop = y + "px";
	} catch(e){
	}
}

/**
 *	Window起動(予備)
 */
function start() {
    var menu = window.open('./********.aspx', '_blank',
                           'menubar=no,scrollbars=yes,status=no,toolbar=no,width=1000,height=700,top=0,left=0,resizable=yes');
    menu.moveTo(0,0);
    menu.resizeTo(window.screen.availWidth, window.screen.availHeight);
    window.opener = self;
    window.close();
}

/**
 *	サブウインドウ表示（予備）
 */
function openSyoriKbnList() {
    var list = window.open('*****.html', '******',
                           'menubar=no,scrollbars=yes,status=no,toolbar=no,width=480,height=600,top=84,left=272,resizable=yes');
	x = (screen.width  - 480) / 2;
	y = (screen.height - 600) / 2;
	try{
		list.moveTo(x,y);
	} catch(e){
	}
}

/*  キーダウン処理２ */

function text_keydown(e, name) {
    var key = 0;
    if (typeof(e.keyCode) != 'undefined') {
        key = e.keyCode;
    } else if (typeof(e.which) != 'undefined') {
        key = e.which;
    }
    if (key == 0xd) {
        if (typeof(name) != 'undefined' && name != '') {
            document.forms[0].elements[name].click();
        }
        return false;
    }
    return true;
}

/* CalenderControlExtender(AJAX1.0) の不可解な動作に対応するため */

/* カレンダ表示時にダミーラベルを拡大表示する */
function CalPopUp()
{
    document.getElementById("lbldmy").style.display = "block";  //表示 
    document.getElementById("lbldmy").style.height = 200;
}

/* カレンダ非表示時にダミーラベルを非表示にする */
function CalPopDown()
{
    document.getElementById("lbldmy").style.height = 1; 
    document.getElementById("lbldmy").style.display ="none";    //非表示  
}

/* フルスクリーン表示 */
function ResizeTofullScreen()
{
    window.resizeTo(screen.width,screen.height);
}

/* SVGA固定で表示する */
function ResizeToRegularSize()
{
    window.moveTo(0,0);
    window.resizeTo(1024,768);
}
