﻿try {document.execCommand("BackgroundImageCache", false, true);} catch(e) {}

function rolling_bg (obj, path, path2) {
	number = Math.floor(Math.random()*3)+1;
	if(path2) {
		document.getElementById("wrap").style.background="url("+ path2 +"/images/bg_" + obj + number + ".jpg) no-repeat center 190px";
	} else {
		document.getElementById("wrap").style.background="url(../images/bg_" + obj + number + ".jpg) no-repeat center 190px";
	}
	document.getElementById("wrap").style.background="url("+ path2 +"/images/bg_" + obj + number + ".jpg) no-repeat center 190px";
	if(path) {
		document.getElementById("third_path").innerHTML = "> " + path;
	}	
}

// 우클릭 금지 IE용

document.oncontextmenu = function() {alert("우클릭 사용을 제한합니다"); return false;};
document.onselectstart = function() {alert("우클릭 사용을 제한합니다"); return false;};
document.ondragstart = function() {alert("우클릭 사용을 제한합니다"); return false;};

// 우클릭 금지 FF용
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){

     if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)

          return false

}

function reEnable(){
     return true
}

if (typeof document.onselectstart!="undefined")
     document.onselectstart=new Function ("return false")
else{
     document.onmousedown=disableselect
     document.onmouseup=reEnable
}

// 드래그 해제
function unlock() {
     document.oncontextmenu = null;
     document.onselectstart = null;
     document.ondragstart = null;
}

// 드래그 설정
function lock() {
     document.oncontextmenu = function() {return false;};
     document.onselectstart = function() {return false;};
     document.ondragstart = function() {return false;};
}

