// JavaScript Document


//flash ie ---
function ShowFlash(url, width, height){
                document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/webzine/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '" VIEWASTEXT>');
        document.write('<param name="movie" value="' + url + '">');
        document.write('<param name="quality" value="high">');
        document.write('<param name="wmode" value="transparent">');
        document.write('<PARAM NAME=menu VALUE=false>');
        document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="incrlication/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
        document.write('</object>');
}


//open window ---
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// rollover --
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_swapImgRernde() { //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];}
}




/***********************************************************************************
**** Select Box Design Script ******************************************************
**** Start *************************************************************************
************************************************************************************/

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 selectThisValueMyMenu(thisId,thisIndex,thisValue,thisString, className) {
	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);
	selectBoxFocusMyMenu(objId, className);
	if (sourceObj.onchange) sourceObj.onchange();
}

function settingValue(thisId,thisString) {
	var objId = thisId;
	var valueString = thisString;
	var selectedArea = document.getElementById(objId+"selectBoxSelectedValue");
	if (selectedArea) selectedArea.innerHTML = valueString.replace("&","&");
}

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 selectBoxFocusMyMenu(thisId, classNameFocus) { //MyMeny
	var objId = thisId;
	var obj = document.getElementById(objId + "selectBoxSelectedValue");
	obj.className = classNameFocus;
	obj.focus();
}

function selectBoxBlurMyMenu(thisId, classNameFocus) {
	var objId = thisId;
	var obj = document.getElementById(objId + "selectBoxSelectedValue");
	obj.className = classNameFocus;
}

function selectBoxBlur(thisId) {
	var objId = thisId;
	var obj = document.getElementById(objId + "selectBoxSelectedValue");
	obj.className = "selectBoxSelectedArea";
}


function makeSelectBoxGlobal(thisId, selectBoxSelectedArea, lineColor, downArrowSrcPath, selectBoxOption, selectBoxSelectedAreaFocus, selectBoxOptionOver) {
	var downArrowSrc = downArrowSrcPath; //rightArrow
	var downArrowSrcWidth = 17;	//rightQrrow Image width
	var optionHeight = 19; // option heigh
	var optionMaxNum = 6; // option Maxnum
	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 - 1) + "' style='cursor:hand;' onClick=\"hideOptionLayer('"+ objId + "')\" onMouseOut=\"hideOptionLayer('"+ objId + "')\"></td>";
	newSelect += "	</tr>";
	newSelect += "	<tr>";
	newSelect += "		<td bgcolor='"+lineColor+"' style='padding:0px 1px 1px 1px'>";
	newSelect += "		<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
	newSelect += "			<tr>";
	newSelect += "				<td height='3' bgcolor='#ffffff'></td>";
	newSelect += "			</tr>";
	newSelect += "		</table>";
	newSelect += "		<div id='"+ objId + "SelectBoxOptionArea' class='selectBoxOptionInnerLayer' style='width:" + (selectBoxWidth-2) + "px;" + optionInnerLayerHeight + "' onMouseOut=\"hideOptionLayer('"+ objId + "')\">";
	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;
		if (nowValue != null && nowValue != "") { // value.
			newSelect += "	<tr>";
			newSelect += "		<td height='" + optionHeight + "' class='"+selectBoxOption+"' onMouseOver=\"this.className='"+selectBoxOptionOver+"'\" onMouseOut=\"this.className='"+selectBoxOption+"'\" onClick=\"selectThisValueMyMenu('"+ objId + "'," + i + ",'" + nowValue + "','" + nowText + "','"+selectBoxSelectedAreaFocus+"')\" style='cursor:hand;'>" + nowText + "</td>";
			newSelect += "		<input type='hidden' id='"+ objId + "SelectBoxOptionValue" + i + "' value='" + nowValue + "'>";
			newSelect += "	</tr>";
		}
	}
	newSelect += "		</table>";
	newSelect += "		</div>";
	newSelect += "		<table cellpadding='0' cellspacing='0' border='0' width='100%'>";
	newSelect += "			<tr>";
	newSelect += "				<td height='4' bgcolor='#ffffff'></td>";
	newSelect += "			</tr>";
	newSelect += "		</table>";
	newSelect += "		</td>";
	newSelect += "	</tr>";
	newSelect += "</table>";
	newSelect += "<table cellpadding='0' cellspacing='1' border='0' bgcolor='"+lineColor+"' onClick=\"viewOptionLayer('"+ objId + "')\" style='cursor:hand;' onMouseOut=\"setMousePosition('out')\">";
	newSelect += "	<tr>";
	newSelect += "		<td bgcolor='#ffffff'>";
	newSelect += "		<table cellpadding='0' cellspacing='0' border='0'>";
	newSelect += "			<tr>";
	newSelect += "				<td><div id='" + objId + "selectBoxSelectedValue' class='"+selectBoxSelectedArea+"' style='width:" + (selectBoxWidth - downArrowSrcWidth - 2) + "px;height:" + (selectBoxHeight - 2) + "px;overflow:hidden;' onBlur=\"selectBoxBlurMyMenu('" + objId + "', '"+selectBoxSelectedAreaFocus+"')\"></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);
}
/***********************************************************************************
**** Select Box Design Script ******************************************************
**** End ***************************************************************************
************************************************************************************/
function goLeftSelectBoxMenu(thisURL,thisTarget) {
	if (thisURL == "" || thisURL == null || thisURL == "separator") return;
	var nowTarget = "_blank";
	if (thisTarget != null && thisTarget != "" ) nowTarget = thisTarget;
	window.open(thisURL, nowTarget, "");
}





