<!-- °Ë»ö -->
document.domain='danawa.com';
var domain_bbs = "http://bbs.danawa.com";
var domain_blog = "http://blog.danawa.com";
var domain_img	= "http://img.danawa.com";

function divActionDisplay(no, sm)
{
	if(sm == "layer")
		var divname = "bookmark";
	else if(sm == "friend")
		var divname = "friend";
	else if(sm == "cate")
		var divname = "cate";

	var form = eval(document.getElementById( divname + no));

	if(form.style.display == "none")
	{

		form.style.display = "block";
		if(no != '')
		{
			var imgform = eval(document.getElementById("divimg"+no));
			imgform.src="http://img.danawa.com/blog/skin01/common/" + sm + "_-.gif";
		}
	}
	else
	{
		form.style.display = "none";
		if(no != '')
		{
			var imgform = eval(document.getElementById("divimg"+no));
			imgform.src="http://img.danawa.com/blog/skin01/common/" + sm + "_+.gif";
		}
	}
}



function favoriteView(seq)
{
	DivView('bookmark');
	FavoriteFrame.location.href= domain_blog + "/common/favorite.php?nBlogSeq="+seq;
}





function DivView(name)
{
	var form = document.getElementById(name);
	if(form.style.display == "none")
	{
		form.style.display = "block";
	}
	else
	{
		form.style.display = "none";
	}
}

function imgView(imgsrc)
{
	var imgwin = window.open(domain_blog + "/common/imgView.php?src=" + imgsrc,"imgView","resizable=yes, scrollbars=yes,width=100,height=100");
	imgwin.focus();
}

function trim(s)
{
	s = s.replace(/^\s*/,'').replace(/\s*$/, '');
	return s;
}

function goBlog(url)
{
	top.location.href=url;
}

function goBlogId(Id)
{
	if(Id != 0)
		top.location.href= domain_blog + "/"+Id;
	else
		return;
}
function goBlogBrand(sId)
{
	window.open(domain_blog + "/"+sId,'_blank','');
}


function logOut(url)
{
	location.replace("http://login.danawa.com/process_logout.php?url="+url);
}

function fncInvitePeo(nBlogSeq)
{
	var width=400;
	var height=230;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=no,resizable=yes,top="+posy+",left="+posx;
    window.open('/manage/pop_blog_people_invite.php?nBlogSeq='+nBlogSeq,'BlogPeople', position);
}

function cate_pop()
{
	var win = window.open(domain_blog + '/archive/search_cate_prod.php','pop_search','width=518, height=300, top=300, left=300, scrollbars=yes, status=yes');
	win.focus();
}

function getCateProd()
{
	var win = window.open(domain_blog + '/archive/search_cate_prod_multi.php','pop_search','width=518, height=300, top=300, left=300, scrollbars=yes, status=yes');
	win.focus();
}


function brandView(brand)
{
	location.href="/gallery.php?nGroup=5&sBrand="+brand;
}

function modelView(brand, model)
{
	location.href="/gallery.php?nGroup=5&sBrand="+brand+"&sModel="+model;
}

function dicaMakeView(cmpny_n)
{
	var win = window.open('http://pc.danawa.com/comindex_left.php3?dica=dica&kindc=CAA&typec=DIGITAL&sel_cmpny='+cmpny_n+'&zoomin=wide2','DicaMake','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450, height=700, top=10,left=100');
	win.focus();
}

function dicaModelView(prodc)
{
	pBlog(prodc);
	/*
	var win = window.open('http://pc.danawa.com/comindex_right.php3?kindc=CAA&typec=DIGITAL&codec='+prodc+'&dica=dica#explain','DicaModel','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=530, height=700, top=10,left=400');
	win.focus();
	*/
}


function goBlogCheck(id, mseq)
{
var win = window.open(domain_bbs + '/blog_move.php?sId='+id+'&nMebSeq='+mseq,'pop_link','width=400, height=250');
win.focus();
}

