//ÇÃ·¡½Ã
function flash(path, width, height, name){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+width+'" height="'+height+'" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+name+'">'
	+'<param name="movie" value="'+path+'">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="transparent">'
	+'<param name="allowScriptAccess" value="always">'
	+'<embed src="'+path+'" quality="high" wmode="transparent" pluginspage="https://www.macromedia.com/go/getflashplayer" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" showLiveConnect="true" name="'+name+'" allowScriptAccess="always"></embed>'
	+'</object>');
}

function document_write(value){
	document.write(value);
}

//ÇÃ·¡½Ã ¸µÅ©
function goPage(no){
	var url;

	//ÀÏ¹Ý¸µÅ©
	var www_site		= "http://www.gabia.com";
	var domain_site		= "http://domain.gabia.com";
	var hosting_site	= "http://hosting.gabia.com";
	var image_site		= "http://image.gabia.com";
	var customer_site	= "http://customer.gabia.com";	

	switch(Number(no)) {

	//¸Þ´º1 ¼­¹ö/IDC
	case 30 : url=""+hosting_site+"/server/"; break;
	case 31 : url=""+hosting_site+"/server/server/"; break;
	case 32 : url=""+hosting_site+"/server/colo/"; break;
	case 33 : url=""+hosting_site+"/server/trust/"; break;
	case 34 : url=""+hosting_site+"/server/security/"; break;
	case 35 : url=""+hosting_site+"/server/service/"; break;
	case 36 : url=""+hosting_site+"/server/itout/"; break;
	case 37 : url=""+hosting_site+"/server/hw/"; break;
	case 38 : url=""+hosting_site+"/server/sw/"; break;	

	//¸Þ´º2 ¸ÞÀÏ/À¥ÇÏµå
	case 40 : url=""+hosting_site+"/webmail/"; break;
	case 41 : url=""+hosting_site+"/webmail/what_webmail02.php"; break;
	case 42 : url=""+hosting_site+"/webmail/what_webmail01.php"; break;
	case 43 : url=""+hosting_site+"/webmail/what_webmail03.php"; break;
	case 44 : url=""+hosting_site+"/webmail/webhard_index.php"; break;
	case 45 : url=""+hosting_site+"/webmail/sms_guide.php"; break;
	case 46 : url="javascript:bill()"; break;
	case 47 : url=""+hosting_site+"/webmail/messenger_guide.php"; break;

	//¸Þ´º3 ¼îÇÎ¸ôÃ¢¾÷
	case 50 : url=""+hosting_site+"/ec_hosting/"; break;	
	case 51 : url=""+hosting_site+"/ec_hosting/information/"; break;
	case 52 : url=""+hosting_site+"/ec_hosting/shoppingmall/firstmall_R.php"; break;
	case 53 : url=""+hosting_site+"/ec_hosting/shoppingmall/firstmall_S.php"; break;
	case 54 : url=""+hosting_site+"/ec_hosting/shoppingmall/firstmall_Pro.php"; break;
	case 55 : url=""+hosting_site+"/ec_hosting/shoppingmall/onestop.php"; break;
	case 56 : url=""+hosting_site+"/ec_hosting/marketing/"; break;
	case 57 : url=""+hosting_site+"/ec_hosting/addservice/"; break;
	case 58 : url="javascript:designshop()"; break;
	case 59 : url=""+hosting_site+"/ec_hosting/education/"; break;
	case 591 : url=""+hosting_site+"/ec_hosting/reseller/"; break;
	case 592 : url=""+hosting_site+"/ec_hosting/customer/"; break;

	//¸Þ´º4 µµ¸ÞÀÎ
	case 10 : url=""+domain_site+""; break;
	case 11 : url=""+domain_site+"/regist/"; break;
	case 12 : url=""+domain_site+"/extend/"; break;
	case 13 : url=""+domain_site+"/transfer/"; break;
	case 14 : url=""+domain_site+"/change/"; break;
	case 15 : url=""+domain_site+"/service/"; break;
	case 16 : url=""+domain_site+"/reserve/"; break;	
	case 17 : url=""+domain_site+"/sell/"; break;	
	case 18 : url=""+domain_site+"/keyword/"; break;
	case 19 : url=""+domain_site+"/winc/"; break;
	case 191 : url=""+domain_site+"/oneclick/"; break;

	//¸Þ´º5 È£½ºÆÃ
	case 20 : url=""+hosting_site+""; break;
	case 21 : url=""+hosting_site+"/webhosting/"; break;
	case 22 : url=""+hosting_site+"/flvhosting/"; break;
	case 23 : url=""+hosting_site+"/imagehosting/"; break;
	case 24 : url=""+hosting_site+"/elearning/"; break;
	case 25 : url=""+hosting_site+"/dbhosting"; break;
	case 26 : url=""+hosting_site+"/add_service/support/sms/"; break;
	case 27 : url=""+hosting_site+"/ssl/"; break;
	case 28 : url=""+hosting_site+"/designshop/"; break;

	//¸Þ´º6 ¸ð¹ÙÀÏ
	case 80 : url=""+hosting_site+"/mobile/"; break;
	case 81 : url=""+hosting_site+"/mobile/qr/"; break;
	case 82 : url=""+hosting_site+"/mobile/reg/"; break;
	case 83 : url=""+hosting_site+"/mobile/showcase/"; break;
	case 84 : url=""+hosting_site+"/mobile/use/"; break;
	case 85 : url=""+hosting_site+"/mobile/useful/"; break;
	case 86 : url=""+hosting_site+"/mobile/add/"; break;
	case 87 : url=""+hosting_site+"/mobile/cs"; break;
	case 88 : url=""+hosting_site+"/designshop/cate_list.php?category=3"; break;

	//¸Þ´º7 È¨ÆäÀÌÁöÁ¦ÀÛ
	case 60 : url=""+image_site+""; break;
	case 61 : url=""+image_site+"/company/"; break;
	case 62 : url=""+image_site+"/portfolio/"; break;
	case 63 : url=""+image_site+"/estimate/"; break;
	case 64 : url=""+image_site+"/solution/"; break;
	case 65 : url=""+image_site+"/mobile/"; break;
	case 66 : url=""+image_site+"/weakpt/"; break;

	//¸Þ´º8 My°¡ºñ¾Æ
	case 70 : url=""+www_site+"/mygabia/"; break;
	case 71 : url=""+domain_site+"/mydomain/"; break;
	case 72 : url=""+hosting_site+"/myhg/mylist/"; break;
	case 73 : url=""+hosting_site+"/myhg/myserver/"; break;
	case 74 : url=""+www_site+"/payment/pay_step1.php"; break;
	case 75 : url=""+domain_site+"/deposit/deposit_index.php"; break;
	case 76 : url=""+www_site+"/mygabia/cs/1to1.php"; break;
	case 77 : url="https://www.gabia.com/member/member_account_modify.php?origin_site=http://www.gabia.com"; break;

	//¸Þ´º9 µðÀÚÀÎ¼¥
	case 90 : url=""+hosting_site+"/designshop/"; break;
	}

	if (url != ""){
		top.location.href=url;
	} else {
		alert('ÁØºñÁßÀÔ´Ï´Ù');
	}
}