//menulink start ~~ ///////////////////////////////////////////////////////////////////////////////////

// toput menu link --- 

     function toput01()
    { self.location.href = '/eng/main.asp'; }
	 function toput02()
    { self.location.href = '/eng/main.asp'; }
     function toput03()
    { self.location.href = '/eng/main.asp'; }
     function toput04()
    { self.location.href = '/eng/main.asp'; }
	
	
// floating menu link --- 	
	
     function quick01()
    { self.location.href = '/eng/pub/comp/comp010101.asp'; }
     function quick02()
    { self.location.href = '/eng/pub/comp/comp010201.asp'; }
     function quick03()
    { self.location.href = '/eng/pub/comp/comp010301.asp'; }
     function quick04()
    { self.location.href = '/eng/pub/comp/comp010401.asp'; }
     function quick05()
    { self.location.href = '/eng/pub/comp/comp010501.asp'; }
     function quick06()
    { self.location.href = '/eng/pub/comp/comp010601.asp'; }


// foout menu link --- 

     function foout01()
    { self.location.href = '/eng/pub/prod/prod020101.asp'; }
	 function foout02()
    { self.location.href = '/eng/pub/prod/prod020201.asp'; }
     function foout03()
    { self.location.href = '/eng/pub/prod/prod020301.asp'; }
     function foout04()
    { self.location.href = '/eng/pub/prod/prod020401.asp'; }
	 function foout05()
    { self.location.href = '/eng/pub/prod/prod020501.asp'; }
     function foout06()
    { self.location.href = '/eng/pub/prod/prod020601.asp'; }
     function foout07()
    { self.location.href = '/eng/pub/prod/prod020701.asp'; }
	 function foout08()
    { self.location.href = '/eng/pub/prod/prod020801.asp'; }
     function foout09()
    { self.location.href = '/eng/pub/prod/prod020901.asp'; }
     function foout10()
    { self.location.href = '/eng/pub/prod/prod021001.asp'; }
	 function foout11()
    { self.location.href = '/eng/pub/prod/prod021101.asp'; }
     function foout12()
    { self.location.href = '/eng/pub/prod/prod021201.asp'; }
     function foout13()
    { self.location.href = '/eng/pub/prod/prod021301.asp'; }
	 function foout14()
    { self.location.href = '/eng/pub/prod/prod021401.asp'; }
     function foout15()
    { self.location.href = '/eng/pub/prod/prod021501.asp'; }
     function foout16()
    { self.location.href = '/eng/pub/prod/prod021601.asp'; }
	 function foout17()
    { self.location.href = '/eng/pub/prod/prod021701.asp'; }

	








// glov menu link --- 

     function glov010101()
    { self.location.href = '/eng/pub/tech/tech030101.asp'; }
     function glov020101()
    { self.location.href = '/eng/pub/tech/tech030201.asp'; }
     function glov030101()
    { self.location.href = '/eng/pub/tech/tech030301.asp'; }
    function glov040101()
    { self.location.href = '/eng/pub/tech/tech030401.asp'; }
     function glov050101()
    { self.location.href = '/eng/pub/tech/tech030501.asp'; }
     function glov060101()
    { self.location.href = '/eng/pub/tech/tech030601.asp'; }
    function glov070101()
    { self.location.href = '/eng/pub/tech/tech030701.asp'; }
     

	
// actu menu link --- 

     function actu010101()
    {window.open('mailto: ?bcc=webmaster@smipc.or.kr'); }
     function actu020101()
     { self.location.href = '/eng/pub/supp/supp040201.asp'; }
     function actu030101()
     { self.location.href = '/eng/pub/supp/supp040301.asp'; }

	


// mark menu link --- 

     function mark010101()
    { self.location.href = '/eng/pub/date/date050101.asp'; }
     function mark020101()
    { self.location.href = '/eng/pub/date/date050201.asp'; }
   


// futu menu link --- 

     function futu010101()
    { self.location.href = '/eng/pub/link/link060101.asp'; }
    function futu020101()
    { self.location.href = '/eng/pub/link/link060201.asp'; }





