
/******View Page Function**************************************************************************************/
//Not Use But No Error
function GoDaumSearchForMovie(oQuery) {
	var ie = (document.all ? true : false);
	var sQuery = (ie)? encodeURI(oQuery.innerText) : oQuery.textContent;
	window.open("http://search.daum.net/cgi-bin/nsp/search.cgi?nil_profile=g&nil_Search=sugtop&sw=tot&q="+sQuery);
}

function GoDaumSearch(oQuery) {
	var ie = (document.all ? true : false);
	var sQuery = (ie)? encodeURI(oQuery.innerText) : oQuery.textContent;
	window.open("http://search.daum.net/cgi-bin/nsp/search.cgi?nil_profile=g&nil_Search=sugtop&sw=tot&q="+sQuery);
}

function GoMovieInfo(sCode) {
	window.open("http://movie.daum.net/movieInfo?mkey="+sCode);
}

function GoBookInfo(sCode) {
	window.open("http://book.daum.net/bookdetail/book.do?bookid="+sCode+"&viewType=desc");
}

function GoBookBuy(sCode) {
	window.open("http://daum.kyobobook.co.kr/cart/cartAdd.laf?barcode="+sCode.substring(3,sCode.length())+"&ejkGb="+sCode.substring(0,3)+"&qty=1");
}

function GoBestSellerAtBook(sUrl) {
	window.open(sUrl);
}
function GoTVInfo(sUrl) {
	window.open(sUrl);
}

function GoShoppingInfo(sCode) {
	window.open("http://shopping.daum.net/product/productdetail.daum?productid="+sCode+"&viewType=desc");
}

function GoOthersAtShopping(sUrl) {
	window.open(sUrl);
}

function GoBuyAtShopping(sUrl) {
	window.open(sUrl);
}

function realImgView(img) {
	PhotoImagePopup(BLOGID,img);
}

function PhotoImagePopup(blogid,imageurl) {
	imageurl = imageurl.replace("/image/", "/original/");
	var winObj = window.open("/_blog/photoImage.do?blogid="+blogid+"&imgurl="+imageurl, "b_img_viewer", "width=800px, height=744px, resizable=yes, scrollbars=yes");
	winObj.focus();
}

//첨부파일 미리보기
function fileFilterViewer_dc	(filePath, fileUrl, fileKeyno,  blogidu, articleno) {
	var url = "http://dc.cafe.daum.net/filefilter.html?u=";
	var blogurl = "http://blog.daum.net/_blog/filefilterViewer.do?filePath="+filePath;
	blogurl = blogurl  + "&fileUrl="+fileUrl;
	blogurl = blogurl  + "&fileKeyno="+fileKeyno;
	blogurl = blogurl  + "&blogid="+blogidu;	
	blogurl = blogurl  + "&articleno="+articleno;
	var winObjs = window.open(url+escape(blogurl), "filefilter_viewer", "scrollbars=0,status=0");
	winObjs.focus();	
}

function ShowOrgImage(oImg) {
	PhotoImagePopup(BLOGID, oImg.src);
}

function toggleMoreLess(obj) {
	var _elWrap = obj.parentNode.parentNode;
	if(!_elWrap.className) {
		return;
	}
	if(_elWrap.className.indexOf("txc-moreless-spread") > -1) {
		_elWrap.className = 'txc-moreless';
	} else {
		_elWrap.className = 'txc-moreless-spread';
	}
	var no = null;
	if(typeof contents_article_no != 'undefined' && parent.document.getElementById('if_b_' + contents_article_no)){
		no = contents_article_no;
	}else if(typeof articleno != 'undefined' && parent.document.getElementById('if_b_' + articleno)){
		no = articleno;
	}
	if(no != null){
		if(document.all){
			setTimeout(function() { parent.document.getElementById('if_b_' + no).style.height = document.body.scrollHeight + 'px'; }, 10);
		}
		else{
			parent.document.getElementById('if_b_' + no).style.height = document.body.offsetHeight + 'px';
		}
	}
}

function showFootnote(elLink){
	var temp = document.getElementById(elLink.id.replace(/footnote_link_/, "footnote_box_")).innerHTML;
	var tDiv = parent.document.getElementById('footnoteBox');
	tDiv.innerHTML = '<div class=\"txc-footnote-box\">' + temp + '<\/div>';
	tDiv.style.display = 'block';
	var contId = 'div_' + elLink.id.split("_")[2];
	contId = parent.document.getElementById(contId);
	tDiv.style.top = (parent.getAbsoluteTop(elLink) + parent.getAbsoluteTop(contId)) + 5 + 'px';
	tDiv.style.left = (parent.getAbsoluteLeft(elLink) + parent.getAbsoluteLeft(contId)) + 10 + 'px';
}
/*
function showFootnote(elLink){
	if(!elLink.id || elLink.id.indexOf("footnote_link_") < 0) {
		return;
	}
	var _elBox = document.getElementById(elLink.id.replace(/footnote_link_/, "footnote_box_"));
	if(!_elBox) {
		return;
	}
    _elBox.style.display = "block";
	var _pos = getAbsolutePos(elLink);
	
	var _docX =  (document.documentElement.clientWidth || document.body.clientWidth);
	var _docY = (document.documentElement.scrollHeight || document.body.scrollHeight);
	
	var _boxX = _pos.left;
	var _boxY = _pos.top;
	if(_pos.left > _docX/2) { //right
		_boxX -= 309 + 3;
		if(_pos.top > _docY - 200) { //예상 bot
			_boxY -= _elBox.offsetHeight;
			_elBox.className = "txc-footnote-box txc-footnote-box-rightbot";
		} else { //top
			_boxY += 5;
			_elBox.className = "txc-footnote-box txc-footnote-box-righttop";
		}
	} else { //left
		_boxX += 8;
		if(_pos.top > _docY - 200) { //예상 bot
			_boxY -= _elBox.offsetHeight;
			_elBox.className = "txc-footnote-box txc-footnote-box-leftbot";
		} else { //top
			_boxY += 5;
			_elBox.className = "txc-footnote-box txc-footnote-box-lefttop";
		}
	}
   	_elBox.style.top = _boxY + 'px';
    _elBox.style.left = _boxX + 'px';
}
*/

function hideFootnote(elLink){
	if(!elLink.id || elLink.id.indexOf("footnote_link_") < 0) {
		return;
	}
//	var _elBox = document.getElementById(elLink.id.replace(/footnote_link_/, "footnote_box_"));
	var _elBox = parent.document.getElementById('footnoteBox');
	if(!_elBox) {
		return;
	}
    _elBox.style.display = "none";
}

function getAbsolutePos(node){
	var _top = 0, _left = 0;
	while(node != null && (node.tagName.toUpperCase()!="BODY" || node.tagName.toUpperCase()!="HTML")) {
		_top += node.offsetTop;
		_left += node.offsetLeft;
		node = node.offsetParent;
	}
	return { top: _top, left: _left };
}

var UI = {};
UI.toolTip = function(){}

function goThemeLink() {
	this.target = "_blank";
	return true;
}

function blockContent(e){
	var e = window.event || e;
	if(e.preventDefault){ e.preventDefault(); }
	if(e.stopPropagation){ e.stopPropagation(); }
	e.returnValue=false;
	e.cancelBubble=true;
}