//µå¸²À§¹ö ±âº» ½ºÅ©¸³Æ®
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_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_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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_showHideLayers() { //v6.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; }
}

//pngÀÌ¹ÌÁö Åõ¸íÈ¿°ú
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}

//select Box ½ºÅ¸ÀÏ
var nowOpenedSelectBox = "";
var mousePosition = "";

function selectThisValue(thisId,thisIndex,thisValue,thisString) {
	var objId = thisId;
	var nowIndex = thisIndex;
	var valueString = thisString;
	var sourceObj = document.getElementById(objId);
	var nowSelectedValue = document.getElementById(objId+"SelectBoxOptionValue"+nowIndex).value;
	hideOptionLayer(objId);
	if (sourceObj) sourceObj.value = nowSelectedValue;
	settingValue(objId,valueString);
	selectBoxFocus(objId);
	if (sourceObj.onchange) sourceObj.onchange();
}

function settingValue(thisId,thisString) {
	var objId = thisId;
	var valueString = thisString;
	var selectedArea = document.getElementById(objId+"selectBoxSelectedValue");
	if (selectedArea) selectedArea.innerText = valueString;
}

function viewOptionLayer(thisId) {
	var objId = thisId;
	var optionLayer = document.getElementById(objId+"selectBoxOptionLayer");
	if (optionLayer) optionLayer.style.display = "";
	nowOpenedSelectBox = objId;
	setMousePosition("inBox");
}

function hideOptionLayer(thisId) {
	var objId = thisId;
	var optionLayer = document.getElementById(objId+"selectBoxOptionLayer");
	if (optionLayer) optionLayer.style.display = "none";
}

function setMousePosition(thisValue) {
	var positionValue = thisValue;
	mousePosition = positionValue;
}

function clickMouse() {
	if (mousePosition == "out") hideOptionLayer(nowOpenedSelectBox);
}

function selectBoxFocus(thisId) {
	var objId = thisId;
	var obj = document.getElementById(objId + "selectBoxSelectedValue");
	obj.className = "selectBoxSelectedAreaFocus";

	obj.focus();
}

function selectBoxBlur(thisId) {
	var objId = thisId;
	var obj = document.getElementById(objId + "selectBoxSelectedValue");
	obj.className = "selectBoxSelectedArea";
}

