//이미지 프리로드
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


//롤오버이미지
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//이미지점선제거
function autoBlur(){ 
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
  document.body.focus(); 
} 
  document.onfocusin=autoBlur; 


//이미지 리사이즈 팝업
function view(what) { 
var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menu=no,width=10,height=10'); 
imgwin.focus(); 
imgwin.document.open(); 

imgwin.document.write("<html>\n"); 
imgwin.document.write("<head>\n"); 
imgwin.document.write("<title> khenshin </title>\n"); //오픈창 타이틀 이름 지정하는 부분
imgwin.document.write("<sc"+"ript>\n"); 
imgwin.document.write("function resize() {\n"); 
imgwin.document.write("pic = document.il;\n"); 
//imgwin.document.write("alert(eval(pic).height);\n"); 
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 36; myWidth = eval(pic).width + 10;\n"); 
imgwin.document.write(" } else { myHeight = eval(pic).height + 36; myWidth = eval(pic).width + 10; }\n"); 
imgwin.document.write(" clearTimeout();\n"); 
imgwin.document.write(" var height = screen.height;\n"); 
imgwin.document.write(" var width = screen.width;\n"); 
imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n"); 
imgwin.document.write(" var toppos = height / 2 - myHeight / 2; \n"); 
imgwin.document.write(" self.moveTo(leftpos, toppos);\n"); 
imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n"); 
imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
imgwin.document.write("</sc"+"ript>\n");
imgwin.document.write("</head>\n"); 

imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n');
imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();'>\n"); 
imgwin.document.write("</body>\n");

imgwin.document.write("</html>\n"); 
imgwin.document.close(); 
}


//점프메뉴링크

function select_pops(url){
if(url !==""){
document.location.href=url;
}
}

function select_pop(url){
if(url !==""){
window.open(url,'','');
}
}


//페이지주소

home="../index.html";
sitemap="";
mail="mailto:webmaster@dr-med.co.kr";


med="../01_med/index.php"; //닥터매드소개
med1="../01_med/01_brand.php";
med2="../01_med/02_ci.php";
med3="../01_med/03_company.php";
med4="../01_med/04_history.php";
med5="../01_med/05_catalog.php";
med6="../01_med/06_recruit.php";
med7="../01_med/07_global.php";
med8="../01_med/08_map.php";


research="../02_research/index.php"; //연구개발
research1="../02_research/01_info.php";
research1_1="../02_research/01_info.php";
research1_2="../02_research/02_info.php";
research1_3="../02_research/03_info.php";
research2="../02_research/02_institute.php";
research3="../02_research/03_license.php";


product="../03_product/index.php"; //상품
product1="";
product2="";
product3="";
product4="";
product5="";
product6="";
product7="";
product8="";
product9="";
product10="";
product11="";



customer1="../04_customer/01_customer.php"; //고객센터
customer2="../04_customer/02_qa.php";
customer3="../04_customer/03_buyinfo.php";
customer4="../04_customer/04_inquiry.php";


cmm1="../05_cmm/01_news.php"; //커뮤니티
cmm2="../05_cmm/02_faq.php";
cmm3="../05_cmm/03_medinfo.php";




//photo="JavaScript:open_app1();"
//vr="JavaScript:open_app2();"
//mv="JavaScript:open_app3();"
//map="JavaScript:open_app4();"
//guidemap="JavaScript:open_app5();"


// 가입 창열기
function open_app1() {
	window.open('/etc/photo.asp', 'app1', 'left=10,top=10,width=600,height=500,scrollbars=no');
}

function open_app2() {
	window.open('/etc/vr.asp', 'app2', 'left=20,top=20,width=600,height=500,scrollbars=no');
}

function open_app3() {
	window.open('/etc/mv.asp', 'app3', 'left=30,top=30,width=600,height=500,scrollbars=no');
}

function open_app4() {
	window.open('/etc/map.asp', 'app4', 'left=40,top=40,width=600,height=500,scrollbars=no');
}
function open_app5() {
	window.open('http://hygn.go.kr/culture/guide/guide_map.asp', 'app5', 'left=50,top=50,width=750,height=597,scrollbars=no');
}


//========================== Wish List 에 추가하는 함수 ==================================
function wishlist(g_uid){
    document.add.location.replace("/mypage/wishlist_add.aspl?g_uid="+g_uid);
}

