function GoBack()
{
	history.go(-1);
}

function GoToUrl(url)
{
	document.location = url;
}

function GoToPage(page)
{
	if(page === '')
	{
		GoToUrl('index.php');
	}
	else
	{
		GoToUrl('index.php?page=' + page);
	}
}

function DivMouseOver(divID)
{
	div_id		= $(divID);

	div_id.style.border	= "2px solid #789";
}

function DivMouseOut(divID)
{
	div_id		= $(divID);

	div_id.style.border	= "";
}
function DivMouseClick(ButtonID)
{
	button_id	= $(ButtonID);

	button_id.checked	="true";
}

// INPUT 박스에 Component의 Embed코드를 삽입함
function setComponentEmbedCode(obj, cid, width, height)
{
	var strEmbed = "";  

	strEmbed += '<object width="'+width+'" height="'+height+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">';
	strEmbed += '<param name="movie" value="http://showspace.co.kr/component/ShowSpace.swf?cid='+cid+'" />';
	strEmbed += '<param name="quality" value="high" />';
	strEmbed += '<param name="bgcolor" value="#ffffff" />';
	strEmbed += '<param name="allowScriptAccess" value="always" />';
	strEmbed += '<embed src="http://showspace.co.kr/component/ShowSpace.swf?cid='+cid+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="ShowSpace" align="middle" play="true" loop="false" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer">';
	strEmbed += '</embed>';
	strEmbed += '</object>';

	$(obj).value = strEmbed;
}

// INPUT 박스에 Component의 URL코드를 삽입함
function setComponentUrlCode(obj, cid)
{
	var strEmbed = "";  

	strEmbed += "http://showspace.com/";
	strEmbed += cid;

	$(obj).value = strEmbed;
}

// 클립보드로 복사하기
function copyToClipboard(obj, title) {

    if(Prototype.Browser.IE)
    {
        // IE일 경우 사용자에게 질문한 뒤 클립보드에 바로 복사
        var result = confirm('클립보드에 "' + title + '" 항목을 복사하시겠습니까?');

        if(result)
        {
            window.clipboardData.setData('Text', $(obj).value);

            alert(title + '가 클립보드로 복사되었습니다.');
        }
    }
    else
    {
        prompt(title + ' 입니다. Ctrl+C를 눌러 복사하신 뒤 이용하여 주십시오.', $(obj).value);
    }
}

var flen = 0;
function add_file(delete_code)
{

	var upload_count = 10;
	if (upload_count && flen >= upload_count-1)
	{
		alert("한번에"+upload_count+"개 까지만 파일 추가가 가능합니다.");
		return;
	}


	var objTbl;
	var objRow;
	var objCell;
	if (document.getElementById)
		objTbl = document.getElementById("table_photo_upload");
	else
		objTbl = document.all["table_photo_upload"];

	objRow = objTbl.insertRow(objTbl.rows.length);
	objCell = objRow.insertCell(0);

	flen++;

	objCell.innerHTML = '<table style="table-layout:fixed;"><col width="60px">		<col width="292px">		<col width="258px">		<tr>		<td style="text-align:right; padding-right:3px;">사진설명:</td>		<td style="text-align:right;"><input type="text" size="47" maxlength="30" name="DESCRIPTION'+ flen +'"></td>		<td></td>		</tr>		<tr>		<td style="text-align:right; padding-right:3px;">링크:</td>		<td style="text-align:right;"><input type="text" size="47" maxlength="30" name="LINK' + flen +'">		</td>		<td></td>		</tr>		<tr>		<td style="text-align:right; padding-right:3px;" >사진파일:</td>		<td style="text-align:left;" colspan="2"><input type="file" size="47" maxlength="30" name="FILE_PATH' + flen +'">		</td>		</tr>   		<tr>		<td>&nbsp;</td>		<td colspan="2"></td>		</tr>		<tr>		<td style="height:20px;">&nbsp;</td>		</tr>		<tr>		<td colspan="3" style="text-align:right;">		</td>		</tr>		<tr>		</table>'
}

function del_file()
{
	// file_length 이하로는 필드가 삭제되지 않아야 합니다.
	var file_length = -1;
	var objTbl = document.getElementById("table_photo_upload");
	if (objTbl.rows.length - 1 > file_length)
	{
		objTbl.deleteRow(objTbl.rows.length - 1);
		flen--;
	}
}

function album_pw_display() {
	var is_display	= $('Album_pw_style');
	var is_open		= $('ia_is_open3');

	if(is_open.checked)
	{
		is_display.style.display = 'block';
	}
	else
	{
		is_display.style.display = 'none';
	}
}