function select_box(thisId) {
	var downArrowSrc = "/images/inc/ico_select.gif";	//¿À¸¥ÂÊ È­»ìÇ¥ÀÌ¹ÌÁö
	var downArrowSrcWidth = 16;	//¿À¸¥ÂÊ È­»ìÇ¥ÀÌ¹ÌÁö width
	var optionHeight = 18; // option ÇÏ³ªÀÇ ³ôÀÌ
	var optionMaxNum = 15; // ÇÑ¹ø¿¡ º¸¿©Áö´Â optionÀÇ °¹¼ö
	var optionInnerLayerHeight = "";
	var objId = thisId;
	var obj = document.getElementById(objId);
	var selectBoxWidth = parseInt(obj.style.width);
	var selectBoxHeight = parseInt(obj.style.height);
	if (obj.options.length > optionMaxNum) optionInnerLayerHeight = "height:"+ (optionHeight * optionMaxNum) + "px";
	newSelect  = "<table id='" + objId + "selectBoxOptionLayer' cellpadding='0' cellspacing='0' border='0' style='position:absolute;z-index:100;display:none;' onMouseOver=\"viewOptionLayer('"+ objId + "')\" onMouseOut=\"setMousePosition('out')\">";
	newSelect += "	<tr>";
	newSelect += "		<td height='" + selectBoxHeight + "' style='cursor:hand;' onClick=\"hideOptionLayer('"+ objId + "')\"></td>";
	newSelect += "	</tr>";
	newSelect += "	<tr>";
	newSelect += "		<td height='1'></td>";
	newSelect += "	</tr>";
	newSelect += "	<tr>";
	newSelect += "		<td bgcolor='#FFFFFF'>";
	newSelect += "		<div class='selectBoxOptionInnerLayer' style='width:" + (selectBoxWidth-2) + "px;" + optionInnerLayerHeight + "'>";
	newSelect += "		<table cellpadding='0' cellspacing='0' border='0' width='100%' style='table-layout:fixed;word-break:break-all;'>";
	for (var i=0 ; i < obj.options.length ; i++) {
		var nowValue = obj.options[i].value;
		var nowText = obj.options[i].text;
		newSelect += "			<tr>";
		newSelect += "				<td height='" + optionHeight + "' class='selectBoxOption' onMouseOver=\"this.className='selectBoxOptionOver'\" onMouseOut=\"this.className='selectBoxOption'\" onClick=\"selectThisValue('"+ objId + "'," + i + ",'" + nowValue + "','" + nowText + "')\" style='cursor:hand;'>" + nowText + "</td>";
		newSelect += "				<input type='hidden' id='"+ objId + "SelectBoxOptionValue" + i + "' value='" + nowValue + "'>";
		newSelect += "			</tr>";
	}
	newSelect += "		</table>";
	newSelect += "		</div>";
	newSelect += "		</td>";
	newSelect += "	</tr>";
	newSelect += "</table>";
	newSelect += "<table cellpadding='0' cellspacing='1' border='0' bgcolor='#D7D7D7' onClick=\"viewOptionLayer('"+ objId + "')\" style='cursor:hand;'>";
	newSelect += "	<tr>";
	newSelect += "		<td>";
	newSelect += "		<table cellpadding='0' cellspacing='0' border='0'>";
	newSelect += "			<tr>";
	newSelect += "				<td><div id='" + objId + "selectBoxSelectedValue' class='selectBoxSelectedArea' style='width:" + (selectBoxWidth - downArrowSrcWidth - 4) + "px;height:" + (selectBoxHeight - 2) + "px;overflow:hidden;' onBlur=\"selectBoxBlur('" + objId + "')\"></div></td>";
	newSelect += "				<td><img src='" + downArrowSrc + "' width='" + downArrowSrcWidth + "' border='0'></td>";
	newSelect += "			</tr>";
	newSelect += "		</table>";
	newSelect += "		</td>";
	newSelect += "	</tr>";
	newSelect += "</table>";
	document.write(newSelect);
	
	var haveSelectedValue = false;
	for (var i=0 ; i < obj.options.length ; i++) {
		if (obj.options[i].selected == true) {
			haveSelectedValue = true;
			settingValue(objId,obj.options[i].text);
		}
	}
	if (!haveSelectedValue) settingValue(objId,obj.options[0].text);
}
document.onmousedown = clickMouse;

//ÀüÀÚ¼¼±Ý°è»ê¼­ ¿¬°á
function bill(){
	if(!confirm("°¡ºñ¾Æ°¡ Á¦°øÇÏ´Â »õ·Î¿î ÀüÀÚ¼¼±Ý°è»ê¼­ ÇÏÀÌ¿÷½ººô(hiworks.co.kr)·Î ÀÌµ¿ÇÕ´Ï´Ù.")){
		return
	}
	else{                                           
	//window.location='http://www.hiworks.co.kr/bill';
	window.open('http://www.hiworks.co.kr/bill','_blank');
	}
}

//¼îÇÎ¸ô µðÀÚÀÎ¼¥ ¿¬°á
function designshop(){
	window.open('http://hosting.gabia.com/ec_hosting/designshop/','_blank');
}
