//관광정보 상세페이지 이미지 초기화
function initView2(el_id, view_item_count, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('p');
	var menu_count = menu_list.length;
	style = (typeof(style) != 'undefined') ? style : 'block';
	for(var i=0;i<menu_count;i++){
		if(i<view_item_count) menu_list[i].style.display = style;
		else menu_list[i].style.display = 'none';
	}
}
function initView(el_id, view_item_count, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	style = (typeof(style) != 'undefined') ? style : 'block';
	for(var i=0;i<menu_count;i++){
		if(i<view_item_count) menu_list[i].style.display = style;
		else menu_list[i].style.display = 'none';
	}
}
//관광정보 상세페이지 이미지 이동
function moveList2(direction, el_id, view_item_count, scroll_count, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('p');
	if(el_id == 'menu_pic1' || el_id == 'menu_pic2'){
		menu_list = menu.getElementsByTagName('li');
	}
	var menu_count = menu_list.length;
	var start_no = 0;

	style = (typeof(style) != 'undefined') ? style : 'block';

	// 현재 보여지고 있는 엘리먼트의 시작을 확인
	for(var i=0;i<menu_count;i++){
		if(menu_list[i].style.display == style){
			start_no = i;
			break;
		}
	}
	
	// 방향에 따른 이동
	if(direction == 'next'){
		if(menu_list[menu_count-1].style.display == style) return false;
		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no + scroll_count && i<start_no + scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
				}
			}
		}
	}else if(direction == 'prev'){
		if(menu_list[0].style.display == style) return false;
		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no - scroll_count && i<start_no - scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
				}
			}
		}
	}
}

//탭 초기화
function initViewTabMenu(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("li");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).getElementsByTagName("a")[0].href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.parentNode.className = currentmenu.parentNode.className.replace("current", "");
				currentmenu.className = currentmenu.className.replace("on", "");
			}

			this.targetEl.style.display = "block";
			this.parentNode.className += "current";
			this.className += " on";
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

function init_content(el_id){// 상세화면 탭 초기화
		var obj = document.getElementById(el_id);
		var liObj = obj.getElementsByTagName('li');
		var liObj_count = liObj.length;
		liObj[0].className = "on";
		for(i = 1; i <= liObj_count; i++){
			if (i == 1) {
				document.getElementById('tab'+i+'_content').style.display='block';
			} else {
				document.getElementById('tab'+i+'_content').style.display='none';
			}
		}
	}

/*플래쉬 테두리 없애기*/
function flash_write(strSrc, strW, strH )
{
 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="'+strW+'" HEIGHT="'+strH+'" id="company_flash_sub_v1" ALIGN="">');
 document.write('<PARAM NAME=movie VALUE="'+strSrc+'"> ');
 document.write('<PARAM NAME=menu VALUE=false> ');
 document.write('<PARAM NAME=quality VALUE=high> ');
 document.write('<PARAM NAME=wmode VALUE=transparent> ');
 document.write('<PARAM NAME=bgcolor VALUE=#CCCCCC> ');
 document.write('<PARAM name=allowScriptAccess value=always />');
 document.write('<EMBED src="'+strSrc+'" menu=false quality=high wmode=transparent bgcolor=#CCCCCC  WIDTH="'+strW+'" HEIGHT="'+strH+'" NAME="company_flash_sub_v1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
 document.write('</OBJECT>');
}

function flash_write2(strSrc, strW, strH){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+strW+'" height="'+strH+'" id="map_main" align="middle">');
//clsid:d27cdb6e-ae6d-11cf-96b8-444553540000
document.write('<param name="movie" value="'+strSrc+'" />');
document.write('<param name="quality" value="high" />');
document.write('				<param name="play" value="true" />');
document.write('				<param name="loop" value="true" />');
document.write('				<param name="wmode" value="window" />');
document.write('				<param name="scale" value="showall" />');
document.write('				<param name="menu" value="true" />');
document.write('				<param name="devicefont" value="false" />');
document.write('				<param name="salign" value="" />');
document.write('				<param name="allowScriptAccess" value="always" />');
document.write('				<!--[if !IE]>-->');
document.write('				<object type="application/x-shockwave-flash" data="'+strSrc+'" width="'+strW+'" height="'+strH+'">');
document.write('					<param name="movie" value="'+strSrc+'" />');
document.write('					<param name="quality" value="high" />');
document.write('					<param name="bgcolor" value="#ffffff" />');
document.write('					<param name="play" value="true" />');
document.write('					<param name="loop" value="true" />');
document.write('					<param name="wmode" value="window" />');
document.write('					<param name="scale" value="showall" />');
document.write('					<param name="menu" value="true" />');
document.write('					<param name="devicefont" value="false" />');
document.write('					<param name="salign" value="" />');
document.write('					<param name="allowScriptAccess" value="always" />');
document.write('				<!--<![endif]-->');
document.write('					<a href="http://www.adobe.com/go/getflash">');
document.write('						<li>서울</li><li>인천</li><li>경기도</li><li>충청북도</li><li>충청남도</li>');
document.write('					</a>');
document.write('				<!--[if !IE]>-->');
document.write('				</object>');
document.write('				<!--<![endif]-->');
document.write('			</object>');
}

