document.write ('<div id="showImage_container" style="display:none;"></div>');

function ResizeImgSub(imgObj, imgSize, imgResizeOpt)
{
	var intWidth = imgObj.width;
	var intHeight = imgObj.height;
	var intPercent;

	if (imgResizeOpt != null) {
		if (imgResizeOpt == 'h') {
			intPercent = imgSize / intHeight * 100;
			intWidth = Math.round (intWidth * intPercent / 100);
			intHeight = imgSize;
		}
		else if (imgResizeOpt == 'w') {
			intPercent = imgSize / intWidth * 100;
			intHeight = Math.round (intHeight * intPercent / 100);
			intWidth = imgSize;
		}
	}
	else {
		if (intWidth > imgSize || intHeight > imgSize) {
			if (intWidth > intHeight) {
				intPercent = imgSize / intWidth * 100;
				intHeight = Math.round (intHeight * intPercent / 100);
				intWidth = imgSize;
			}
			else {
				intPercent = imgSize / intHeight * 100;
				intWidth = Math.round (intWidth * intPercent / 100);
				intHeight = imgSize;
			}
		}
	}
	imgObj.visibleImgObj.width = intWidth;
	imgObj.visibleImgObj.height = intHeight;
}

function ResizeImg(imgObj, imgSize)
{
	var imgOriginal = new Image();
	var argv = ResizeImg.arguments;
	var argc = ResizeImg.arguments.length;
	var imgResizeOpt = (argc > 2) ? argv[2] : null;

	imgOriginal.visibleImgObj = imgObj;

	imgOriginal.onload = function() { ResizeImgSub(this, imgSize, imgResizeOpt); }
	imgOriginal.src = imgObj.src;
}

function BBSResizeImgSub(imgObj, imgSize)
{
	var intWidth = imgObj.width;
	var intHeight = imgObj.height;
	var intPercent;

	if (intWidth > imgSize) {
		intPercent = imgSize / intWidth * 100;
		intHeight = Math.round (intHeight * intPercent / 100);
		intWidth = imgSize;
	}
	imgObj.visibleImgObj.width = intWidth;
	imgObj.visibleImgObj.height = intHeight;
}

function BBSResizeImg(imgObj, imgSize)
{
	var imgOriginal = new Image();
	imgOriginal.visibleImgObj = imgObj;
	imgOriginal.onload = function() { BBSResizeImgSub(this, imgSize); }
	imgOriginal.src = imgObj.src;
}

/*
function OpenImage(imgRef)
{

	var strImage = '<div id="idOpenImage" style="position:absolute;z-index:202;left:50%;top:'+postop+';">';
	strImage += '<img src="'+imgRef+'" hspace="0" vspace="0" border="0" onclick="$(\'showImage_container\').hide();" style="cursor:pointer;">';
	strImage += '</div>';

	$('showImage_container').update(strImage);


	if ($('showImage_container').visibility == 'visible') $('showImage_container').visibility = 'hidden';
	$('showImage_container').show();

}
*/

function OpenImage(imgRef)
{
	var intWidth = 100;
	var intHeight = 100;
	var intX = Math.floor((screen.availWidth-(intWidth+12))/2);
	var intY = Math.floor((screen.availHeight-(intHeight+60))/2);

	var loadingMsg = "<table width='100%' height='100%'>";
	loadingMsg += "<tr><td valign='center' align='center'><font color='#FF6600' face='Verdana' style='font-size:8pt'>Now Loading...</font></td></tr>";
	loadingMsg += "</table>";

	with(window.open('','','height=' + intHeight + ',width=' + intWidth + ',top=' + intY + ',left=' + intX + ',scrollbars=yes,resizable=yes'))
	{
		document.write(
			"<html>",
			"<head>",
			"<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>",
			"<title>::: BIDBUY - 남다른 나를 위한 Global Agency :::</title>",
			"</head>",
			"<body topmargin=0 rightmargin=0 bottommargin=0 leftmargin=0>",
			loadingMsg,
			"<img src=\""+imgRef+"\" hspace='0' vspace='0' border='0' OnMouseDown=\"window.close();\" OnLoad=\"document.body.removeChild(document.body.children[0]);window.resizeTo(this.width+12,this.height+60);window.moveTo(Math.floor((screen.availWidth-(this.width+12))/2),Math.floor((screen.availHeight-(this.height+60))/2));\" alt='이미지를 클릭하시면 창이 닫힙니다.' style='cursor:hand;'>",
			"<table width='100%' border='0' cellpadding='0' celspacing='0' height='30'><tr><td style='font-family:돋움; font-size:8pt;' align='center'>이미지를 클릭하면 창이 닫힙니다.</td></tr></table>",
			"</body>",
			"</html>");
		focus();
	}
}


function errorImage( thisImg ) {
	thisImg.src = 'http://static.bidbuy.co.kr/mypage/mypage_noimg.gif';
	thisImg.width = 52;
}


function errorImage2( thisImg, thiswidth ) {
	thisImg.src = 'http://static.bidbuy.co.kr/mypage/mypage_noimg.gif';
	thisImg.width = thiswidth ;
}



function restore_img_src(name, nsdoc) {
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);

	if (name == '') return;

	if (img && img.altsrc) {
		img.src    = img.altsrc;
		img.altsrc = null;
	}
}

function change_img_src(name, nsdoc, rpath, preload) {
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);

	if (name == '') return;

	if (img) {
		img.altsrc = img.src;
		img.src    = rpath;
	}
}

function change_all_img_src(name, cknum, totnum, nsdoc, Frpath, ONrpath, Brpath) {
	var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name + cknum : 'document.all.'+name + cknum);
	var anoimg;
	var j ;

	if (name == '') return;

	for ( i = 1 ; i <= 12 ; i++)	{
		anoimg = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name + i : 'document.all.'+name + i);
		j = i ;
		if (i<10)	{ j = '0'+i ;	}

		if (i == cknum) {
			img.altsrc = img.src ;
			img.src    = Frpath + j + ONrpath + Brpath ;
		} else {
			anoimg.altsrc = img.src ;
			anoimg.src    = Frpath + j + Brpath ;
		}

	}
}