function fileAlertBox(cname, lengno)
{
	//document.write_form.file.outerHTML ='<input type=file name=fAttach size='"+lengno+"' onKeypress=\"fileAlertBox(cname, lengno);\">';
    alert('Ã·ºÎÆÄÀÏÀº Á÷Á¢ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù. ÆÄÀÏ¿¡¼­ ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.');
	fileAlertPress(cname, lengno);
}


function fileAlertPress(cname, lengno)
{
	attachFileRow.innerHTML = "";
	attachFileRow.innerHTML = "<input type='file' name='fAttach' onchange='LoadImg(this.value);' size='"+lengno+"' class='"+cname+"' onKeypress=fileAlertBox('"+cname+"','"+lengno+"');>";
}

// 2009.05.28 ÀÌ½Â¿¬ Ãß°¡
function fileAlertPressNew(fname, iname, cname, lengno)
{
	attachFileRow = eval("document." + fname + "." + iname);
	attachFileRow.innerHTML = "";
	attachFileRow.innerHTML = "<input type='file' name='fAttach' onchange='LoadImg(this.value);' size='"+lengno+"' class='"+cname+"' onKeypress=fileAlertBox('"+cname+"','"+lengno+"');>";
}

function fileAlertBoxNew(fname, iname, cname, lengno)
{
	attachFileRow = eval("document." + fname + "." + iname);
	attachFileRow.outerHTML = "<input type='file' name='fAttach' size='"+lengno+"' class='"+cname+"' onKeypress=fileAlertBoxNew('"+fname+"','"+iname+"','"+cname+"','"+lengno+"');>";
    alert('Ã·ºÎÆÄÀÏÀº Á÷Á¢ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù. ÆÄÀÏ¿¡¼­ ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.');

}

function fncViewNotice(nSeq)
{
	var width=700;
	var height=700;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=yes,resizable=no,top="+posy+",left="+posx;
    window.open(domain_bbs + '/view_notice.php?nSeq='+nSeq,'ViewNotice', position);
}

// ÀÌº¥Æ® ´çÃ· ÈÄ±â °Ô½ÃÆÇ °øÁö»çÇ×º¸±â
function fncViewNotice_event(nSeq)
{
	var width=700;
	var height=700;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=yes,resizable=no,top="+posy+",left="+posx;
    window.open(domain_bbs + '/view_notice_event.php?nSeq='+nSeq,'ViewNotice', position);
}

function fncSendNote(nSeq)
{
	var width=400;
	var height=300;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=no,resizable=no,top="+posy+",left="+posx;
    window.open(domain_blog + '/tnote/pop_tnote_send.php?nReceiver='+nSeq,'SendNote', position);
}

function fncComplaint_brand(nListSeq,nBlogCateSeq1)	//½Å°í±Û Ã³¸®
{
	var width=400;
	var height=350;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=no,resizable=yes,top="+posy+",left="+posx;
    window.open(domain_bbs + '/form_complaint.php?nListSeq='+nListSeq+'&nBlogCateSeq1='+nBlogCateSeq1,'CommentComplaint', position);
}

function fncComplaint_brand_com(nCommentSeq,nBlogCateSeq1)	//½Å°í ´ñ±Û Ã³¸®
{
	var width=400;
	var height=350;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=no,resizable=yes,top="+posy+",left="+posx;
    window.open(domain_bbs + '/form_complaint.php?nCommentSeq='+nCommentSeq+'&nBlogCateSeq1='+nBlogCateSeq1,'CommentComplaint', position);
}


function fncLoginCheck()
{
	alert("·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇØ ÁÖ¼¼¿ä.");
}

function fncViewNote()
{
	var width=467;
	var height=455;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=no,resizable=no,top="+posy+",left="+posx;
    window.open(domain_blog + '/tnote/','ViewNote', position);
}

function fncMakeBlog(seq)
{
	self.location.reload();
    window.open(domain_blog + '/manage/save_blog_info.php?sAction=newBlog&nMemberSeq='+seq,'_blank', '');
}
function fncViewPeople(seq)
{
    window.open(domain_blog + '/manage/form_blog_people.php?nBlogSeq='+seq,'_blank', '');
}

