// --------------------------------------------
// Image control function library
// developed by 飞鸟 @ dev-club.com
// 终于会用 PS 做页面切图了。感谢上帝
// --------------------------------------------

var aW=-1,aH=-1;
var Zx=1.0;

function imgLarger(img){

	if (aW==-1) {aW=img.width;aH=img.height}
	w=img.width;
    h=img.height
    if (w>800||h>600){
		// too larger ..do nothing
    }
    else{
		Zx=Zx*1.20;
		img.width=aW*Zx;
		img.height=aH*Zx;
    }
}

function imgSmaller(img){

	if (aW==-1) {aW=img.width;aH=img.height}
	w=img.width;
    h=img.height

    if (w<133||h<100){
		// too smaller ..do nothing
    }
    else{
		Zx=Zx/1.20;
		img.width=aW*Zx;
		img.height=aH*Zx;
    }    
}

function imgRestore(img){
	if (aW==-1) return;
	img.width=aW;
	img.height=aH;
	Zx=1.0;
}

function posImg(src,id){

var str='<TABLE WIDTH=82 BORDER=0 CELLPADDING=0 CELLSPACING=0>' + 
	'	<TR>' + 
	'		<TD COLSPAN=7>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_1.gif" WIDTH=82 HEIGHT=22 ALT=""></TD>' + 
	'	</TR>' + 
	'	<TR>' + 
	'		<TD ROWSPAN=2>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_2.gif" WIDTH=5 HEIGHT=21 ALT=""></TD>' + 
	'		<TD>' + 
	'			<A HREF="javascript:imgLarger(document.all[\x27image' + id + '\x27])"' + 
	'				ONMOUSEOVER="window.status=\x27放大图片\x27;  return true;"' + 
	'				ONMOUSEOUT="window.status=\x27\x27;  return true;">' + 
	'				<IMG SRC="/club/bbs/images/imageControl/IC1.gif" WIDTH=18 HEIGHT=16 BORDER=0 ALT="放大图片"></A></TD>' + 
	'		<TD ROWSPAN=2>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_4.gif" WIDTH=5 HEIGHT=21 ALT=""></TD>' + 
	'		<TD>' + 
	'			<A HREF="javascript:imgSmaller(document.all[\x27image' + id + '\x27])"' + 
	'				ONMOUSEOVER="window.status=\x27缩小图片\x27;  return true;"' + 
	'				ONMOUSEOUT="window.status=\x27\x27;  return true;">' + 
	'				<IMG SRC="/club/bbs/images/imageControl/IC2.gif" WIDTH=17 HEIGHT=16 BORDER=0 ALT="缩小图片"></A></TD>' + 
	'		<TD ROWSPAN=2>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_6.gif" WIDTH=14 HEIGHT=21 ALT=""></TD>' + 
	'		<TD>' + 
	'			<A HREF="javascript:imgRestore(document.all[\x27image' + id + '\x27])"' + 
	'				ONMOUSEOVER="window.status=\x27实际尺寸显示\x27;  return true;"' + 
	'				ONMOUSEOUT="window.status=\x27\x27;  return true;">' + 
	'				<IMG SRC="/club/bbs/images/imageControl/IC2-07.gif" WIDTH=15 HEIGHT=16 BORDER=0 ALT="实际尺寸显示"></A></TD>' + 
	'		<TD ROWSPAN=2>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_8.gif" WIDTH=8 HEIGHT=21 ALT=""></TD>' + 
	'	</TR>' + 
	'	<TR>' + 
	'		<TD>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_9.gif" WIDTH=18 HEIGHT=5 ALT=""></TD>' + 
	'		<TD>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_10.gif" WIDTH=17 HEIGHT=5 ALT=""></TD>' + 
	'		<TD>' + 
	'			<IMG SRC="/club/bbs/images/imageControl/ic_11.gif" WIDTH=15 HEIGHT=5 ALT=""></TD>' + 
	'	</TR>' + 
	'</TABLE>'
	if (document.all!=null) {document.write (str);}
	document.write('<br><img src="' + src + '" id=image' + id + ' style="filter:alpha(opacity=100);" >');
}