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 printPage(arg) {
	var win_location='';
	var win_name = '';
	if (arg == "kor_company_map")
	{
		win_location='/kor/company/cmp_address_print.asp';
		win_name = 'korCompanyMap';
	} else {
		win_location='/eng/company/cmp_address_print.asp';
		win_name = 'engCompanyMap';

	}
	var win_property = 'width=680,height=600,resizable=no,scrollbars=yes';
	var selfWindow = window.open(win_location, win_name, win_property);
}

function contactus(mode) {
	if (mode == "kor")
	{
	var win_location='/kor/common/contactus.asp';
	var win_name = 'korContactUs';
	var win_property = 'width=600,height=480,resizable=no,scrollbars=no';
	var selfWindow = window.open(win_location, win_name, win_property);
	} else {
	var win_location='/eng/common/contactus.asp';
	var win_name = 'engContactUs';
	var win_property = 'width=600,height=480,resizable=no,scrollbars=no';
	var selfWindow = window.open(win_location, win_name, win_property);
	}
}


function pageTitle(arg) {
	document.write("<table cellpadding=0 cellspacing=0 width=100% style='border:gray 1 solid;'>");
	document.write("<tr height=25>");
	document.write("	<td width=1 bgcolor=#000000></td>");
	document.write("	<td width=2 bgcolor=#808080></td>");
	document.write("	<td width=3 bgcolor=#A9A9A9></td>");
	document.write("	<td width=4 bgcolor=#D3D3D3></td>");
	document.write("	<td width=5 bgcolor=#FFFFFF></td>");
	document.write("	<td class=title> "+arg +"</td>");
	document.write("</tr>");
	document.write("</table><table><tr height=3><td colspan=6></td></tr></table>");
}




function emailValue(email){ 
	var t = escape(email.value);

	if(t.match(/^(\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)@(\w+)[.](\w+)[.](\w+)$/ig) == null){ 
		alert("ÀÌ¸ÞÀÏÀ» È®ÀÎÇÏ¿© ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù."); 
		return false;
	}else{ 
		return true;
	}
}
function emailValueENG(email){ 
	var t = escape(email.value);

	if(t.match(/^(\w+)@(\w+)[.](\w+)$/ig) == null && t.match(/^(\w+)@(\w+)[.](\w+)[.](\w+)$/ig) == null){ 
		alert("Please, input youre E-Mail."); 
		return false;
	}else{ 
		return true;
	}
}


function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

// ¼ýÀÚ¸¸ ±âÀÔ¹Þ´Â ½ºÅ©¸³Æ® ½ÃÀÛ
function CheckNum(field) {
var valid = "0123456789"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("ÀÌ Ç×¸ñÀº ¼ýÀÚ¸¸ ±âÀÔÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
field.focus();
field.select();
return false;
   }
}
// ¼ýÀÚ¸¸ ±âÀÔ¹Þ´Â ½ºÅ©¸³Æ® ³¡

// ¼ýÀÚ¸¸ ±âÀÔ¹Þ´Â ½ºÅ©¸³Æ® ½ÃÀÛ
function CheckNumENG(field) {
var valid = "0123456789"
var ok = "yes";
var temp;
for (var i=0; i<field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (valid.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("Input number only");
field.focus();
field.select();
return false;
   }
}
// ¼ýÀÚ¸¸ ±âÀÔ¹Þ´Â ½ºÅ©¸³Æ® ³¡



function setEmbed() 
{ 
  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 pluginspace = new String; 
  var embedType = new String; 
  var src = new String; 
  var width = new String; 
  var height = new String; 



    
  this.init = function( getType , s ,w , h ) { 
      
      if ( getType == "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 ( getType == "movie") {
        clsid = "22D6F312-B0F6-11D0-94AB-0080C74C7E95";        
		codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" 
        pluginspage = "";
        embedType = "application/x-oleobject";
	  }
      /* type Ãß°¡ 
      else if ( ) 
      { 
      } 
      */ 



      parameter += "<param name='movie' value='"+ s + "'>\n";  
      parameter += "<param name='quality' value='high'>\n";    

      src = s; 
      width = w; 
      height = h; 
  } 
  
  this.parameter = function( parm , value ) {      
      parameter += "<param name='"+parm +"' value='"+ value + "'>\n";        
      allParameter += " "+parm + "='"+ value+"'"; 
  }  


  this.show = function() { 
      if ( clsid ) 
      { 
        obj = "<object 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 );  

  } 

  
}
