
// Content Display
function contView(obj) {
    if ( typeof(document.getElementById(obj)) != "undefined" && document.getElementById(obj) != null)
    {
	    var target = document.getElementById(obj);
	    target.style.display = (target.style.display=='none' ? 'block':'none');
    }
}

// Content Display - category list (only)
function contCtg(obj) {	
	var target = document.getElementById(obj);
	target.className = (target.className=='' ? 'open':'');
}

// Content Display - quickmenu (only)
function quickMenu() {	
	var target = document.getElementById('mquick');
	target.className = (target.className=='' ? 'menu-open':'');
}

// Content Display - action button (only)
function btnAction() {	
	var target = document.getElementById('actionBtn');
	target.className = (target.className=='maincover-btn' ? 'maincover-btn-down':'maincover-btn');
}

// Content Position - action button (only)
function mcPosition(obj) {
	var target = document.getElementById(obj);
	target.style.top = (target.style.top=='-12px' ? '-262px':'-12px');
}

// Content Display Show & Hide
function contChange(obj,num,total) {
    if(obj == "centerBanner")
    {
        if(num == 1)
        {
            document.getElementById(obj+1).style.display = 'block';
            document.getElementById(obj+2).style.display = 'none';
        }else{
            document.getElementById(obj+1).style.display = 'none';
            document.getElementById(obj+2).style.display = 'block';
        }
    }
		
	for (i=1; i<=total; i++)	{
		if (i==num)	{
			document.getElementById(obj+i).style.display = '';
		}
		else {
			document.getElementById(obj+i).style.display = 'none';
		}
	}
}

// Content Display Show & Hide - Class type
function contOpen(obj,num,total) {
	for (i=1; i<=total; i++)	{
		if (i==num)	{
			document.getElementById(obj+i).className = 'open';
		}
		else {
			document.getElementById(obj+i).className = '';
		}
	}
}

// Content Visibility Show & Hide
function visibView(obj) {	
	var target = document.getElementById(obj);
	target.style.visibility = (target.style.visibility=='hidden' ? 'visible':'hidden');
}

// input Focus
function inputFocus(obj,defaultValue) {
	if(obj.value == defaultValue) obj.value = '';
	else return false;
}
function inputBlur(obj,defaultValue) {
	if(obj.value == '') obj.value = defaultValue;
	else return false;
}

// image onMouse
function imgOver(obj) {
	obj.src = obj.src.replace("off.gif", "on.gif");
}
function imgOut(obj) {
	obj.src = obj.src.replace("on.gif", "off.gif");
}

// image Change
function imgChg(obj) {
	if(obj.src.indexOf("close.gif") != -1) obj.src = obj.src.replace("close.gif", "on.gif");
	else if(obj.src.indexOf("on.gif") != -1) obj.src = obj.src.replace("on.gif", "close.gif");
}

// 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 '';
}

// getFlash
/*function getFlash(swfName,wt,ht,id,xmlUrl){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wt+'" height="'+ht+'" id="'+id+'">');
	document.write('<param name="movie" value="'+swfName+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="FlashVars" value="xml_url='+xmlUrl+'" />');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="'+swfName+'" FlashVars="xml_url='+xmlUrl+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+wt+'" height="'+ht+'" allowScriptAccess="sameDomain" id="'+id+'"></embed></object>');
}*/
function getFlash(swfName,wt,ht,id,xmlUrl){
 document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wt+'" height="'+ht+'" id="'+id+'">');
 document.write('<param name="movie" value="'+swfName+'?xml_url='+xmlUrl+'">');
 document.write('<param name="quality" value="high">');
 document.write('<param name="wmode" value="transparent">');
 document.write('<param name="allowScriptAccess" value="always">');
 document.write('<embed src="'+swfName+'?xml_url='+xmlUrl+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+wt+'" height="'+ht+'" allowScriptAccess="sameDomain" id="'+id+'"></embed></object>');
}
function getLnb(swfName,menuId,xmlUrl,wt,ht,id){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wt+'" height="'+ht+'" id="'+id+'">');
	document.write('<param name="movie" value="'+swfName+'?menuid='+menuId+'&xmlurl='+xmlUrl+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="'+swfName+'?menuid='+menuId+'&xmlurl='+xmlUrl+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+wt+'" height="'+ht+'" allowScriptAccess="sameDomain" id="'+id+'"></embed></object>');
}
function getGnb(swfName,menuId,xmlUrl,gnbUrl,wt,ht,id){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wt+'" height="'+ht+'" id="'+id+'">');
	document.write('<param name="movie" value="'+swfName+'?menuid='+menuId+'&xmlurl='+xmlUrl+'&gnb_url='+gnbUrl+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="'+swfName+'?menuid='+menuId+'&xmlurl='+xmlUrl+'&gnb_url='+gnbUrl+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+wt+'" height="'+ht+'" allowScriptAccess="sameDomain" id="'+id+'"></embed></object>');
}
function getGnbMain(swfName,menuId,xmlUrl,wt,ht,id){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+wt+'" height="'+ht+'" id="'+id+'">');
	document.write('<param name="movie" value="'+swfName+'?menuid='+menuId+'&xmlurl='+xmlUrl+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="allowScriptAccess" value="always">');
	document.write('<embed src="'+swfName+'?menuid='+menuId+'&xmlurl='+xmlUrl+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="'+wt+'" height="'+ht+'" allowScriptAccess="sameDomain" id="'+id+'"></embed></object>');
}



// quick
function getPosition(){
	var start, end, scale, term;
	start = parseInt (document.getElementById('quicktop').style.top, 0);
	if ( window.navigator.userAgent.indexOf('MSIE 7') <= 0 && window.navigator.userAgent.indexOf('Firefox/') <= 0 )
	{
		end = document.getElementById('layoutWrap').scrollTop + 0;
	}
	else {
		end = document.documentElement.scrollTop + 0;
	}
	term = 5;

	if ( start != end ) {
	scale = Math.ceil( Math.abs( end - start ) / 20 );
		if ( end < start )	scale = -scale;
		document.getElementById('quicktop').style.top = parseInt (document.getElementById('quicktop').style.top, 0)+ scale + "px";
		term = 1;
	}
	setTimeout ("getPosition()", term);
}
function moveBanner() {
	document.getElementById('quicktop').style.top = document.documentElement.scrollTop + 0 + "px"; //?«ìžê°€ ê°™ìœ¼ë©??¬ë¼?´ë“œ ?†ë‹¤.
	getPosition();
	return true;
}
