function gpage(url) {
	plist = getHttpRequest(url);

	pf = document.getElementById ("pagefield");
	pf.innerHTML = plist;
}

function toColor(obj) {
	var td = obj.parentNode;

	if ( obj.className == "thumb_mono") {
		obj.className = "thumb_color";
	} else { 
		obj.className = "thumb_mono";
	}
}

function viewOriginal(no) {
	var prvtag = document.getElementById("prvimg");
	var td = prvtag.parentNode;

	gallW = td.offsetWidth;

	hide.location.href = "/php/gallery/image_chg.php?no="+no+"&width="+gallW;
	prvtag.src = "/image/Nboy.jpg";

}

function imgErr(obj) {
	obj.width = 116;
	obj.height = 96;
	obj.src = "/image/Nboy.jpg";
	obj.alt = "섬네일 로딩을 실패한 이미지 입니다";
}


function PreviewUpload(obj) {
	filename = obj.value;

	dot = filename.lastIndexOf(".");
	len = filename.length;

	ext = filename.substr((dot+1), len);
	ext = ext.toLowerCase();

	if (ext == 'gif' || ext == 'jpg' || ext == 'png') {
		var prv = document.getElementById("preview");

		prv.src = obj.value;
	} else {
		window.alert ("파일 확장자는 GIF, JPG, PNG 세가지만 지원합니다");
		obj.value = "";
	}


}

function imgPrvErr(obj) {
	var fileform = document.getElementById ("InputUpload");


	window.alert ("브라우저가 이미지를 읽는데 실패 했습니다\n파일이 손상되었거나, 비정상적인 이미지입니다\n다른 이미지를 선택 해 주십시오");
	obj.src = "/image/Nboy.jpg"
}



function onpicture(no) {
	gall = getHttpRequest ("/php/gallery/gallery_view.php?idx=gallery&no="+no+"&access=ajax");

	gfield = document.getElementById ("gallery_change_here");
	gfield.innerHTML = gall;
}

function fnResize() {
	var imgs = document.getElementById("imgs");
	if (imgs.height > screen.availHeight) imgs.height = screen.availHeight - 48;
	if (imgs.width > screen.availWidth) imgs.width = screen.availWidth;
	

	if (window.dialogArguments) {
		window.dialogWidth = imgs.width+"px";
		window.dialogHeight = (imgs.height+48)+"px";
		window.dialogLeft = (screen.width/2) - (imgs.width/2)+"px";
		window.dialogTop = ((screen.availHeight/2) - (imgs.height/2)-24)+"px";
	} else {
		window.resizeTo (imgs.width, imgs.height);
		window.moveTo ((screen.width/2) - (imgs.width/2),((screen.availHeight/2) - (imgs.height/2)-24));
	}

	window.focus();

}