var redirectMap={"www.honeymoonresort.co.kr":"m.honeymoonresort.co.kr"};
if(redirectMap[document.location.hostname]!=undefined)
{
  var ag=navigator.userAgent;
  var lc=document.location;
  
  if((ag.indexOf("iPhone")!=-1||ag.indexOf("Android")!=-1||ag.indexOf("Opera")!=-1)&&lc.search.indexOf("mobile")==-1)
    document.location.href="http://"+redirectMap[document.location.hostname]
}


// ¿ÀÇÂ ÆË¾÷ ½ºÅ©¸³Æ® //
function goPopup(url, name, _width, _height, _scrollbar){
	var screenX;
	var screenY;

	if(navigator.appName == "Microsoft Internet Explorer") {
		screenX = window.screen.availWidth;
		screenY = window.screen.availHeight;
	}
	else {
		screenX = window.outerWidth;
		screenY = window.outerHeight;
	}

	var h, w;
	w = (screenX - _width)/2;
	h = (screenY - _height)/2;

	var newWin = window.open(url, name, 'left=' + w + ' top=' + h + ' width=' +_width + ' height=' + _height + ' scrollbars=' + _scrollbar + 'resize=no,toolbar=no,status=no,menu=no');

	newWin.focus();

	return newWin;
}



// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,vars,win){

// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
var flashStr=
"<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='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
"<param name='allowScriptAccess' value='always' />"+
"<param name='movie' value='"+url+"' />"+
"<param name='FlashVars' value='"+vars+"' />"+
"<param name='wmode' value='"+win+"' />"+
"<param name='menu' value='false' />"+
"<param name='quality' value='high' />"+
"<param name='bgcolor' value='"+bg+"' />"+
"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
"</object>";

document.write(flashStr);
}

/********************************************************************************************************
   Áß¾Ó ¿ÀÇÂÃ¢  (¿ìÆí¹øÈ£Ã£±â,¾ÆÀÌµðÃ£±â,¾ÆÀÌµðÁßº¹, °ÅÁÖÁöÁ¤º¸Ãß°¡)
   <a href="°æ·Î" onclick="openWinCenter(this.href,'newwin','width=320,height=240,status=no,menubar=no,resize=yes');return false">
********************************************************************************************************/
function openWinCenter(url, wname, wopt) {
	var newopt = "", wHeight = 0, wWidth = 0;
	if (wopt != undefined) {
		var woptlist = wopt.replace(/ /g, "").split(",");
		for (var i in woptlist) {
			if (woptlist[i].match(/^height=/i)) {
				wHeight = parseInt(woptlist[i].substr(7),10);
				if (!isNaN(wHeight)) newopt += "top=" + Math.floor((screen.availHeight - wHeight) / 2) + ",";
			}
			if (woptlist[i].match(/^width=/i)) {
				wWidth = parseInt(woptlist[i].substr(6),10);
				if (!isNaN(wWidth)) newopt += "left=" + Math.floor((screen.availWidth - wWidth) / 2) + ",";
			}
		}
	}
	return window.open(url, wname, newopt + wopt);
} 


var layout_image;
// ¹Ì¸®º¸±âÇÒ ÀÌ¹ÌÁö°æ·Î¸í
var myImage;
// Image°´Ã¼ º¯¼ö
var rewidth, reheight;
// ÀÌ¹ÌÁö Å©±â(°è»ê°á°ú)
var xwidth, xheight;
// ±âÁØ »çÀÌÁî(ÀÌ Å©±â¿¡ ¸ÂÃçÁü)



function layout(file)
{
	
	layout_image = file;
	// ÀÌ¹ÌÁö ÆÄÀÏÀÇ °æ·Î¸í
	//xwidth=200;
	//xheight=200;
	// ÀÌ »çÀÌÁî¿¡ ¸ÂÃçÁ®¼­ ÀÌ¹ÌÁöÀÇ Å©±â°¡ Á¶ÀýµÊ

	myImage = new Image();
	myImage.src = file;
	// Image°´Ã¼¸¦ »ý¼ºÇÏ°í °æ·Î¸íÀ» ´ëÀÔ

	delay();
	// ÀÌ¹ÌÁö¸¦ ·ÎµùÇÏ´Â ÇÔ¼ö
}

