﻿/*---------------------------------------------------------------------------------------------------------*/
//# 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 ''; 
} 


function ajaxObjSet()
{
		if(window.ActiveXObject)
		{
			try{
				return new ActiveXObject("Msxml2.XMLHTTP"); 
			}
			catch(e){
				try {
					return new ActiveXObject("Microsoft.XMLHTTP");  //IE에서 XMLHttpRequest 객체 구하기 
				}
				catch(e){
					return null; 
				}
			}
		}
		else if(window.XMLHttpRequest)
		{
			return new XMLHttpRequest(); //IE 이외의 파이어폭스, 오페라와 같은 브라우저에서 XMLHttpRequest 객체 구하기 
		}
		else 
		{
			return null; 
		}
}

//Mt Quick Service 
function ShowHideMtservicetab(){
	var obj = document.getElementById("mt_service_go"); 
	var obj2 = document.getElementById("ifm_mt_service_go"); 

	if(obj.style.display != 'none') {
		obj2.style.display = 'none'; 
		obj.style.display = 'none'; 
	} else {
		obj2.style.display = 'block'; 
		obj.style.display = 'block'; 
	}
}


//배너에 사용 
function dispObj( str ) 
{
	document.write( str );
}


//쿠키 값 가져오기 
function getCookie( cookieName )
{
	var search = cookieName + "=";
	var cookie = document.cookie;

	if( cookie.length > 0 )
	{
		startIndex = cookie.indexOf( cookieName );
		if( startIndex != -1 )
		{
			startIndex += cookieName.length;
			endIndex = cookie.indexOf( ";", startIndex );
			if( endIndex == -1) endIndex = cookie.length;
			return unescape( cookie.substring( startIndex + 1, endIndex ) );
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
}


//쿠키 저장 
function setCookie( cookieName, cookieValue, expireDate )
{
	var today = new Date();
	today.setDate( today.getDate() + parseInt( expireDate ) );
	document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";"
}

// 기사본문, 커뮤니티 게시판 본문 이미지 팝업 
function image_open(url, winName, width, height, ckScroll, ckTool)
{
	var window_top = 50;
	var window_left =  50;
	if(!ckTool){ckTool='no';}
	window.open(url,winName,'width='+ width +',height=' + height + ',scrollbars=' + ckScroll + ',toolbar=' + ckTool + ',top=' + window_top + ',left=' + window_left + '');
}

/*---------------------------------------------------------------------------------------------------------*/
//# 네이트스크랩API연동 POPUP
/*---------------------------------------------------------------------------------------------------------*/
function scrapNateConnect (sFrom, sType, sNo) {
	var sID = (sFrom == "STAR") ? "s0300003" : "s0300002";
	var strUrl = "http://api.cyworld.com/openscrap/post/v1/?";
	strUrl += "xu=" + escape("http://www.mt.co.kr/view/xml/makeNateScrapXml.php?stype=" + sType + "&sno=" + sNo);
	strUrl += "&sid=" + sID;
	
	var strOption = "width=450,height=410";
	
	var objWin = window.open(strUrl, 'cyopenscrap',  strOption);
	objWin.focus();
}
