//·¹ÀÌ¾î °ü·Ã
var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

var isNS = navigator.appName == 'Netscape';

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getDivOb(divName) {
	if (isNS4) {
		return document[divName];
	} else if (isDOM) {
		return getRef(divName);
	}
}

//ÆäÀÌÁö ÀÌµ¿
function movepage(url){
	showCenterAjaxBox();
	location.href = url;
}

//Æû submit
function movePageForm(form) {
	if (!validate(form)) return false;
	showCenterAjaxBox();
	return true;
}

//ÀÎ±â ¾àÀç °Ë»öÇÏ±â
function favoriteList(query) {
	var url = "/searchmed/searchmed.do?tcode=searchmed"
		+ "&isFirstSearchS=1"
		+ "&query=" + encodeURIComponent(query);
	
	movepage(url);
}

//·Î±×ÀÎÇÏ±â
function moveLoginForm(url) {
	showCenterAjaxBox();
	returnUrlForm.action = url;
	returnUrlForm.submit();
}

//·Îµù Ç¥½Ã
function showCenterAjaxBox(ment){

	if (ment == null) ment = "ÆäÀÌÁö ÀÌµ¿ ÁßÀÔ´Ï´Ù.   Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä";
	
	var yp = document.body.scrollTop;
	var xp = document.body.scrollLeft;
	var ws = document.body.clientWidth;
	var hs = document.body.clientHeight;

	ajaxBox.style.top = eval(hs) / 2;
	ajaxBox.style.left = (eval(ws) - 200) / 2;

	document.getElementById("ajaxBoxMent").style.size = "1px";
	document.getElementById("ajaxBoxMent").innerHTML = ment;
	document.getElementById("ajaxBox").style.display = "block";
}

//ÇÃ·¡½¬ Ç¥½Ã
function flashobject(file,width,height,bgcolor,name) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+name+'">');
	document.write('<param name="movie" value="'+file+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="'+bgcolor+'" />');	
	document.write('<embed src="'+file+'" quality="high" wmode="transparent" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'	);
	document.write('</object>');
}

//µ¿¿µ»ó Ç¥½Ã
function wmobject(file,width,height,autostart,volume) {
	document.write('<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="HTTP://ACTIVEX.MICROSOFT.COM/ACTIVEX/CONTROLS/MPLAYER/EN/NSMP2INF.CAB#VERSION=6,4,7,1112" width="'+width+'" height="'+height+'"> type="application/x-oleobject"'); 
	document.write('<param name="URL" value="'+file+'"/>');
	document.write('<param name="AUTOSTART" value="'+autostart+'"/>');
	document.write('<param name="Volume" value="'+volume+'"/>');
	document.write('<param name="uiMode" value="full"/>');
	document.write('</object>');
}

//¸ÞÀÎ ¿ÞÂÊ ±â»ç ÀÐ±â ±ÇÇÑ Ã¼Å©
function readBoard(idlevel,idstatus,state){
	if(state=='B'){//Àü¹®±Û
		if(idlevel==''){
			alert("ÀÐ±â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.");
			return false;
		}
		if (idstatus == "2") {//µî±Þ°ú »ó°ü¾øÀÌ Àü¹®±â»ç ¿­¶÷ °¡´É »óÅÂ ¿©ºÎ¿¡ µû¶ó °áÁ¤
			alert("ÀÐ±â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.");
			return false;
		}
		return true;
	}else{
		return true;
	}
}

