//browser title
document.title='Hyundai E&C Supplier & Contractor Portal';
//

//¸µÅ©¿¡ Á¡¼±¾ø¾Ö±â
function bluring(){ 
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 
//

//flash
function view_flash(pageNum, subNum){
	var swfName = "";
	var w = "100%";
	var h = "180px";

	switch( pageNum )
	{
		case -1:
			swfName = "sub_01";
			h = "204px";
			break;
		case 0:
			swfName = "main";
			h = "367px";
			break;
		default:
			swfName = "sub_0" + pageNum;
			break;
	}

	var url = "/Swf/" + swfName + ".swf";
	if( pageNum > -1 && subNum > -1 ) url += "?pageNum=" + pageNum + "&subNum=" + subNum;
	
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id='"+url+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width="+w+" height="+h+"><param name='movie' value="+url+"><param name=quality value=high><param name='allowFullScreen' value='true' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always' /><embed src="+url+" id='"+url+"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+w+" height="+h+" wmode=transparent></embed></object>");
}
//function view_flash(url,w,h){
//	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id='"+url+"' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width="+w+" height="+h+"><param name='movie' value="+url+"><param name=quality value=high><param name='allowFullScreen' value='true' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='always' /><embed src="+url+" id='"+url+"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width="+w+" height="+h+" wmode=transparent></embed></object>");
//}
//

//main over
function tabOver(imgEl,num) {
	if(document.getElementById){
    var basicSrc, imgSrc = new String;
    basicSrc = imgEl.src;
    imgSrc = basicSrc.substring(basicSrc.length-7,basicSrc.length);
    if (imgSrc !== "_on.gif")
    {
      var tabSel = new String();
      tabSel = "tab".concat(num);
      document.images[tabSel].src = "images/main/tab" + num + "_on.gif";

      if (num == 1) {
        document.images["tab1"].src = "images/main/tab01_on.gif";
        document.images["tab2"].src = "images/main/tab02.gif";
        document.getElementById("notice").style.display = "";
        document.getElementById("cninews").style.display = "none";
      }
      else if (num == 2){
        document.images["tab1"].src = "images/main/tab01.gif";
        document.images["tab2"].src = "images/main/tab02_on.gif";
        document.getElementById("notice").style.display = "none";
        document.getElementById("cninews").style.display = "";
      }
    }
  }
}
//

//scrolling layer
function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 100;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}
//

//popup
function newwin(pop,width,height,flag)
{
	var url = pop;
	var wd = width;
	var he = height;
	var scw = (screen.width-wd)/2;
	var sch = (screen.height-he)/2;
	

	if (flag == 0 )
	{
		window.open(url,"0","toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + wd +",height=" + he + ",top="+sch+",left="+scw+";")
	}
	else
	{
		window.open(url,"0","toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + wd +",height=" + he + ",top="+sch+",left="+scw+";")

	}
}
//

//Movie
var paramInfo = new Array;

function initParam()
{
  var oldSize = paramInfo.length;

	for (var i=0; i<oldSize; i++) {
		paramInfo.length--;
	}
}

function setParam(paramName, paramValue)
{
	var idx = paramInfo.length;

	paramInfo[idx] = [];
	paramInfo[idx][0] = paramName;
	paramInfo[idx][1]= paramValue;
}

function playMedia(objID, objSource, objWidth, objHeight, objStyle)
{
	document.write('<OBJECT id="' + objID + '" name="' + objID + '" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
	document.write('WIDTH="' + objWidth + '" HEIGHT="' + objHeight + '" ' + objStyle + '>');

	for (var i=0; i<paramInfo.length; i++) {
		document.write('<PARAM NAME="' + paramInfo[i][0] + '" VALUE="'+ paramInfo[i][1] +'">');
	}

	document.write('</OBJECT>');
}
//

//rollover
function imgOver(param) {
	param.src = param.src.replace("_out.gif", "_ov.gif");
}
function imgOut(param) {
	param.src = param.src.replace("_ov.gif", "_out.gif")
}
//

// Bid°ü·Ã...ÆÄÀÏ ÀÌ¸§ ÃÊ±âÈ­
function setAllFileName()
{
    //alert("!");
    try
    {
        var oInput = document.getElementsByTagName("INPUT");
        
        for (i = 0; i <  oInput.length; i++)
        {
            if (oInput[i].type == "file" && oInput[i].id != "sFile1" && oInput[i].id != "brifFile")
            {
                oInput[i].name = "file1";
            }
        }
    }
    catch (e)
    {
    }
}

function ShowProgress() 
{
	try {
		var progressId = (new Date()).getTime() % 1000000;
		if (progressId == 0) progressId = 1000000;

		window.open("/common/ShowProgress.aspx?ProgressID=" + progressId, null, "width=400,height=200,status=no,memubar=no");
	} catch (e) {
		alert(e.Message);
		return false;
	}
}
//