/**
 *	ºí·Î±× ÀÌµ¿
 *	--------------------------------------------------------------
 *	@param		string		var blogid		ÀÌµ¿ÇÏ°íÀÚ ÇÏ´Â ºí·¯±×
 *	@return		void
 *
 *	@desc		ÀÌµ¿ÇÏ°íÀÚ ÇÏ´Â ºí·Î±× ¾ÆÀÌµð¸¦ ³ÖÀ¸¸é »õ·Î¿î Ã¢À¸·Î ºÒ·Î±×¸¦ º¸¿©ÁØ´Ù.
 *	TODO : Áßº¹µÇ´Â Æã¼Ç ÀÖÀ¸¸é »èÁ¦ÇÏ½Ã±¸ Chris ¿¡°Ô ¾Ë·ÁÁÖ¼¼¿ä.
 */
function openBlog (blogid)
{
	if (typeof blogid == 'undefined') return;

    window.open(domain_blog + '/' + blogid, '_blank');
}

//ÀÌ´ÞÀÇ ¹è°æÈ­¸é
function wall_pop()
{
	var width=610;
	var height=750;
	var posx=0;
	var posy=0;

	position = "width="+width+",height="+height+",scrollbars=yes,top="+posy+",left="+posx;
	window.open('http://img.danawa.com/wall/wall.html','DanawaDica', position);
}


function comright_new(cate1, cate2, pcode)
{
	pBlog(pcode);
	/*var win = window.open('http://pc.danawa.com/price_right.html?cate1=' + cate1 + '&cate2='+cate2+'&pcode='+pcode,'viewprod','resizable=yes, scrollbars=yes,left=300,top=50,height=600,width=635');
	win.focus();
	*/
}


function fncViewInfo(memseq)
{
	var width=300;
	var height=200;
	var posx=100;
	var posy=100;
	position = "width="+width+",height="+height+",scrollbars=no,resizable=no,top="+posy+",left="+posx;
    window.open(domain_bbs + '/pop_user_info.php?nMebSeq='+memseq,'pop_link', position);
}


