/*@cc_on _d=document;eval('var document=_d')@*/
document.ondragstart=dragNOP;
document.oncontextmenu=contextNOP;
document.onkeydown=keyNOP;
document.onkeyup=keyNOP;
function initTop(){
	a = parent.document.getElementById('main');
	var strUA = navigator.userAgent.toLowerCase();
	if(strUA.indexOf("opera") != -1){
		a.style.height='1560px';
	}else if(strUA.indexOf("firefox") != -1){
		a.style.height='1575px';
	}else if(strUA.indexOf("chrome") != -1){
		a.style.height='1575px';
	}else if(strUA.indexOf("safari") != -1){
		a.style.height='1575px';
	}else if(strUA.indexOf("windows") != -1){
		a.style.height='1520px';
	}else if(strUA.indexOf("netscape") != -1){
		a.style.height='1575px';
	}else if(strUA.indexOf("msie") != -1){
		a.style.height='1575px';
	}else if(strUA.indexOf("mozilla/4") != -1){
		a.style.height='1575px';
	}
}
/**
 * ドラッグ抑止
 * @since 2009.1.15
 */
function dragNOP() {
    event.returnValue = false;
    return false;
}
/**
 * 右クリック抑止
 * @since 2009.1.15
 */
function contextNOP(){
	history.back();
	return false;
}
function openFullscreen(path) {
	window.opener = window;
	window.open(path,'yakeistyle','location=no,toolbar=no,status=no,menuber=no,fullscreen=yes,scrollbars=no,width='+screen.availWidth+',height='+screen.availHeight);
}
function openFullWindow(path,name) {
	window.opener = window;
	window.open(path,name,'fullscreen=yes,location=no,toolbar=no,status=no,menuber=no,scrollbars=no,width='+screen.availWidth+',height='+screen.availHeight);
}
function simple_open(path,name){
	window.opener = window;
	window.open(path,name,'location=no,toolbar=no,status=no,menuber=no,fullscreen=yes,scrollbars=no,width='+screen.availWidth+',height='+screen.availHeight);
}
/**
 * キーボード抑止
 * @since 2009.1.15
 */
function keyNOP(){
    // Ctrl+O,Ctrl+P,Ctrl+F,Esc
    if((event.ctrlKey && event.keyCode == 79) ||
       (event.ctrlKey && event.keyCode == 80) ||
       (event.ctrlKey && event.keyCode == 70) ||
       (event.ctrlKey && event.keyCode == 65) ||
        event.keyCode == 27){
        event.returnValue = false;
        event.keyCode = 0;
        return false;
    }
    // Alt+Home
    if(event.altKey && event.keyCode == 36)
    {
        alert("その操作は禁止されています。");
        event.keyCode = 0;
        return false;
    }
    // その他Altキー
    if (event.altKey){
        return false;
    }
    // その他Shiftキー
    if (event.shiftKey && event.keyCode == 13) {
        return false;
    }
    // その他Ctrlキー（Ctrl+A,C,X,V,Zは除く）
    if (event.ctrlKey && !(event.ctrlKey && event.keyCode == 65) &&
        !(event.ctrlKey && event.keyCode == 67) && !(event.ctrlKey && event.keyCode == 86) &&
        !(event.ctrlKey && event.keyCode == 88) && !(event.ctrlKey && event.keyCode == 90)){
		// event.keyCode = 0;
        return false;
    }
    // F3,F5,F11
    if(event.keyCode == 114 || event.keyCode == 122 || event.keyCode == 116){
        event.keyCode = 0;
        return false;
    }
    // BackSpace
    if(event.keyCode == 8){
        if(window.event.srcElement.type == "text" || window.event.srcElement.type == "textarea" ||
           window.event.srcElement.type == "password" || window.event.srcElement.type == "file"){
            if (window.event.srcElement.readOnly) {
                return false;
            }else{
                return true;
            }
        }else{
            return false;
        }
    }
}
function setCookie(value){
	date = new Date();
	year = date.getYear() + 1;
	var setCookie = "todoufuken=" + escape(value) + ";expires=Fri, 1-Jan-"+ year +" 23:59:59 GMT;";
	document.cookie = setCookie;
}
function getCookie(kword){
	if(typeof(kword) == "undefined"){
		return "";
	}
	kword = kword + "=";
	kdata = "";
	scookie = document.cookie + ";";    // クッキー情報を読み込む
	start = scookie.indexOf(kword);    // キーワードを検索
	if (start != -1){    // キーワードと一致するものあり
		end = scookie.indexOf(";", start);    // 情報の末尾位置を検索
		kdata = unescape(scookie.substring(start + kword.length, end));  // データ取り出し
	}
	return kdata;
}