//스크립트로 링크걸기
function GoMenu1(name) {    
tmp=window.location; //호출된 현재창의 주소 ex) http://kr.yahoo.com/1.aspl?a=1&b=1;
tmp=String(tmp).split('?'); //? 이후가 배열에 담김
document.location.href = eval(name) +"?"+tmp[1];
}
//스크립트로 링크걸기
function GoMenu(name) {    
//tmp=window.location; //호출된 현재창의 주소 ex) http://kr.yahoo.com/1.aspl?a=1&b=1;
//tmp=String(tmp).split('?'); //? 이후가 배열에 담김
document.location.href = eval(name);
}

//새창사이즈조절해서 띄우기
function open_popup(url,name,width,height,left,top,scrollbars,resizable) {
window.open(url,name,'width='+width+',height='+height+',left='+left+',top='+top+',scrollbars='+scrollbars+',resizable='+resizable+'');
}

//?????
function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
/*

self.onError=null;
currentX = currentY = 0; 
whichIt = null; 
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
<!-- STALKER CODE -->
function heartBeat() {
if(IE) { 
diffY = document.body.scrollTop; 
diffX = 0; 
}
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelTop += percent;
if(NS) document.floater.top += percent; 
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) document.all.floater.style.pixelLeft += percent;
if(NS) document.floater.top += percent;
lastScrollY = lastScrollY + percent;
} 
} 
if(NS || IE) action = window.setInterval("heartBeat()",1);

 */
//플래시 인클루드
function getflash(URL,wid,hei,mode) 
{
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>");
document.write("<param name='movie' value='"+URL+"'>");
document.write("<param name='quality' value='high'>");
document.write("<param name='WMODE' value='"+mode+"'>");
document.write("<embed src='"+URL+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed>");
document.write("</object>");
}

//스크롤바 위치
var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

function CheckUIElements(){
var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

if ( bNetscape4plus ) {
	yMenuFrom = document["divMenu"].top;
	//yMenuTo = top.pageYOffset + 62;
	yMenuTo = top.pageYOffset + 155;
}
else if ( bExplorer4plus ) {
	yMenuFrom = parseInt (divMenu.style.top, 10);
	//yMenuTo = document.body.scrollTop + 59;
	yMenuTo = document.body.scrollTop + 155;
}

timeoutNextCheck = 500;

if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
	setTimeout ("CheckUIElements()", timeoutNextCheck);
	return;
}

if ( yButtonFrom != yButtonTo ) {
	yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
	if ( yButtonTo < yButtonFrom )
		yOffset = -yOffset;
	
	if ( bNetscape4plus )
		document["divLinkButton"].top += yOffset;
	else if ( bExplorer4plus )
		divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
	
	timeoutNextCheck = 10;
}
if ( yMenuFrom != yMenuTo ) {
	yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
	if ( yMenuTo < yMenuFrom )
		yOffset = -yOffset;
	
	if ( bNetscape4plus )
		document["divMenu"].top += yOffset;
	else if ( bExplorer4plus )
		divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
	
	timeoutNextCheck = 10;
}

setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad()
{

var divHTML='';
divHTML+='<div id="divMenu" style="position:absolute;top:155px;left:50%;z-index:0">';
divHTML+='<div style="position:relative;top:0;left:450px">';
divHTML+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="51" height="303">';
divHTML+='<param name="movie" value="/flash/quickmenu.swf">';
divHTML+='<param name="quality" value="high">';
divHTML+='<param name="loop" value="false">';
divHTML+='<param name="menu" value="false">';
divHTML+='<param name="wmode" value="transparent">';
divHTML+='<embed src="/flash/quickmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="51" height="303"></embed>';
divHTML+='</object>';
divHTML+='</div>';
divHTML+='</div>';


document.body.insertAdjacentHTML("beforeEnd",divHTML);

var y;
if ( top.frames.length )
if ( bNetscape4plus ) {
	document["divMenu"].top = top.pageYOffset + 135;
	document["divMenu"].visibility = "visible";
}
else if ( bExplorer4plus ) {
	divMenu.style.top = document.body.scrollTop + 135;
	divMenu.style.visibility = "visible";
}
CheckUIElements();
return true;
}
attachEvent("onload",OnLoad);