//관광정보 상세페이지 이미지 이동
function moveList(direction, el_id, view_item_count, scroll_count, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	var start_no = 0;

	style = (typeof(style) != 'undefined') ? style : 'block';

	// 현재 보여지고 있는 엘리먼트의 시작을 확인
	for(var i=0;i<menu_count;i++){
		if(menu_list[i].style.display == style){
			start_no = i;
			break;
		}
	}
	
	// 방향에 따른 이동
	if(direction == 'next'){
		if(menu_list[menu_count-1].style.display == style) return false;
		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no + scroll_count && i<start_no + scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
				}
			}
		}
	}else if(direction == 'prev'){
		if(menu_list[0].style.display == style) return false;
		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no - scroll_count && i<start_no - scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
				}
			}
		}
	}
}
/*
function storyInfofn(val) {
	var obj = document.getElementById("story_rolling");
	var objBox = obj.getElementsByTagName("li");
	var objLength = objBox.length;
	
	var objNextBtn;
	var objPrevBtn;
	if ( val == 0 ) {
		objNextBtn = val + 1;
		objPrevBtn = objLength - 1;
	} else if ( val == objLength -1 )  {
		objNextBtn = 0;
		objPrevBtn = val - 1;
	} else {
		objNextBtn = val + 1;
		objPrevBtn = val - 1;
	}
	objTiBtn.item(0).href = "javascript:TravelInfofn(" + objPrevBtn + ");";
	objTiBtn.item(1).href = "javascript:TravelInfofn(" + objNextBtn + ");";
	

	for ( var i=0; i < objLength; i++ ) {
		if ( i == val ) {
			//objBox.item(i).style.display = "block";
			objBox[i].getElementsByTagName("div")[0].style.display = "block";
			objBox[i].className="on"
			
		} else {
			//objBox.item(i).style.display = "none";
			objBox[i].getElementsByTagName("div")[0].style.display = "none";
			objBox[i].className="off"
			clearTimeout(tid);
		}
	}

	(val==(objLength-1 ))?val=0:val++;
	tid = setTimeout("storyInfofn("+val+")",3000);
	
}*/

//메인 롤링
function storyInfofn(objid, val) {
	var obj = document.getElementById(objid);
	var objBox = obj.getElementsByTagName("li");
	var objLength = objBox.length;
	
/*	var objNextBtn;
	var objPrevBtn;
	if ( val == 0 ) {
		objNextBtn = val + 1;
		objPrevBtn = objLength - 1;
	} else if ( val == objLength -1 )  {
		objNextBtn = 0;
		objPrevBtn = val - 1;
	} else {
		objNextBtn = val + 1;
		objPrevBtn = val - 1;
	}
	objTiBtn.item(0).href = "javascript:TravelInfofn(" + objPrevBtn + ");";
	objTiBtn.item(1).href = "javascript:TravelInfofn(" + objNextBtn + ");";
	*/

	for ( var i=0; i < objLength; i++ ) {
		if ( i == val ) {
			//objBox.item(i).style.display = "block";
			objBox[i].getElementsByTagName("div")[0].style.display = "block";
			objBox[i].className="on";
			
		} else {
			//objBox.item(i).style.display = "none";
			objBox[i].getElementsByTagName("div")[0].style.display = "none";
			objBox[i].className="";
		}
	}
	
}
function change_img(source, target) {
	var target_img = document.getElementById(target);
	target_img.src = source.src;
}

//무엇을 먹을까 메인 탭 초기화
function initViewTabMenu2(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("li");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i).getElementsByTagName("div")[0];
		thismenu.targetEl.style.display = "none";
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				//currentmenu.parentNode.className = currentmenu.parentNode.className.replace("on", "");
				currentmenu.className = currentmenu.className.replace("on", "");
			}

			this.targetEl.style.display = "block";
			//this.parentNode.className += "current";
			this.className += " on";
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

