	//폼생성하여 새창띄우기
	function newWindowToForm(target, url)
	{
		var browser = navigator.userAgent.toLowerCase();
		if(browser.indexOf("firefox") > 0)
		{
			target = "_top";
		}

        var oDocumentBody   = window.document.getElementsByTagName("body");
        var oDocument       = null;

        // body 태그가 선언되지 않았을 경우 문서 자체에 oFormDiv 를 추가하기 위해 객체 지정
        if (typeof(oDocumentBody[0]) == "undefined") {
            oDocument = window.document.documentElement;
        } else {
            oDocument = oDocumentBody[0];
        }

		var obj_form = window.document.createElement("FORM");
		obj_form.method = "post";
		obj_form.target = target;
//		obj_form.action = redirect_domain + escape(url);
		obj_form.action = escape(url);
		oDocument.appendChild(obj_form);
		obj_form.submit();
	}

	//문자열 좌우측 공백제거
	function sch_trim(text) {
		if(text == "") return text;
		var len = text.length;
		var st = 0;
		while ((st < len) && (text.charAt(st) <= ' ')) {
			st++;
		}
		while ((st < len) && (text.charAt(len - 1) <= ' ')) {
			len--;
		}
		return ((st > 0) || (len < text.length)) ? text.substring(st, len) : text;
	}

	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='about:blank;';
		return '';
	}

	//스타채널 리스트 > 스타명 클릭시 이동
	function starNameClick(star_id)
	{
		if(star_id != "")
		{
			if(parent)
			{
				parent.location.href = "/star/starMain?star_id="+star_id;
			}
			else
			{
				document.location.href = "/star/starMain?star_id="+star_id;
			}
		}
	}

	function starNameClick2(star_id)
	{
		if(star_id != "")
		{
			newWindowToForm("_new", "/star/starMain&star_id="+star_id);
		}
	}

	function defThumb(img)
	{
		img.src='http://img.cyworld.com/img/video_v3/images/noimg.jpg';
		img.onerror=null;
		return;
	}

	function get_firstChild(n)
	{
		y=n.firstChild;
		while (y.nodeType!=1)
		{
			y=y.nextSibling;
		}
		return y;
	}

	function get_lastChild(n)
	{
		y=n.lastChild;
		while (y.nodeType!=1)
		{
			y=y.previousSibling;
		}
		return y;
	}

	function rollRightView(Element_ID)
	{
		var check_flag=0;
		var clip_list = document.getElementById(Element_ID);
	  	var clip_list_item = clip_list.getElementsByTagName('li');
		//alert(clip_list_check[clip_list_item.length-1].checked);
  		if(clip_list_item.length > 4)
	  	{
	  		if(clip_list.firstChild.childNodes[2].checked)
	  		{
	  			 check_flag = 1;
	  		}
	  		var temp_item = clip_list.firstChild;
			clip_list.removeChild(clip_list.firstChild);
			clip_list.appendChild(temp_item);
			if(check_flag)
			{
				clip_list.lastChild.childNodes[2].checked = true;
			}
			if(play_list_roll_index > (max_play_list_cnt-1) )
			{
				play_list_roll_index++;
			}
			else
			{
				play_list_roll_index =0;
			}
	  	}

	}

	function rollLeftView(Element_ID)
	{
		var check_flag = 0;
	  	var clip_list = document.getElementById(Element_ID);
  		var clip_list_item = clip_list.getElementsByTagName('li');
		if(clip_list_item.length > 4)
	  	{
	  		if(clip_list.lastChild.childNodes[2].checked)
	  		{
	  			 check_flag = 1;
	  		}
			var temp_item = clip_list.lastChild;
			clip_list.removeChild(clip_list.lastChild);
			clip_list.insertBefore(temp_item,clip_list.firstChild);
			if(check_flag)
			{
				clip_list.firstChild.childNodes[2].checked = true;
			}
			if(play_list_roll_index > 0 )
			{
				play_list_roll_index--;
			}
			else
			{
				play_list_roll_index = max_play_list_cnt-1;
			}
	  	}
	}

	function rollRight(max_length)
	{


  		if(___clip_list_length > max_length)
  		{
			var temp_item = get_firstChild(___clip_list);
			___clip_list.removeChild(get_firstChild(___clip_list));

			___clip_list.appendChild(temp_item);

		}
	}


	function rollLeft(max_length)
	{

  		if(___clip_list_length > max_length)
  		{
			var temp_item = get_lastChild(___clip_list);
			___clip_list.removeChild(get_lastChild(___clip_list));
			___clip_list.insertBefore(temp_item,get_firstChild(___clip_list));
		}


	}

	function setPlayListView(video_seq,button_idx)
	{
		if(setPlayListDone == 0)
		{
			return false;
		}
		setPlayListDone = 0;
		this.button_id = document.getElementsByName(button_idx);
		var ajax = new Ajax.Request(
			'/clip/setPlayList',
			{
				method: 'post',
				parameters: {video_seq: video_seq},
				onSuccess: setPlayListViewCallBack
			}
		);
	}
	function setPlayListViewCallBack(transport, json)
	{

		if(json=='ov')
		{
			setPlayListDone = 1;
			alert('내가 담은 동영상 목록에는 20개까지만 담을 수 있습니다.');
		}
		else if(json=='dp')
		{
			setPlayListDone = 1;
			alert('이미 목록에 추가 되었습니다.');
		}
		else
		{
			var my_list = document.getElementById('my_play_list');
	  		++max_play_list_cnt;
	  		if(max_play_list_cnt > 4)
	  		{
	  			//arrow_left_link.onclick='rollLeftView(\'my_play_list\'); return false;';
	  			//arrow_right_link.onclick='rollRightView(\'my_play_list\'); return false;';
	  			arrow_left_link.className='ico_left on'
	  			arrow_right_link.className='ico_right on';
				arrow_left.setAttribute('src','/images/view/btn_arrow_left_on.gif');
		  		arrow_right.setAttribute('src','/images/view/btn_arrow_right_on.gif');

	  		}
	  		var my_list_count = document.getElementById('list_count');
	  		my_list_count.innerHTML = '(' + max_play_list_cnt + ')';
	  		var _listShow = document.getElementById(('listShow'));
	  		_listShow.style.display = '';
	  		my_list.innerHTML = transport.responseText;

	  		for(var x=0;x<this.button_id.length;x++)
			{
				this.button_id[x].innerHTML ='';
				this.button_id[x].className = 'addPlaylist checked';
			}
	  		setPlayListDone = 1;
	  		alert('동영상 목록에 추가했습니다.');
	  		document.focus();



		}
	}
	function InitPlayListView()
	{
		var ajax = new Ajax.Request(
			'/clip/initPlayList',
			{
				method: 'post',
				onSuccess: InitPlayListViewCallBack
			}
		);
	}
	function InitPlayListViewCallBack(transport)
	{

			var my_list = document.getElementById('my_play_list');
	  	my_list.innerHTML = transport.responseText;
	  	document.focus();

	}
	function getPrevSB(x,n)
	{
		while(n)
		{
		x = x.previousSibling
		--n;
		}
		return x;
	}
	function setPlayList(video_seq,button_idx)
	{
		if(setPlayListDone == 0) return false;
		setPlayListDone = 0;
		this.button_id = document.getElementsByName(button_idx);
		setPlayListDone = 0;
			var ajax = new Ajax.Request(
			'/clip/setPlayList',
			{
				method: 'post',
				parameters: {video_seq: video_seq, button_idx: button_idx},
				onSuccess: setPlayListCallBack
			}
		);
	}

	function setPlayListCallBack(transport, json)
	{

		if(json=='ov')
		{
			setPlayListDone = 1;
			alert('내가 담은 동영상 목록에는 20개까지만 담을 수 있습니다.\n담아놓으신 영상을 삭제하시면 더 담을 수 있습니다.');
		}
		else if(json=='dp')
		{
			setPlayListDone = 1;
			alert('이미 목록에  추가 되었습니다.');
		}
		else
		{
			for(var x=0;x<this.button_id.length;x++)
			{
				this.button_id[x].innerHTML ='';
				this.button_id[x].className = 'addPlaylist checked';
			}
			setPlayListDone = 1;
	  		alert('동영상 목록에 추가했습니다.');
		}
	}

  		///Play List
  		function getCookie(c_name)
		{
			if (document.cookie.length>0)
			  {
			  c_start=document.cookie.indexOf(c_name + "=");
			  if (c_start!=-1)
			    {
			    c_start=c_start + c_name.length+1;
			    c_end=document.cookie.indexOf(";",c_start);
			    if (c_end==-1) c_end=document.cookie.length;
			    return unescape(document.cookie.substring(c_start,c_end));
			    }
		 	 }
			return "";
		}
		function setCookie(c_name,value,expiredays)
		{
			var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
			document.cookie=c_name+ "=" +escape(value)+
			((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		}
  		function PlayListClicked()
  		{
  			//alert("Under Construction");
			video_seq_arr = form.getInputs('hidden','video_list');
			video_seq_arr_checkbox = form.getInputs('checkbox','video_list_check');
			playlist_flag = 1;




			var arr_idx = 0;
			var total_cnt = video_seq_arr.length;
			for(i=0;i<total_cnt;i++)
			{
				//alert(video_seq_arr_checkbox[i].checked);
				if(video_seq_arr_checkbox[i].checked == true)
				{
					video_seq[arr_idx] = video_seq_arr[i].value;
					arr_idx++;
				}
			}
			if(arr_idx==0)
			{
				alert('선택한 동영상이 없습니다.');
				return true;
			}

				//video_seq_complete = 0;
			play_lisy_index = 0;

			//var play_list_index = getCookie("play_list_index");
			var video_seq_json = video_seq.toJSON();
			//
			this.video_seq_init = video_seq[0];
			var ajax = new Ajax.Request
	  		(   //&video_seq_json='+escape(video_seq)+'&video_seq_json_complete='+video_seq_complete_json
	  			'/clip/StartPlayList',
				{
					method: 'post',
					parameters: {video_seq_json: video_seq_json, totalCnt: arr_idx} ,
					onSuccess: PlayListClickedCallBack
				}
	  		);

  		}
  		function PlayListClickedCallBack(transport,json)
		{/*
			if(json)
			{

		  		var video_id = json['video_id'];
		  		var auth_key = json['auth_key'];
		 		video_seq_complete = json['video_seq_complete'];
		 		window.location = "/clip/view&video_seq="+72679134;
		 		//player.remote("play",null,video_id,auth_key,"");

			}
			else
			{
				alert('fail');
			}
			*/
			setCookie_section('isPlayList','1');
			window.location = "/clip/view&video_seq="+this.video_seq_init+"&play_list_index=0";
		}
  		function NextPlayList()
		{
			var video_seq_json = video_seq.toJSON();
			var ajax = new Ajax.Request
	  		(
	  			'/clip/StartPlayList',
				{
					method: 'post',
					parameters: {video_seq_json: video_seq_json, video_seq_complete: video_seq_complete} ,
					onSuccess: PlayListClickedCallBack
				}
	  		);
		}

	///////play List

	function delete_list(video_seq_para,check_para)
  		{

			var video_seq = new Array();
			var arr_idx = 0;
			for (i=0;i<video_seq_para.length;i++)
			{
				if(check_para[i].checked == true)
				{
					video_seq[arr_idx] = video_seq_para[i].value;
					arr_idx++;
				}
			}
			this._video_seq = video_seq;
			var video_seq_json = video_seq.toJSON();

  			var ajax = new Ajax.Request
	  		(
	  			'/clip/RemovePlayList?video_seq_json='+video_seq_json,
				{
					method: 'post',
					onSuccess: RemovePlayListViewCallBack
				}
	  		);
  		}


	function RemovePlayListViewCallBack(transport,json)
	{
		if(json)
		{
			  	var my_list_count = document.getElementById('list_count');


		  		//my_list_count.innerHTML = '(' + cnt + ')';


			  	var clip = document.clipfrm;
			  	var counterNow;
		  		var clip_list = document.getElementById("my_play_list");
		  		var clip_list_item = clip_list.getElementsByTagName('li');
				//var clip = document.clipfrm;
					var checkbox_arr = form.getInputs('checkbox','video_list_check')

		  		var my_list = document.getElementById('my_play_list');


		  		var my_list_item = my_list.getElementsByTagName('LI');
		  		var max_len = clip_list_item.length;
		  		var i=0;
		  		var checkCount=0;
		  		var __button_id;
		  		for(var idx_button =0 ;idx_button<this._video_seq.length;idx_button++)
		  		{
		  			__button_id = document.getElementsByName('button_'+this._video_seq[idx_button]);
		  			for(var x=0;x<__button_id.length;x++)
		  			{
		  				if(__button_id[x])
			  			{
				  			__button_id[x].className='addPlaylist';
				  			__button_id[x].innerHTML = '<a href="#" ' + 'onClick="setPlayListView(' + this._video_seq[idx_button] + ',\'button_'+this._video_seq[idx_button]+'\'); return false;" title="동영상 목록에 추가">동영상 목록에 추가</a>';
			  			}

		  			}


		  		}
		  		for (idx=0;idx<max_len;idx++)
		  		{

		  			if(checkbox_arr[idx].checked==true)
					{


				  			--max_play_list_cnt;
				  			if(max_play_list_cnt<=4)
				  			{

								arrow_left_link.className='ico_left off';
	  							arrow_right_link.className='ico_right off';
								arrow_left.setAttribute('src','/images/view/btn_arrow_left_off.gif');
								arrow_right.setAttribute('src','/images/view/btn_arrow_right_off.gif');
				  			}
							//alert(idx);
							my_list.removeChild(my_list_item[i]);
							//counterNow = my_list_count.innerHTML;
							my_list_count.innerHTML = '(' + max_play_list_cnt + ')';
							i--;
							checkCount++;
					}

				   	i++;
				}
				document.getElementById('btn_select_all').checked=false;

			if( checkCount == 0 ){
			alert('선택한 동영상이 없습니다.');
			return;
			}
			clip_list = document.getElementById("my_play_list");
		  	clip_list_item = clip_list.getElementsByTagName('li');
				if(clip_list_item.length== 0)
		  		{
		  			var _listShow = document.getElementById(('listShow'));
	  				//_listShow.className = 'listFold';
	  				_listShow.style.display = 'none';
		  		}
		}
	}



	/****관심프로그램 등록****/
	function getTargetURL()
	{
		var url = document.location + "";
		var re_1 = /http:\/\/tvon.nate.com/g;
		var re_2 = /\?/g;
		var url_2 = url.replace(re_1, "");
		url_2 = url_2.replace(re_2, "&");

		return url_2;
	}

	function setInterestProgram(program_seq)
	{
		if(program_seq != '')
		{
			var url = "/channel/InterestProgramRegAction";
			var pars = "program_seq="+ program_seq +"&target_url="+ escape(getTargetURL());
			var myAjax = new Ajax.Request(url,
				{
					method: "get",
					parameters: pars,
					onSuccess: displayInterestProgram
				});
		}
	}

	function displayInterestProgram(transport, json)
	{
		if(json[0] == 'logout')
		{
			redirect_login_2(json[1], 'c');
		}
		else if(json[0] == 'exists')
		{
			alert('이미 등록된 프로그램입니다.');
		}
		else if(json[0] == 'wrong')
		{
			alert('잘못된 프로그램입니다.');
		}
		else if(json[0] == 'ok')
		{
			setInterestProgramSelect();
			alert('등록되었습니다.');
		}
	}

	function setInterestProgramSelect()
	{
		var url = "/channel/InterestProgramSelAction";
		var pars = "";

		var myAjax = new Ajax.Request(url,
			{
				method: "get",
				parameters: pars,
				onSuccess: displayProgramSelectList
			});
	}

	function displayProgramSelectList(transport, json)
	{
		var sel_obj = document.select_form.programSelect;

		if(sel_obj != null)
		{
			for(i=0 ; i < json.length + 1 ; i++)
			{
				var option_obj = new Option('', '');
				sel_obj.options[i] = option_obj;
			}

			sel_obj.options[0].value = "";
			sel_obj.options[0].text = "관심 프로그램";

			for(i=0 ; i < json.length  ; i++)
			{
				var sel_value = "channel_seq="+ json[i]['channel_seq'] +"&program_seq="+ json[i]['program_seq'];
				var sel_text = json[i]['program_nm'];

				sel_obj.options[i+1].value = sel_value;
				sel_obj.options[i+1].text = sel_text;
			}
		}
	}
	/****관심프로그램 등록****/

	/*****************************************************
	'	Function Information
	'		- Writer : natank93
	'		- Write Date : 2006/03/14
	'	Function Prototype
	'		- FUNCTION View_Comment(1)
	'	Function Description
	'		- Div 숨기기 / 보이기
	'		- innerHTML을 이용한 text 변환
	'	Input Parameter Description
	'		- n : 1
	'	Return Value
	'		- nothing
	'	Etc
	'	Example
	'		- javascript:View_Comment('1');
	******************************************************/

	//로그인처리 후 다시 돌아올 도메인
	var redirect_domain = 'http://tvon.nate.com';
	//var redirect_domain = 'http://videodev2.cyworld.com';

	function View_Comment(n) {
		var viewloop;
		viewloop=document.getElementById('comment_list' + n);

		var text = document.getElementById('text'+n);

		if(viewloop.style.display== 'none') {
			viewloop.style.display = '';
			text.innerHTML = "의견숨기기";
		}
		else{
			viewloop.style.display = 'none';
			text.innerHTML = "의견보기";
		}
	}



	/*****************************************************
	'	Function Information
	'		- Writer : natank93
	'		- Write Date : 2006/03/14
	'	Function Prototype
	'		- FUNCTION CheckLen(obj, tgz, maxlen, rtn)
	'	Function Description
	'		- 현재 byte 체크
	'	Input Parameter Description
	'		- obj	:
	'		- tgz	:
	'		- maxlen:
	'		- rtn	:
	'	Return Value
	'		- nothing
	'	Etc
	'	Example
	'		- javascript:View_Comment('1');
	******************************************************/
	String.prototype.cut = function(len){
		var str = this;
		var l = 0;
		for (var i=0; i<str.length; i++) {
				l += (str.charCodeAt(i) > 128) ? 2 : 1;
				if (l > len) return str.substring(0,i);
		}
		return str;
	}
	function CheckLen(obj, tgz, maxlen, rtn)
	{
		var temp;
		var mcount;

		mcount = 0;
		len = obj.value.length;

		for(k=0;k<len;k++){
			temp = obj.value.charAt(k);
			if(escape(temp).length > 4)
				mcount += 2;
			else
				mcount++;
		}

		if (rtn == 1)
		{
			if (maxlen >= mcount)
			{
				return mcount + '자 남음';
			}
			else
			{
				var str = obj.value;
				return maxlen - mcount + 'byte 남음';
				//obj.focus();
				alert('의견은 ' + maxlen + '바이트 내로 작성하셔야 합니다.');
				obj.value = str.cut(maxlen);
			}
		}
		else if (rtn == 2)
		{
			if (maxlen < mcount)
			{
				var str = obj.value;
				alert('의견은 ' + maxlen/2 + '자(한글기준) 내로 작성하셔야 합니다.');
				obj.value = str.cut(maxlen);
			}
		}
		else
		{
			if (maxlen >= mcount)
			{
	//			tgz.value = mcount;
			}
			else
			{
				var str = obj.value;
				//tgz.value = maxlen;
				//obj.focus();
				alert('의견은 ' + maxlen + '바이트 내로 작성하셔야 합니다.');
				obj.value = str.cut(maxlen);
			}
		}
	}

	/*****************************************************
	* 로그인 페이지로 이동--상단로그인버튼 전용
	*****************************************************/
	function go_login (returnurl) {
			document.location.replace("/common/videoLogin?redirection="+ redirect_domain + escape(returnurl));
	}

	/*****************************************************
	* 로그인 페이지로 이동--섹션 3.0 개편(2008.04.07. Jyk)
	*****************************************************/
	function redirect_login (b_Session,returnurl) {
			//var returnurl = "redirection=http://tvon.nate.com" + returnurl

		if(returnurl == "/clip/write" || returnurl == "/cypd/cypdchallenge" || returnurl.indexOf('/clip/modify') != -1)
		{
		}

		if (b_Session == 0)
			{
				//alert('로그인 하세요');
				if (confirm("로그인 하시겠습니까?")) {
					//document.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
					document.location.replace("/common/videoLogin?redirection="+ redirect_domain + escape(returnurl));
				}
				return;
			} else {
				//document.location.href = redirect_domain + escape(returnurl);

				//referer를 알기 위해 form으로 이동
				var oDocumentBody = window.document.getElementsByTagName("body");
				var oDocument = oDocumentBody[0];

				var obj_form = window.document.createElement("FORM");
				obj_form.method = "get";
				obj_form.action = redirect_domain + escape(returnurl);

				oDocument.appendChild(obj_form);
				obj_form.submit();
			}
	}

	function redirect_login_2(returnurl, type) //type -> 'c':current, 'p':parent, 't':top
	{
			if(confirm("로그인 하시겠습니까?")) {
				loginRedirect("http://tvon.nate.com"+ escape(returnurl), type);
			}
	}

	function redirect_login_parent (returnurl) {
			//var returnurl = "redirection=http://tvon.nate.com" + returnurl
			if (confirm("로그인 하시겠습니까?")) {
				//parent.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				parent.location.replace("/common/videoLogin?redirection="+ redirect_domain + escape(returnurl));
			}
	}
	/*****************************************************
	* 로그인 페이지로 이동--전체적으로 다 사용할 수 있게 수정(현재 사용 안함)
	*****************************************************/
	function login_popup (returnurl) {
			//var returnurl = "redirection=http://tvon.nate.com" + returnurl
			if (confirm("로그인 하시겠습니까?")) {

				opt = "toolbar=no,location=no,directories=no,status=no,menubar=no";
				opt = opt + ",scrollbars=no";
				opt = opt + ",resizable=no";

				window.open ("http://cyworld.com/main2/login/cylogin_popup.asp?redirection=" + returnurl, "loginPop", opt);
			}
	}

	/*****************************************************
	* 싸이로그아웃
	*****************************************************/
	function redirect_logout() {
			document.location.replace("http://cyworld.com/main2/logout.asp");
	}


	/*****************************************************
	* 기본 문구일 경우 문구 삭제.
	*****************************************************/
	function ClearText(obj) {//기본 문구가 들어있으면 없애야쥐~
		if (obj.value == '의견은 1000바이트 내로 작성하셔야 합니다.') {
			obj.value = "";
		}
	}


	/*****************************************************
	* Popup 창 띄우기
	'	Input Parameter Description
	'		- url	: 팝업창 URL
	'		- w		: 팝업창 width
	'		- s		: 팝업창 scrollbar
	'		- r		: 팝업창 resizable
	'		- winname: 팝업창 window name
	*****************************************************/
	function openPopup(url, w, h, s, r, winname)
	{
		width=screen.width;
		height=screen.height;

		x=(width/2)-(w/2);
		y=(height/2)-(h/2);

		opt = "left=" + x + ", top=" + y + ", width=" + w + ", height=" + h;
		opt = opt + ", toolbar=no,location=no,directories=no,status=no,menubar=no";
		opt = opt + ",scrollbars=" + s;
		opt = opt + ",resizable=" + r;
		window.open(url, winname, opt);
	}

	/*****************************************************
	* <a href> 자바스크립트로 처리
	*****************************************************/
	function goUrl(tgz)
	{
		self.location.href = tgz
	}

	/*****************************************************
	* <a href> 자바스크립트로 처리 : 글쓰기 페이지에서 사용함.
	*****************************************************/
	function gotoUrl(tgz)
	{
		top.location.href = tgz
	}

	/*****************************************************
	* 게시물 주소복사
	* 수정 : 2006. 11. 03. (파이어폭스 지원)
	*****************************************************/
	function copy_source(tgz){

		var isFF = (navigator.userAgent.toUpperCase().indexOf('FIREFOX') != -1);
		if(isFF)
		{
			alert("해당 브라우저에서는 싸이TV 프로그램 링크 복사가 지원되지 않습니다.");
			return;
		}
		if (window.clipboardData) {
			var doc = eval(tgz).createTextRange();
			eval(tgz).select();
			doc.execCommand('copy');
			alert('게시물 주소가 클립보드에 복사되었습니다.');
		} else if (window.netscape) {
			// dit is belangrijk maar staat nergens duidelijk vermeld:
			// you have to sign the code to enable this, or see notes below
			try
			{
				netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
			}
			catch (e){
	//			alert(e);
			}

			// maak een interface naar het clipboard
			var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
			if (!clip) return;

			// maak een transferable
			var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
			if (!trans) return;

			// specificeer wat voor soort data we op willen halen; text in dit geval
			trans.addDataFlavor('text/unicode');

			// om de data uit de transferable te halen hebben we 2 nieuwe objecten nodig om het in op te slaan
			var str = new Object();
			var len = new Object();

			var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

			var copytext = eval(tgz).value;

			str.data = copytext;

			trans.setTransferData("text/unicode",str,copytext.length*2);

			var clipid=Components.interfaces.nsIClipboard;

			if (!clip) return false;

			clip.setData(trans,null,clipid.kGlobalClipboard);

			alert("게시물 주소가 클립보드에 복사되었습니다.");
		}

	}

	/*****************************************************
	* 게시판 댓글작성
	*****************************************************/
	function checkComment(b_Session,tgz,returnurl)
	{
		if (b_Session == 0)
		{
			if (confirm("로그인 하시겠습니까?"))
			{
				//document.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
			return false;
		}

		if (eval(tgz).comment.value == '')
		{
			alert('내용을 입력해주세요');
			eval(tgz).comment.focus();
			return false;
		}
		//eval(tgz).target = "chk_content";
		eval(tgz).submit();
	}


	/*****************************************************
	* 게시판 로그인 체크
	*****************************************************/
	function checkLogin(b_Session,tgz)
	{
		if (b_Session == 0){
			if(parent.frames.length > 0)
				redirect_login_parent(tgz);
			else
				redirect_login(tgz);
		} else {
			if(parent.frames.length > 0)
				parent.location.href=tgz;
			else
				document.location.href=tgz;
		}
	}

	/*****************************************************
	* 게시판 로그인 체크 confirm창 '취소'시 이동처리
	*****************************************************/
	function checkLogin2(b_Session,tgz)
	{
		if (b_Session == 0){
			if(parent.frames.length > 0)
				redirect_login_parent(tgz);
			else
				redirect_login(tgz);
		} else {
			if(parent.frames.length > 0)
				parent.location.href=tgz;
			else
				document.location.href=tgz;
		}
	}

	/*****************************************************
	* 게시판 로그인 체크 : Alert1
	*****************************************************/
	function checkLoginAlert(b_Session,returnurl)
	{
		if (b_Session == 0)
		{
			if (confirm("로그인 하시겠습니까?"))
			{
				//document.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
		}
	}

	/*****************************************************
	* 관심태그등록 로그인 체크 : Alert2
	*****************************************************/
	function checkLoginAlert2(b_Session,returnurl)
	{
		if (b_Session == 0)
		{
			if (confirm("로그인 하시겠습니까?"))
			{
				//document.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
			return false;
		}
		return true;
	}

	/*****************************************************
	* 게시판 댓글삭제
	*****************************************************/
	function deleteComment(c_Seq,BoardCode,subBoardCode,ItemSeq)
	{
		var cfm = confirm('삭제하시겠습니까?');

		if (cfm == true)
		{
			document.ProcForm.c_Seq.value = c_Seq;
			document.ProcForm.submit();
	//		HiddenForm.location.href='/Theme/Comment/CommentProcess.asp?c_Seq='+c_Seq+'&BoardCode='+BoardCode+'&subBoardCode='+subBoardCode+'&ItemSeq='+ItemSeq
		}
	}

	/*****************************************************
	* 게시판, 댓글 추천
	*****************************************************/
	function recommendItem(WorkingTag, b_Session,BoardCode,subBoardCode,ItemSeq,write_dt,c_Seq,returnurl, bbscode)
	{
		if (b_Session == 0)
		{
			//alert('로그인 하세요');
			if (confirm("로그인 하시겠습니까?")) {
				//document.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				//document.location.href =  "/video_login.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
			return false;
		}
		//if (tgz != ""){
		//	eval(tgz).location.href='act_recommend.asp?BoardCode='+BoardCode+'&subBoardCode='+subBoardCode+'&ItemSeq='+ItemSeq+'&write_dt='+write_dt+'&c_Seq='+c_Seq+'&WorkingTag='+WorkingTag
		//} else {
			HiddenForm.location.href='/bbs/act_recommend.asp?BoardCode='+BoardCode+'&subBoardCode='+subBoardCode+'&ItemSeq='+ItemSeq+'&write_dt='+write_dt+'&c_Seq='+c_Seq+'&WorkingTag='+WorkingTag+'&BBSCode='+bbscode;
		//}
		//top.location.href='act_recommend.asp?BoardCode='+BoardCode+'&subBoardCode='+subBoardCode+'&ItemSeq='+ItemSeq+'&write_dt='+write_dt+'&c_Seq='+c_Seq+'&WorkingTag='+WorkingTag
	}

	/*****************************************************
	* 게시판, 댓글 신고
	*****************************************************/
	function singoItem(b_Session,tgz,BoardCode,subBoardCode,ItemSeq,Report_tid,c_Seq,returnurl, bbscode)
	//function singoItem(tgz)
	{
		if (b_Session == 0)
		{
			//alert('로그인 하세요');
			if (confirm("로그인 하시겠습니까?")) {
				//document.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
			return;
		}

		HiddenForm.location.href='/bbs/singo_check.asp?tgz='+tgz+'&BoardCode='+BoardCode+'&subBoardCode='+subBoardCode+'&ItemSeq='+ItemSeq+'&Report_tid='+Report_tid+'&c_Seq='+c_Seq+'&Report_reason=0&BBSCode='+bbscode;
		//top.location.href='singo_check.asp?tgz='+tgz+'&BoardCode='+BoardCode+'&subBoardCode='+subBoardCode+'&ItemSeq='+ItemSeq+'&Report_tid='+Report_tid+'&c_Seq='+c_Seq+'&Report_reason=0'
	}

	/*****************************************************
	* 신고팝업
	*****************************************************/
	function goSingo(tgz)
	{
		singo_win = window.open('/bbs/p_singo.asp','singo_win','width=400,height=340,resizable=0')
		eval(tgz).submit();
	}


	/*****************************************************
	* 스크랩(이벤트용)
	*****************************************************/
	function goEventScrap(b_Session,tid_type,tgz,returnurl)
	{
		if (b_Session == 0)
		{
			//alert('로그인 하세요');
			if (confirm("로그인 하시겠습니까?")) {
				//document.location.href =  "http://cyworld.com/main2/login_redirection.asp?redirection=http://tvon.nate.com" + escape(returnurl);
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
			return;
		}

		if (tid_type == '7')
		{
			alert('타운홈피로 스크랩 되지 않습니다');
			return;
		}
		scrap_win = window.open('/event/bboy/p_scrap.asp','scrap_win','width=400,height=300,resizable=0');

		eval(tgz).action = '/event/bboy/p_scrap.asp';
		eval(tgz).target = 'scrap_win';
		eval(tgz).submit();
	}

	/*****************************************************
	* 게시판 운영원칙 보기
	*****************************************************/
	function rule_view(){
		window.open('rule.asp','rule','width=518,height=570,scrollbars=yes,resizable=no');
	}

	/*****************************************************
	* 게시판 슬라이드 (과거URL)
	*****************************************************/

	function Slideopen(url,w,h){
		rid = url.split("rid=") ;
		openPopup('/news/etc/slide/slide_cy.asp?rid=' + rid[1] , '690', '650', 0, 0, 'slide') ;
	}


	/*****************************************************
	* 글쓰기 경고
	*****************************************************/

	function warning(){
		alert("현재 회원님은 이용약관 위반으로 글쓰기 기능이 제한되어 서비스를 이용하실 수 없는 상태입니다.   \n원활한 서비스 운영을 위한 부득이한 조치임을 양해하여 주시기 바랍니다.");

	}


	/*****************************************************
	* 기사내 링크버튼 처리용 2006.5.12 김도현
	*****************************************************/
	function viewNewsLink(url, title1, title2, code, popup) {
		if(code==1) {
			code = '' ;
			fontColor='5785D3' ;
		} else 	if(code==2) {
			bgcolor = 'BA5B8F' ;
			fontColor='BA5B8F' ;
		} else if(code==3)  {
			bgcolor = 'BA5B8F' ;
		}

		if (popup == 1)
			link = 'window.open(\'' + url +'\')' ;
		else
			link = 'location.href=\'' + url +'\'' ;

		strTag = '<table border="0" cellspacing="0" cellpadding="0" style="margin:10 0 15 0"><tr style=cursor:hand; onClick="'+link+'" ><td width="80"><img src="http://newsimg.nate.com/img/bta'+code+'_03.gif" width="80" height="33"></td><td background="http://newsimg.nate.com/img/bta'+code+'_04.gif" class="list_11b" style="padding:2 15 0 7"><font color="'+fontColor+'">['+ title1 + ']</font>' + title2 + '</td><td width="19"><img src="http://newsimg.nate.com/img/bta'+code+'_06.gif" width="19" height="33"></td></tr></table>'
		document.write(strTag) ;
	}

	/*****************************************************
	* 로그인 여부 확인 2006.8.2 이지혁
	*****************************************************/
	function getLoginSession() {
		var xmldom = new ActiveXObject("Microsoft.XMLDOM");
		xmldom.async = false;
		xmldom.load("/bbs/addInterestWriter.asp?WorkingTag=L");
		var nodeRoot = xmldom.documentElement;

		if (nodeRoot == null) {
			alert("다시 시도하여 주십시오.");
		} else {
			return nodeRoot.selectSingleNode("@iResultCode").nodeValue;
		}
	}

	/*****************************************************
	* 오른쪽 영역 레이어 선택 보기 2006.9.14 이지혁
	*****************************************************/
	function rightMenuCtl(intSel, tabmenu1, tabmenu2) {

		if (intSel == 2) {
			document.all[tabmenu1].style.display = "none";
			document.all[tabmenu2].style.display = "block";
		} else {
			document.all[tabmenu1].style.display = "block";
			document.all[tabmenu2].style.display = "none";
		}
	}


	/*****************************************************
	* 모바일 팝업창 2006.10.20 이지혁
	*****************************************************/
	function mobile_popup(writer_nm) {
		window.open("http://www.cyworld.com/main2/mobile/mbicon/mobile_gateway.asp?writer_nm="+writer_nm,"mobile","width=350,height=335,scrollbars=no,toolbar=no,resizable=yes,menubar=no");
	}


	/*****************************************************
	* 타운 창 오픈 2006.11.2 김도현
	*****************************************************/

	function pimslink(boardtype, urlstr, board_no, item_seq, tid) {
		var strs = "http://town.cyworld.com/common/pims_hub.asp?urlstr="+ urlstr +"&boardtype="+ boardtype +"&board_no="+ board_no +"&item_seq="+ item_seq +"&tid="+ tid;
		window.open(strs,'person_info','height=538,width=932,scrollbars=no,resizable=yes');
	}  // board_no : 99 글쓰기


	/*****************************************************
	* 동영상 원본보기 팝업 2006.12.07 김태욱
	*****************************************************/
	function goOriginViewPopUp(strUrl, itype) {
		var sOp = "";

		//1:미니홈피, 2:클럽, 3:베이비, 4:광장, 5:타운(미니홈피), 6:스타(미니홈피)
		if (1 == itype || 5 == itype || 6 == itype || 0 == itype) {
			sOp = "height=538,width=932,scrollbars=no,resizable=yes";
		} else if (2 == itype) {
			sOp = "";
		} else if (3 == itype) {
			sOp = "width=932,height=538,scrollbars=no,resizable=no";
		} else if (4 == itype) {
			sOp = "";
		}
		window.open(strUrl, "", sOp);
	}

	/*****************************************************
	* 쪽지보내기
	*****************************************************/
	function goMemo(b_Session,tid_type,tgz,returnurl,copy_url,title)
	{
		if (b_Session == 0)
		{
			//alert('로그인 하세요');
			if (confirm("로그인 하시겠습니까?")) {
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
			return;
		}

		if (tid_type == '7')
		{
			alert('타운홈피로 스크랩 되지 않습니다');
			return;
		}
		scrap_win = window.open('/bbs/p_memo.asp?title='+title+'&copy_url='+copy_url,'memo_win','width=480,height=450,resizable=0');

		eval(tgz).action = '/bbs/p_memo.asp?title='+title+'&copy_url='+copy_url;
		eval(tgz).target = 'memo_win';
		eval(tgz).submit();

		//eval(tgz).action = '/bbs/p_scrap.asp';
		//eval(tgz).target = 'scrap_win';
	}



	/*****************************************************
	* 쪽지보내기 이벤트 2007. 08 .07 김남수
	*****************************************************/
	function goMemo_e(b_Session,tid_type,tgz,returnurl,copy_url,title,event_text)
	{
		if (b_Session == 0)
		{
			//alert('로그인 하세요');
			if (confirm("로그인 하시겠습니까?")) {
				document.location.replace("/video_login.asp?redirection="+ redirect_domain + escape(returnurl));
			}
			return;
		}

		if (tid_type == '7')
		{
			alert('타운홈피로 스크랩 되지 않습니다');
			return;
		}
		scrap_win = window.open('dummy.html','memo_win','width=480,height=450,resizable=0');

		eval(tgz).action = 'p_memo_e.asp?title='+title+'&copy_url='+copy_url+'&event_text='+event_text;
		eval(tgz).target = 'memo_win';
		eval(tgz).submit();

	}



	/*****************************************************
	* 수정하기 수정URL 지정
	*****************************************************/
	//function modifyBoardContent(b_Session, pagetype, bbscode, itemnum)
	function modifyBoardContent(b_Session, parameters)
	{
	//	target_url = "/bbs/videoModify.asp?PageType="+ pagetype +"&BBSCode="+ bbscode +"&ItemNum="+ itemnum
		target_url = "/bbs/videoModify.asp?" + parameters;

		checkLogin(b_Session, target_url);
	}



	function modifyBoardContent_20070628(b_Session, parameters)
	{
	//	target_url = "/bbs/videoModify.asp?PageType="+ pagetype +"&BBSCode="+ bbscode +"&ItemNum="+ itemnum
		target_url = "/bbs/videoModify_20070628.asp?" + parameters;

		checkLogin(b_Session, target_url);
	}

	/*****************************************************
	* Cookie Check
	*****************************************************/
	function getCookie_section(name) {
		var search = name + "=";

		if (document.cookie.length > 0) {
			offset = document.cookie.indexOf(search);
			if (offset != -1) {
				offset += search.length;
				end = document.cookie.indexOf(";", offset);
				if (end == -1) end = document.cookie.length;
				return unescape(document.cookie.substring(offset, end));
			}
			else return false;
		}

		else return false;
	}

	/*****************************************************
	* Cookie Setting
	*****************************************************/
	function setCookie_section(name, value)
	{
		//var todayDate = new Date();
		//todayDate.setDate( todayDate.getDate() + expiredays );
		//todayDate.setHours(0);
		//todayDate.setMinutes(0);
		//todayDate.setSeconds(0);
		document.cookie = name + "=" + escape( value ) + "; path=/;";
	}

	/*****************************************************
	* 2007어워드 이벤트 Cookie 체크하여 스탬프 팝업띄우기
	*****************************************************/
	function AwardStampPopup(event_action)
	{
		try
		{
			var cookie_stamp = getCookie_section("award_stamp");

			if(cookie_stamp == "1" || getTodayCut() >= 20080115)
			{
			}
			else
			{
				window.open("/popup/videoAwardInfo.asp?event_action="+ event_action, "award_pop", "width=10; height=10;");
			}
		}
		catch (e) {	}

	}

	/*****************************************************
	* 현재날짜 'YYYYMMDD' 형식으로 리턴
	*****************************************************/
	function getTodayCut()
	{
		var date_obj = new Date();

		var year_val  = date_obj.getYear() + "";
		var month_val = (date_obj.getMonth()+1) + "";
		var day_val	  = date_obj.getDate() + "";

		var date_cut = year_val + getDateCut(month_val) + getDateCut(day_val);

		return(parseInt(date_cut));
	}

	/*****************************************************
	* 월/일 앞에 "0" 붙여주기
	*****************************************************/
	function getDateCut(str)
	{
		var cut_date;
		if(str != null && str > 0)
		{
			str = "0" + str;
			cut_date = str.substring(str.length-2, str.length);
		}

		return cut_date;
	}

	function loginRedirect(redirection, type){
		if(type=='c'){ //current
			location.href = "/common/videoLogin?redirection="+escape(redirection);
		}else if(type=='p'){ //parent
			parent.location.href = "/common/videoLogin?redirection="+escape(redirection);
		}else if(type=='t'){ //top
			top.location.href = "/common/videoLogin?redirection="+escape(redirection);
		}
	}

	function person_info2(tid)
	{
		tid = String(tid);

		if (tid == '') {
			document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';

			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info_i','height=565,width=932,scrollbars=no,resizable=yes')};
		} else {
			document.cookie = 'MINIHP=tid' + '=; path=/;domain=cyworld.com';
			if(tid.substr(0,1) == "7")
			{	window.open('http://town.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
			else
			{	window.open('http://minihp.cyworld.com/pims/main/pims_main.asp?tid='+ tid ,'person_info','height=565,width=932,scrollbars=no,resizable=yes');}
		}
		return;
	}


	function babyHompy(sid){
	 	theUrl = "http://baby.cyworld.com/cyspoon/main/spoon_main.asp?sid=" + sid;
	 	window.open(theUrl,'','width=932,height=538,scrollbars=no,resizable=no');
	}

	//통화 형식으로 변환
	function currencyFormat(cVal){
		var str = cVal;
		var Re = /[^0-9]/g;
		var ReN = /(-?[0-9]+)([0-9]{3})/;

		str = str.replace(Re,'');

		while (ReN.test(str)) {
		str = str.replace(ReN, "$1,$2");
		}

			return str;
	}

	/*****************************************************
	* 스크랩
	*****************************************************/
	function goScrap(b_Session,tid_type,tgz,returnurl)
	{
		if (b_Session == 0)
		{
			if (confirm("로그인 하시겠습니까?")) {
					loginRedirect(returnurl,'c');
			}
			return;
		}

		if (tid_type == '7')
		{
			alert('타운홈피로 스크랩 되지 않습니다');
			return;
		}
		scrap_win = window.open('/clip/Scrap','scrap_win','width=400,height=300,resizable=0');

		eval(tgz).action = '/clip/Scrap';
		eval(tgz).target = 'scrap_win';
		eval(tgz).submit();

	}

	/*****************************************************
	* 스크랩 > 팝업 다시 submit없앰
	*****************************************************/
	function goScrap_v2(b_Session,tid_type,tgz,returnurl,video_seq,cy_id)
	{
		if (b_Session == 0)
		{
			if (confirm("로그인 하시겠습니까?")) {
					loginRedirect(returnurl,'c');
			}
			return;
		}
		if(cy_id>0){
			if (tid_type == '7')
			{
				alert('타운홈피로 스크랩 되지 않습니다');
				return;
			}
			scrap_win = window.open('/clip/ScrapV2?video_seq='+video_seq,'scrap_win','width=400,height=300,resizable=0');
		} else {

			//scrap_win = window.open('/popup/ScrapSso?r_url='+returnurl,'scrap_win','width=352,height=278,resizable=0');
			scrap_win = window.open('/common/ssoInterface?r_url='+returnurl,'scrap_win','width=510,height=480,resizable=0');
		}
	}
	/*****************************************************
	* 연동후 싸이월드 로그인 안했을경우 싸이월드자동 로그인 타도록
	*****************************************************/
	function goScrapBridge(b_Session,tid_type,tgz,returnurl,video_seq,cy_id)
	{
		scrap_win = window.open('','scrap_win','width=400,height=300,resizable=0');

		$("ssoForm").method="post";

		var r_url = "http://tvon.nate.com/clip/ScrapBridge?b_Session=" + b_Session + "&tid_type="+tid_type+"&tgz="+tgz+"&video_seq="+video_seq+"&cy_id="+cy_id+"&returnurl="+returnurl;
		document.ssoForm.r_url.value = r_url;

		$("ssoForm").action = "http://xso.nate.com/cysso/cysso.jsp";
		$("ssoForm").target = "scrap_win";

		$("ssoForm").submit();

	}

	/*****************************************************
	* 폰전송(컨버전스 게시물연동)
	*****************************************************/
	function goPhone(b_Session, itemseq, title, attach_url, returnurl)
	{
		if (b_Session == 0)
		{
			//alert('로그인 하세요');
			if (confirm("로그인 하시겠습니까?")) {
					loginRedirect(returnurl,'c');
			}
			return;
		}

		var popup_url = "http://www.cyworld.com/main2/mobile/mbicon/pop_video.asp?ItemSeq="+ itemseq +"&title="+ escape(title.replace(/</g,'&lt;').replace(/>/g,'&gt;')) +"&stillcut="+ attach_url;

	//	alert(popup_url);

		window.open(popup_url, 'phonesend_popup', 'width=400, height=750');
	}


   //글자수 제한

	function fnStrLenChk(obj, limit){
	    var temp;
	    var strcount;
	    strcount = 0;
	    len = obj.value.length;
	    for(k=0;k<len;k++){
		    strContent = obj.value.charAt(k);

		    if(escape(strContent).length > 4)
			    strcount += 2;
		    else
			    strcount++;
	    }
			if(strcount/2>limit){
				alert("내용은 한글 2500자, 영어 5000자까지 가능합니다.");
					if(escape(strContent).length > 4){
						obj.value = obj.value.substring(0,limit);
				    }else{
						obj.value = obj.value.substring(0,limit*2);
					}
					return;
			}else{
			//oldText = obj.value;
			//oldCount = strcount;
		}
		return strcount/2;
	}

	//메인 신규VOD
	function loadChannelNew(channel_id) {
	 var url = "/box/main/NewVod";
	 var pars = "channel_id="+channel_id;

	 try {
	  var myAjax = new Ajax.Request(url,
	  {
	     method: "get",
	     parameters: pars,
	     onSuccess: displayChannelNew
	    });
	 } catch(e) {
	  alert(e.description);
	 }
	}

	function displayChannelNew(originalRequest) {
	 var objDiv = document.getElementById("divNewVod");

	 if (objDiv != null) {
	  objDiv.innerHTML = originalRequest.responseText;
	 }
	 initPreview(['thumbListWrap2']);
	}

	//베스트 신규채널
	function loadLeftChannel(pid) {
	 var url = "/box/tvon/BestNewChannel";
	 var pars = "pid="+pid;

	 try {
	  var myAjax = new Ajax.Request(url,
	  {
	     method: "get",
	     parameters: pars,
	     onSuccess: displayChannel
	    });
	 } catch(e) {
	  alert(e.description);
	 }
	}

	function displayChannel(originalRequest) {
	 var objDiv = document.getElementById("listbox_channel");

	 if (objDiv != null) {
	  objDiv.innerHTML = originalRequest.responseText;
	 }
	}
	//인기 VOD 일간/주간/월간
	function loadLeftVod(order) {

	 var url = "/box/tvon/HotVOD";
	 var pars = "order="+order;

	 try {
	  var myAjax = new Ajax.Request(url,
	  {
	     method: "get",
	     parameters: pars,
	     onSuccess: displayVodList
	    });
	 } catch(e) {
	  alert(e.description);
	 }
	}

	function displayVodList(originalRequest) {
	 var objDiv = document.getElementById("listbox_vod");

	 if (objDiv != null) {
	  objDiv.innerHTML = originalRequest.responseText;
	 }
	}

	//싸이TV 메인 인기 VOD 일간/주간/월간
	function loadTvonVod(order) {

	 var url = "/box/tvon/MainVod";
	 var pars = "order="+order;

	 try {
	  var myAjax = new Ajax.Request(url,
	  {
	     method: "get",
	     parameters: pars,
	     onSuccess: displayVodMain
	    });
	 } catch(e) {
	  alert(e.description);
	 }
	}

	function displayVodMain(originalRequest) {
	 var objDiv = document.getElementById("mainbox_vod");

	 if (objDiv != null) {
	  objDiv.innerHTML = originalRequest.responseText;
	 }
	}

	//클릭 통계
	function vndr(pid,code)
	{
	 if( code != '' && code != null )
	 {
	  	ndrClick('', pid, code);
	 }
	}

	// NDRCLICK
	var ndrrid ;
	function ndrClick(url, pid, rid)
	{
		ndrpageid = pid;
		ndrregionid = rid; // ndrrid 는 전역값으로 넘어온다(각 SNB에서 생성)

		i = new Image();
		var statClick = "click_ndr.nate.com/??ndrpageid="+ ndrpageid +"&ndrregionid="+ ndrregionid;
		i.src = "http://statclick.nate.com/stat/statclick.tiff?cp_url=["+statClick+"]";
		if(url != "")
		{
			document.location.href=url;
		}
	}

	/*****************************************************
	* 싸이TV Plyer 실행시키기
	*****************************************************/
	function VODPlayer(channel_id, media_id, onair, redirect)
	{
		window.open("/tvon/VODPlayer?channel_id="+channel_id+"&media_id="+media_id+"&onair="+onair+"&redirect="+redirect, "popVOD", "width=415, height=340, resizable=no, scrollbars=no");
	}

	/*****************************************************
	* 티비온 네이트 이관 - 검색관련
	*****************************************************/
	function seclectSearch(num) {
		var searchObj = document.getElementById('searchWrap');
		var arrSelect = searchObj.getElementsByTagName('input');
	    if (num == "1") {
	        document.forms['search'].style.display = "block";
	        document.forms['search_section'].style.display = "none";
	        arrSelect[0].checked = "checked";
	        document.forms['search'].input_search.value = document.forms['search_section'].input_search.value;
	    } else {
	        document.forms['search'].style.display = "none";
	        document.forms['search_section'].style.display = "block";
	        arrSelect[5].checked = "checked";
	        document.forms['search_section'].input_search.value = document.forms['search'].input_search.value;
	    }
	}


	function selectView() {
		var selectObj = document.getElementById("search_layer");
	    if (selectObj.style.display == "block") {
	        selectObj.style.display = "none";
	    } else {
	        selectObj.style.display = "block";
	    }
	}

	function selectChg(obj){
	    document.getElementById("search_layer").style.display = "none";
	    document.getElementById("selectTxt").innerHTML = obj;
	    document.getElementById("selectTxt2").innerHTML = obj;
	}

	function Chgbg(obj, color) {
	    obj.style.backgroundColor = color;
	    return false;
	}