// 사용방법 : flash( 경로, 가로사이즈, 세로사이즈, f(f:플래쉬.m:미디어), 배경투명여부(배경투명시 : "transparent", 아니면""), 아이디, 자동시작);
function flash( src, width, height, type, wm, id, autostart )
{ // 예제 : flash( "img/flash.swf", 300, 300, "f" , "transparent"); //플래쉬 사용시 아이디와 자동시작은 의미없음으로 안적어도됨.
	var obj = new String;
	var parameter = new String;
	var embed = new String;
	var html = new String;
	var allParameter = new String;
	var clsid = new String;
	var codebase = new String;
	var pluginspage = new String;
	var embedType = new String;
	var typ = type ? type : "f";



	if(typ=="f")
	{	//flash
		clsid = "D27CDB6E-AE6D-11cf-96B8-444553540000";
		codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
		pluginspage = "http://www.macromedia.com/go/getflashplayer";
		embedType = "application/x-shockwave-flash";
	}
	else if(typ=="m")
	{	//media
		clsid="22D6F312-B0F6-11D0-94AB-0080C74C7E95";
		codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";
		embedType="application/x-oleobject";
		parameter += "<param name='FileName' value='"+ src + "'>\n";
		var auto = autostart ? "1" : "0";
		parameter += "<param name='AutoStart' value='"+auto+"'>\n";
	}
	parameter += "<param name='movie' value='"+ src + "'>\n";
	parameter += "<param name='quality' value='high'>\n";

	if(wm)
	{
		parameter += "<param name='wmode' value='transparent'>\n";
		allParameter += " wmode='transparent' ";
	}
	if ( clsid )
	{
		obj = "<object id='"+id+"' name='"+id+"'  classid=\"clsid:"+ clsid +"\" codebase=\""+ codebase +"\" width='"+ width +"' height='"+ height +"'>\n";
	}
	embed = "<embed src='" + src + "' pluginspage='"+ pluginspage + "' type='"+ embedType + "' width='"+ width + "' height='"+ height +"'"+ allParameter +"></embed>\n";
	if ( obj )
	{
		embed += "</object>\n";
	}
	html = obj + parameter + embed;
	document.write( html );
}

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.0
	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 && document.getElementById) x=document.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];}
}

// 각 서브페이지 좌측 메뉴 롤오버 상태를 고정시키는 함수
var basic_img = "";
function lock_menu(Menu, cate)
{
	if (Menu)
	{
		var target_menu = document.getElementById(Menu);
		target_menu.src = (cate) ? "/" + cate + "/images/" + Menu + "_ov.gif" : "images/"+Menu+"_ov.gif";
		basic_img = Menu;
		
	}
}

// 상단 및 왼쪽 메뉴
function go_url(ss)
{
	//alert(ss); //링크주소 맞는지 확인하는소스(확인시 이줄 처음에 // 모양 주석해제);
	switch(ss)
	{
		//회사소개
		case"01":	location.replace("/company/company_1.php");			break;	
			case"01_1":	location.replace("/company/company_1.php");			break;
			case"01_2":	location.replace("/company/company_2.php");			break;
			case"01_3":	location.replace("/company/company_3.php");			break;
			case"01_4":	location.replace("/company/company_4.php");			break;
			case"01_5":	location.replace("/company/company_5.php");			break;
			case"01_6":	location.replace("/company/company_6.php");			break;
			case"01_7":	location.replace("/company/company_7.php");			break;
		
		//사업영역
		case"02":	location.replace("/business/business_1_1.php?num=1");			break;
			case"02_1":	location.replace("/business/business_1_1.php?num=1");			break;
			case"02_2":	location.replace("/business/business_2_1.php?num=2");			break;
			case"02_3":	location.replace("/business/business_3_1.php?num=3");			break;
			case"02_4":	location.replace("/business/business_4_1.php?num=4");			break;

		//홍보/IR
		case"03":	location.replace("/ir/ir_1_1.php");			break;
			case"03_1":	location.replace("/ir/ir_1_1.php");			break;
			case"03_2":	location.replace("/ir/ir_1_2.php");			break;
			case"03_3":	location.replace("/ir/ir_2_1.php");			break;
			case"03_4":	location.replace("/bbs/bbs/board.php?bo_table=ir_04");			break;

		//채용정보
		case"04":	location.replace("/recruit/recruit_1.php");			break;
			case"04_1":	location.replace("/recruit/recruit_1.php");			break;
			case"04_2":	location.replace("/recruit/recruit_2.php");			break;
			case"04_3":	location.replace("/recruit/recruit_3.php");			break;
			case"04_4":	location.replace("/bbs/bbs/board.php?bo_table=recruit_04");	break;

		//로고
		case"05":	location.replace("/index.php");			break;

		//Home
		case"06":	location.replace("/index.php");			break;

		//Sitemap
		case"07":	location.replace("/sitemap/sitemap_1.php");			break;

		//contact us
		case"08":	location.replace("/company/company_7.php");			break;



		//메인비주얼
		case"001":	location.replace("/business/business_1_1.php?num=1");			break;
		case"002":	location.replace("/business/business_2_1.php?num=2");			break;
		case"003":	location.replace("/business/business_3_1.php?num=3");			break;
	}
}

//이미지점선막기
function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;