function delay()
{
	if ((myImage == null) || (myImage.complete != true))
	{
	// myImage°¡ ·ÎµùÀÌ ´ÙµÆ´ÂÁö È®ÀÎ
			window.setTimeout("delay()", 100);
			// ·ÎµùÀÌ ´Ù ¾ÈµÆ´Ù¸é
			// 1/20ÃÊ °£°ÝÀ¸·Î ÀÌ¹ÌÁö¸¦ Àç·Îµù
			// ¹Ýº¹·çÇÁ·Î ½Ã°£À» Áö¿¬½ÃÄÑµµ µÇÁö¸¸
			// Àç±ÍÀû È£Ãâ¿¡ ÀÇÇÑ Àç·ÎµùÀ¸·Î ·Îµù¿Ï·á¸¦ È®ÀÎÇÑ´Ù
	}
	else
	{
		calculaterate();
		
		
		display();
		
	
	}
}

function calculaterate()
{
	var width, height;// Image°´Ã¼¿¡¼­ ÀÌ¹ÌÁöÀÇ Å©±â¸¦ ¾Ï
	var rwidth, rheight;// ¿ø·¡ »çÀÌÁî¿Í ±âÁØ »çÀÌÁîÀÇ Â÷
	var vswidth, vsheight, vs;// ÀÌ¹ÌÁöÀÇ Å©±â¸¦ ÁÙÀÌ´Â ºñÀ²

	width=myImage.width;
	height=myImage.height;
	// myImage°´Ã¼¿¡¼­ ÀÌ¹ÌÁöÀÇ ¿ø·¡ Å©±â¸¦ °¡Á®¿Â´Ù

	rwidth=width - xwidth;
	rheight=height - xheight;
	// º¸¿©ÁÖ·Á´Â ±âÁØÀÌ µÇ´Â Å©±â¿Í ¿ø·¡ Å©±âÀÇ Â÷¸¦ ±¸ÇÔ

	if (rwidth > 0 || rheight > 0)
	// ÀÌ¹ÌÁö°¡ º¸¿©ÁÖ·Á´Â Å©±âº¸´Ù Å©´Ù¸é
		{
			vswidth=xwidth/width;
			vsheight=xheight/height;
			// ÀÌ¹ÌÁö°¡ ¾ó¸¶³ª Å«Áö ºñÀ²À» ±¸ÇÔ

			if (vswidth < vsheight)
				vs = vswidth;
			else
				vs = vsheight;
			// ºñÀ²ÀÌ ÀûÀº ÂÊÀ» ¼±ÅÃÇÔ

			rewidth=Math.floor(width*vs);
			reheight=Math.floor(height*vs);
			// Å©±â¸¦ °è»ê
		}
	else
		{
			rewidth=width;
			reheight=height;
			// ÀÌ¹ÌÁö Å©±â°¡ ±âÁØÀÌ µÇ´Â Å©±âº¸´Ù ÀÛÀº °æ¿ì¿£ ±×³É »ç¿ëÇÔ
		}
}


function display()
{
	myImage = null;
	// myImage°´Ã¼¿¡ nullÀ» ´ëÀÔÇÔ

	//myform.layout_img2.src = layout_image;
	//myform.layout_img2.width = rewidth;
	//myform.layout_img2.height = reheight;
	// ÀÌ¹ÌÁö °æ·Î¸í°ú °è»ê°á°ú¸¦ ´ëÀÔÇÔ
	
	layout_image = layout_image.replace("&", "ttt");    
	window.open("/Common/inc/view_image.asp?img="+layout_image  , "viewimage", "top=100, left=100, width=0, height=0, status=no, help=no, center=yes,scrollbars=yes");
}

function display_media(url)
{
  window.open("/Common/inc/preview_media.asp?media_url="+url  , "viewmedia", "top=100, left=100, width=323, height=390, status=no, help=no, center=yes,scrollbars=yes");
}

function display2(dis_image)
{
	myImage = null;
	// myImage°´Ã¼¿¡ nullÀ» ´ëÀÔÇÔ

	//myform.layout_img2.src = layout_image;
	//myform.layout_img2.width = rewidth;
	//myform.layout_img2.height = reheight;
	// ÀÌ¹ÌÁö °æ·Î¸í°ú °è»ê°á°ú¸¦ ´ëÀÔÇÔ
	
	window.open("/Common/inc/view_image.asp?img="+dis_image  , "viewimage", "top=100, left=100, width=0, height=0, status=no, help=no, center=yes");
}



var old='';
function menu(name){

        submenu=eval("submenu_prodeval"+name+".style");

    if(old!=submenu)
    {
        if(old!='')
        {
            old.display='none';
        }
        submenu.display='block';
        old=submenu;
    }
    else
    {
        submenu.display='none';
        old='';
    }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function SearchDiv_Show(){
  
   
   document.all.DIV_Search.style.visibility="visible";
	
}
function SearchDiv_Hide(){

    
   document.all.DIV_Search.style.visibility="hidden";
	
}

