function JS_viewObj(objhtml) { 
    document.write(objhtml); 
} 

function ShowFlash(f,id,w,h,tr) {
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width="+w+" height="+h+" id='"+id+"'>");
	document.write("<param name='movie' value='"+f+"'>");
	document.write("<param name='quality' value='high'>");
	if(tr){
	document.write("<param name='wmode' value='transparent'>");
	}
	document.write("<embed src='"+f+"' quality='high' width="+w+" height="+h+" name='"+id+"' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'>");
	document.write("</object>");
}

function ViewPost(n) {
	document.BoardForm.number.value = n;
	document.BoardForm.mode.value = 'view';
	document.BoardForm.submit();
}

function ViewGallery(n,c,d) {
	var pop = 'contents/gallery.php?code='+c+'&number='+n+'&dir_i='+d;
	window.open(pop , 'gallery','width=870,height=700,resizable=yes,scrollbars=yes');
}

function WritePost() {
	document.BoardForm.mode.value = 'write';
	document.BoardForm.page.value = '';
	document.BoardForm.keyfield.value = '';
	document.BoardForm.key.value = '';
	document.BoardForm.submit();
}

function ModifyPost(n) {
	document.BoardForm.mode.value = 'modify';
	document.BoardForm.number.value = n;
	document.BoardForm.submit();
}

function MovePage(p) {
	if(p !=='') {
		document.BoardForm.page.value = p;
	} else {
		document.BoardForm.page.value = 1;
		document.BoardForm.keyfield.value = '';
		document.BoardForm.key.value = '';
	}
		document.BoardForm.mode.value = 'list';
		document.BoardForm.submit();
}


function DownloadFile(u) {
		var win = 'contents/download.php?u='+u;
		location.replace(win);
}


function ViewArticle(n,b,m,c,k,q) {
	
	if (k == 'gallery') 
	{
		var pop = 'contents/gallery.php?code='+c+'&mode='+m+'&number='+n+'&'+q;
		window.open(pop , 'gallery','width=870,height=700,resizable=yes,scrollbars=yes');
	} 	
	else if (k == 'download') 
	{
		var win = 'contents/download.php?u='+q;
		//location.replace(win);
		location.href = win;
	} 	
	else if (k == 'write') 
	{
		var win = b+'.php?mode='+m;
		//location.replace(win);
		location.href = win;
	}
	else if (k == 'list') 
	{
		var win = b+'.php';
		//location.replace(win);
		location.href = win;
	}	
	else	
	{
		var win = b+'.php?mode='+m+'&number='+n+'&'+q;
		//location.replace(win);
		location.href = win;

	}
}


function GotoPage(b,p,q) {
		var win = b+'.php?page='+p+'&'+q;
		location.replace(win);
}