// ÃßÃµÇÏ±â(»ç¿ë±â) 2007.04.02 ³²¹Ì°æ
function recommend_New(LoginCk,nMemberSeq,nSeq,nGroup,nBlogCateSeq1,nBlogCateSeq2)
{
	if(!LoginCk)
	{
		alert("ÃßÃµÇÏ·Á¸é ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
	} else {
	    frmRecommend.location.href =  domain_blog + "/archive/recommend.php?nGroup="+nGroup+"&nBlogCateSeq1="+nBlogCateSeq1+"&nBlogCateSeq2="+nBlogCateSeq2+"&nSeq="+nSeq+"&nMemberSeq="+nMemberSeq+"&cDomain=PBrand";
	}//end if
}//end functiongi recommend_New(LoginCk,nMemberSeq,nSeq,nGroup,nBlogCateSeq1,nBlogCateSeq2)

// ³» ºí·Î±×¿¡ ´ã±â 2007.04.02 ³²¹Ì°æ
function scrap_New(LoginCk,nBlogSeq,nSeq,nGroup,nBlogCateSeq1)
{
	var width=400;
	var height=350;
	var posx=100;
	var posy=100;
	position = "width="+width+",height="+height+",scrollbars=no,resizable=no,top="+posy+",left="+posx;

	if(!LoginCk)
	{
		alert("½ºÅ©·¦À» ÇÏ·Á¸é ¸ÕÀú ·Î±×ÀÎ ÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
	} else {
		window.open(domain_blog +'/archive/form_scrap.php?nListSeq='+nSeq+'&nGroup='+nGroup+'&nBlogCateSeq1='+nBlogCateSeq1+'&nScrapSeq='+nSeq+'&nSzBlogSeq='+nBlogSeq,'pop_scrap_new',position);
	}//end if
}//end function scrap_New(LoginCk,nBlogSeq,nSeq,nGroup,nBlogCateSeq1)

// ±Û¾²±â ¸ðµå È£Ãâ 2007.04.02 ³²¹Ì°æ
function changeWrite_New(dvValue)
{
	if(dvValue == "N")
	{
		if(document.getElementById('divNamo').style.display == "none")
		{
			document.getElementById('divHtml').style.display="none";
			document.getElementById('divNamo').style.display="block";
			contentNamoGo_NEW();
		}//end if
	}else{
		if(divHtml.style.display == "none")
		{
			alert("¿¡µðÅÍ¿¡¼­ ÀÛ¾÷ÇÑ ³»¿ëÀÌ È£È¯µÇÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù.");
			document.getElementById('divHtml').style.display="block";
			document.getElementById('divNamo').style.display="none";
			contentHtmlGo_NEW();
		}//end if
	}//end if
}//end function

// ±Û¾²±â ¸ðµå È£Ãâ 2007.04.02 ³²¹Ì°æ

function contentHtmlGo_NEW()
{
	var wec		= document.wec;
	var object	= document.frmBlogSave;
	object.sDescmHtml.value = object.wec.BodyValue;
}//end function contentHtmlGo_NEW()

// ±Û¾²±â ¸ðµå È£Ãâ 2007.04.02 ³²¹Ì°æ
function contentNamoGo_NEW()
{
	var wec		= document.wec;
	alert('¿¡µðÅÍ·Î ÀüÈ¯½Ã ÅÂ±×°¡ È£È¯µÇÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù.');
	var object	= document.frmBlogSave;
	wec.BodyValue=object.sDescmHtml.value;
}//end function contentNamoGo_NEW()


// ÀÌ¹ÌÁö ÆË¾÷Ã¢ (¿©¼ººí·Î±×)
function open_Img(src)
{
	var imgContents = document.getElementsByName('image_content');
	for (i = 0; i < imgContents.length; i++)
	{
		var img = new Image();
		img.src = imgContents[i].src

		if(imgContents[i].src == src && img.width>660)
		{
			window.open(src) ;
		}//end if
	}//end for
}//end function open_Img(src)


// deeplink_n »õÃ¢¿­±â
function GoDeeplink(url)
{
	window.open(url, '_blank', '');
}//end function GoDeeplink(url)

// ÆË¾÷Ã¢ ¶ç¿ì±â 2008.02.20 ³²¹Ì°æ
function GoPopupLink(nWidth,nHeight,nPosx,nPosy,nUrl)
{
	nPosition = "width="+nWidth+",height="+nHeight+",scrollbars=yes,resizable=no,top="+nPosx+",left="+nPosy;
	window.open(nUrl,'GoPopupLink',nPosition);
}//end function GoPopupLink(nWidth,nHeight,nPosx,nPosy,nUrl)

// ½ºÅ©·Ñ ¹Ú½º Á¶°ÇÁÖ´Â ÆË¾÷Ã¢ ¶ç¿ì±â 2008.11.20 ÀÌ½Â¿¬
function setGoPopupLink(nWidth,nHeight,nPosx,nPosy,cScroll,cUrl) {
	nPosition = "width="+nWidth+",height="+nHeight+",scrollbars="+cScroll+",resizable=no,top="+nPosx+",left="+nPosy;
	window.open(cUrl,'GoPopupLink',nPosition);
}//end function setGoPopupLink(nWidth,nHeight,nPosx,nPosy,cScroll,cUrl)

// ÀÌ¹ÌÁö ¾øÀ»½Ã noimg °¡Á®¿À±â
function nBbsNoImage(img,size)
{
	var args = nBbsNoImage.arguments;
	switch (size)
	{
		case 50 : var altImg = domain_img + '/common/error/noimg_50x50.gif'; break;
		case 80 : var altImg = domain_img + '/common/error/noimg_80x80.gif'; break;
	}//end switch

	if (args[0].src == altImg)
	{
		args[0].onerror = null;
	} else {
		var imgWidth = args[1] ? args[1] : size;
		var imgHeight = args[2] ? args[2] : size;
		args[0].src = altImg;
		args[0].width = imgWidth;
		args[0].height = imgHeight;
	}//end if
}//end function nBbsNoImage(img,size)

