//####################################################################################
// r°øÅë
//####################################################################################
//blur
function autoblur() {
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
	document.body.focus(); 
}
document.onfocusin = autoblur;

// bye
var exit=true;
function bye() {
	if (exit) {
		window.open('/login/logout_bye.php','bye','width=279,height=180,scrollbar=0,resizeable=0');
	}
}

//####################################################################################

//ÁÖ¼Òº¹»ç(Æ®¸®¹é)
function copyUrl(str) {
    if (window.clipboardData)  {
       window.clipboardData.setData("Text", str);
	   ans = confirm(str+"\nº¹»ç µÇ¾ú½À´Ï´Ù. ¿øÇÏ´Â°÷¿¡ ºÙ¿©³Ö±â(Ctrl+V) ÇÏ½Ê½Ã¿À");
   }
}
//textareaº¹»ç(Æ®¸®¹é)
function copyHtml(obj) {
	obj.select();
	window.clipboardData.setData('Text', obj.value);
	alert('º¹»çµÇ¾ú½À´Ï´Ù. ÇÊ¿äÇÑ°÷¿¡ ºÙ¿©³Ö±â(Ctrl+V) ÇÏ½Ã±â¹Ù¶ø´Ï´Ù.');
}
//####################################################################################


//Áñ°ÜÃ£±â
function addbookmark() {
	var bookmarkurl="http://www.replshow.com/"
	var bookmarktitle="¸®ÇÃ¼î-¼¼»óÀÇ ¸ðµç °ÍÀ» Ç°ÆòÇÏ°í Ã¼ÇèÇÑ´Ù"
	if (document.all) {
		window.external.AddFavorite(bookmarkurl,bookmarktitle);
	}
}

//½ÃÀÛÆäÀÌÁö
function starthome(url) {
	var starthomeurl="http://www.replshow.com/"
	if(document.all) {
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(starthomeurl);
	}
}

//onload Áßº¹»ç¿ë
function onLoadAdd(addOnload) { //ÇÔ¼ö ¼±¾ð
	//ex) onLoadAdd('½ÇÇàÇÏ°íÀÚ ÇÏ´Â ÇÔ¼ö') => ¿¹) onLoadAdd(onLoadfunc());
	var oldOnload = window.onload; //ÀÌÀü ÇÔ¼ö°ª ÀúÀå
	if(typeof window.onload != 'function') { //À©µµ¿ì°¡ ·ÎµåµÇ¾úÀ»¶§ ÇÔ¼ö È£Ãâ ¿©ºÎ ÆÇ´Ü
		window.onload = addOnload; // È£ÃâµÈ ÇÔ¼ö°¡ ¾øÀ» °æ¿ì ±×³É ÇÔ¼ö ½ÇÇà
	} else {
		window.onload = function() { //È£ÃâµÈ ÇÔ¼ö°¡ ÀÖÀ» °æ¿ì¿¡ ÀÌÀü ÇÔ¼ö µÚ¿¡ ÇÔ¼ö Ãß°¡
			oldOnload();
			addOnload;
		}
	}
}

//focus event
function onFocusText(onName,ontype,onText) {
	// onFocus="onFocusText(this,1,'');"
	// onblur="onFocusText(this,2,'Ã¼Çè ±â´ëÆòÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À.');"
	if(ontype == 1) if (onName.defaultValue==onName.value) onName.value = "";
	if(ontype == 2) onName.value = onText;
}
