	<!--
function scroll_pic(width,height,pics,links,texts,t_h){
	if(t_h == undefined) f_h = 0;
	var focus_width = width;
	var focus_height = height;
	var text_height = t_h;
	var swf_height = focus_height+text_height;
	
//	var pics='http://www.healdream.com/blog/upload/net/11.jpg|http://www.healdream.com/blog/upload/net/22.jpg|http://www.healdream.com/blog/upload/net/33.jpg|http://www.healdream.com/blog/upload/net/44.jpg|http://www.healdream.com/blog/upload/net/55.jpg|http://www.healdream.com/blog/upload/net/66.jpg'
//	var links='http://www.healdream.com/blog/upload/net/1.jpg|http://www.healdream.com/blog/upload/net/2.jpg|http://www.healdream.com/blog/upload/net/3.jpg|http://www.healdream.com/blog/upload/net/4.jpg|http://www.healdream.com/blog/upload/net/5.jpg|http://www.healdream.com/blog/upload/net/6.jpg,'
//	var texts='1郑杰|2消费电子|3广告位|4渠道|5渠道|6消费电子'
	
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" border="0" height="'+ swf_height +'">');
	document.write('<param name="allowScriptAccess" value="sameDomain">');
	document.write('<param name="movie" value="template/default/images/viewer.swf">');
	document.write('<param name="quality" value="high">');
//	document.write('<param name="bgcolor" value="#fff">');
//	document.write('<param name="border" value="0">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	document.write('<embed src="template/default/images/viewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#FFF" quality="high" border="0" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
	}	
	//-->

	//图片按比例缩放
var flag=false;
function DrawImage(ImgD,iwidth,iheight){
//	iwidth = 426;
//	iheight = 280;
	var image=new Image();
//var iwidth = 143; //定义允许图片宽度
//var iheight = 181; //定义允许图片高度
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= iwidth/iheight){
			if(image.width>iwidth){ 
				ImgD.width=iwidth;
				ImgD.height=(image.height*iwidth)/image.width;
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}

			ImgD.alt=image.width+"×"+image.height;
	}
	else{
		if(image.height>iheight){ 
			ImgD.height=iheight;
			ImgD.width=(image.width*iheight)/image.height; 
		}else{
			ImgD.width=image.width; 
			ImgD.height=image.height;
		}
		ImgD.alt=image.width+"×"+image.height;
	}
}
} 
//调用：<img src="图片" onload="javascript:DrawImage(this,w,h)">
//-->

//新开窗口
function openwin( url, winName, width, height,scroll){
	xposition=0; yposition=0;
	if(scroll == undefined) scroll = 1;
	if ((parseInt(navigator.appVersion) >= 4 ))
	{
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;
	}
	theproperty= "width=" + width + "," 
	+ "height=" + height + "," 
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=0,"
	+ "scrollbars="+scroll+","
	+ "status=0," 
	+ "titlebar=0,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + xposition + "," //仅适用于Netscape
	+ "screeny=" + yposition + "," //仅适用于Netscape
	+ "left=" + xposition + "," //IE
	+ "top=" + yposition; //IE 
	window.open( url,winName,theproperty );
}

function showpic(num,ext,folder,obj,_next){
	//alert(_next);
	if(_next>num || num==0 || ext=='' || folder=='' || obj==''){
		alert('已经没有了');
	}
	else{
		next = _next?_next:0;
		var less = num-next;
		var html = '';
		html += '<a href="javascript:;" onclick="showpic('+num+',\''+ext+'\',\''+folder+'\',\''+obj+'\','+(next!=num?next+1:0)+');">';
		html += '<img alt="下一张" src="/ftp/books/'+folder+'/'+next+'.'+ext+'" />';
		html += '</a>';
		html += '<p>';
		if(next!=0) html += '<a href="javascript:;" onclick="showpic('+num+',\''+ext+'\',\''+folder+'\',\''+obj+'\','+(next)+');">上一张</a>';
		if(next!=num) html += ' <a href="javascript:;" onclick="showpic('+num+',\''+ext+'\',\''+folder+'\',\''+obj+'\','+(next+1)+');">下一张</a>'
		if(next!=num) html += ' [还有'+less+'张]';
		html += '</p>';
		$(obj).html(html);
	}
}