//탭 초기화
function initViewMainBanner(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("p");
	var numAnchor = tabContainer.getElementsByTagName("ul")[0].getElementsByTagName("li");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "main_rolling_image")
			thismenu = numAnchor.item(i);
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i);
		thismenu.targetEl.style.display = "none";
		thismenu.onmouseover = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				//currentmenu.parentNode.className = currentmenu.parentNode.className.replace("current", "");
				currentmenu.getElementsByTagName("img")[0].src = currentmenu.getElementsByTagName("img")[0].src.replace("_on.gif", "_off.gif");
			}

			this.targetEl.style.display = "inline";
			//this.parentNode.className += "current";
			//this.className += " on";
			this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace("_off.gif", "_on.gif");
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onmouseover();
}

//탭 초기화(여행기사_배너)
function initViewMainArticleBanner(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("div")[0].getElementsByTagName("p");
	var pLength = tabContainer.getElementsByTagName("p").length;
	var numAnchor = tabContainer.getElementsByTagName("p")[pLength-1].getElementsByTagName("span");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		thismenu = numAnchor.item(i);
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i);
		thismenu.targetEl.style.display = "none";
		thismenu.onmouseover = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.getElementsByTagName("img")[0].src = currentmenu.getElementsByTagName("img")[0].src.replace("_on.gif", "_off.gif");
			}
			
			this.targetEl.style.display = "inline";
			this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace("_off.gif", "_on.gif");
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onmouseover();
}
//탭 초기화(이벤트_배너)
function initViewMainEventBanner(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("div");
	var ulLength = tabContainer.getElementsByTagName("ul").length;
	var numAnchor = tabContainer.getElementsByTagName("ul")[ulLength-1].getElementsByTagName("li");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "event_content")
			thismenu = numAnchor.item(i);
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i);
		thismenu.targetEl.style.display = "none";
		thismenu.onmouseover = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.getElementsByTagName("img")[0].src = currentmenu.getElementsByTagName("img")[0].src.replace("_on.gif", "_off.gif");
			}
			this.targetEl.style.display = "inline";
			this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace("_off.gif", "_on.gif");
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onmouseover();
}

//탭 초기화(테마여행지)
function initViewMainTheme(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("div");
	var numAnchor = tabContainer.getElementsByTagName("h3");
	
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		thismenu = numAnchor.item(i);
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i);
		thismenu.targetEl.style.display = "none";
		thismenu.onmouseover = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.getElementsByTagName("img")[0].src = currentmenu.getElementsByTagName("img")[0].src.replace("_on.gif", "_off.gif");				
			}
			this.targetEl.style.display = "inline";
			this.getElementsByTagName("img")[0].src = this.getElementsByTagName("img")[0].src.replace("_off.gif", "_on.gif");
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onmouseover();
}


function goTourContentView(seqno, ctype) {
	if (ctype == '304' || ctype == '0') { 
		window.open("/kor/ut/where//view_approach.jsp?i_seqno=" + seqno + "&ctype=" + ctype, "_blank", '');
	} else {
		window.open("/kor/ut/where//view_approach.jsp?i_seqno=" + seqno + "&ctype=" + ctype, "", 'width = 650 , scrollbars=yes');
	}
}


function goTourCmsContentView(cid, ctype) {
	cid = cid.replace(/(^\s*)|(\s*$)/g,"");
	window.open("/kor/ut/where/view_approach.jsp?cid=" + cid + "&ctype=" + ctype, "", 'width = 650 , scrollbars=yes');
}

/*2008.08.21 김선미 아웃서비스 위해 추가*/

function goTourContentViewOutService(seqno, ctype) {
	if (ctype == '304' || ctype == '0') { 
		window.open("/kor/ut/where/view_approach.jsp?out_service=Y&i_seqno=" + seqno + "&ctype=" + ctype, "_blank", '');
	} else {
		window.open("/kor/ut/where/view_approach.jsp?out_service=Y&i_seqno=" + seqno + "&ctype=" + ctype, "", 'width = 650 , scrollbars=yes');
	}
}

function goTourCmsContentViewOutService(cid, ctype) {
	window.open("/kor/ti/view_approach.jsp?out_service=Y&cid=" + cid + "&ctype=" + ctype, "", 'width = 650 , scrollbars=yes');
}

//무엇을 먹을까 메인 탭
function initViewTabMenu3(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("li");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i).getElementsByTagName("a")[0];
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i).getElementsByTagName("div")[0];
		thismenu.targetEl.style.display = "none";
		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.parentNode.className = currentmenu.parentNode.className.replace("on", "");
				//currentmenu.className = currentmenu.className.replace("on", "");
			}

			this.targetEl.style.display = "block";
			this.parentNode.className += " on";
			//this.className += " on";
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

//전체 메인 인기여행지, 인기 기사 탭
function initViewTabMenu_main(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("li");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i).getElementsByTagName("a")[0];
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i).getElementsByTagName("div")[0];
		thismenu.targetEl.style.display = "none";
		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.parentNode.getElementsByTagName("img")[0].src = currentmenu.parentNode.getElementsByTagName("img")[0].src.replace("_on.gif", "_off.gif");
				//currentmenu.parentNode.className = currentmenu.parentNode.className.replace("on", "");
				//currentmenu.className = currentmenu.className.replace("on", "");
			}

			this.targetEl.style.display = "block";
			this.parentNode.getElementsByTagName("img")[0].src = this.parentNode.getElementsByTagName("img")[0].src.replace("_off.gif", "_on.gif");
			//this.parentNode.className += " on";
			//this.className += " on";
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

/*
전체메인 이럴땐여기 추천 여행코스 탭
*/
function main_here_course(tabContainerID) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("li");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i).getElementsByTagName("img")[0];
		else
			continue;
		thismenu.container = tabContainer;
		thismenu.targetEl = tabAnchor.item(i).getElementsByTagName("div")[0];
		thismenu.targetEl.style.display = "none";
		thismenu.onclick = function tabMenuClick() {

			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				//currentmenu.parentNode.className = currentmenu.parentNode.className.replace("on", "");
				currentmenu.src = currentmenu.src.replace("_on.gif", "_off.gif");
				//currentmenu.className = currentmenu.className.replace("on", "");
			}

			this.targetEl.style.display = "block";
			//this.parentNode.className += "current";
			//this.className += " on";
			this.src = this.src.replace("_off.gif", "_on.gif");
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

// 이미지보기 
function viewImg(el_id, src, alt){
	document.getElementById(el_id).setAttribute('src', src);
	if(alt) document.getElementById(el_id).setAttribute('alt', alt);
}

//무엇을할까 rss 복사
 function copyClip(meintext) {
	if(window.clipboardData) {
		window.clipboardData.setData("Text", meintext);
	} else if(window.netscape) {
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if(!clip) return;

		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if(!trans) return;

		trans.addDataFlavor('text/unicode');

		var str = new Object();
		var len = new Object();

		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

		var copytext = meintext;
		str.data = copytext;

		trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid = Components.interfaces.nsIClipboard;
		if(!clipid) return false;

		clip.setData(trans,null,clipid.kGlobalClipboard);
	}

	alert("The RSS address has been copied.");
	return false;
}

//UCC동영상 팝업으로 띄우기
function goPop(url, title){
	var url = encodeURI(url);
	var title = encodeURI(title);
	window.open(url,'',"width=410 ,height=335"); 
}

// 탭컨텐츠
function initTabMenu(tabContainerID, img_change) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.parentNode.className = currentmenu.parentNode.className.replace("current", "");
				if(currentmenu.getElementsByTagName('img')[0] && img_change) currentmenu.getElementsByTagName('img')[0].src = currentmenu.getElementsByTagName('img')[0].src.replace('_on.gif', '.gif');
			}

			this.targetEl.style.display = "block";
			this.parentNode.className += "current";
			if(this.getElementsByTagName('img')[0] && img_change) this.getElementsByTagName('img')[0].src = this.getElementsByTagName('img')[0].src.replace('.gif', '_on.gif');
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
//동영상 팝업
function pop_movie(vid, cid) {
	   if( vid == ""){
		   alert("동영상 정보가 없습니다.");
	   } else{
			window.open("/kor/ut/where/movie_popup.jsp?vid="+vid+"&amp;cid="+cid,"","width=880 ,height=470"); 
	   }
 }

 function copy_rss(meintext) {
	if(window.clipboardData) {
		window.clipboardData.setData("Text", meintext);
	} else if(window.netscape) {
		netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');

		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if(!clip) return;

		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if(!trans) return;

		trans.addDataFlavor('text/unicode');

		var str = new Object();
		var len = new Object();

		var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

		var copytext = meintext;
		str.data = copytext;

		trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid = Components.interfaces.nsIClipboard;
		if(!clipid) return false;

		clip.setData(trans,null,clipid.kGlobalClipboard);
	}

	alert("RSS 피드를 복사 했습니다.");
}
