function smallit(){            
	var height1=PhotoViewer.images1.height;            
	var width1=PhotoViewer.images1.width;            
	PhotoViewer.images1.height=height1/1.2;            
	PhotoViewer.images1.width=width1/1.2;           
}             
          



function bigit(){            
	var height1=PhotoViewer.images1.height;            
	var width1=PhotoViewer.images1.width;            
	PhotoViewer.images1.height=height1*1.2;          
	PhotoViewer.images1.width=width1*1.2;           
}             
function fullit(newname)
{
	var width_s=screen.width-10;
	var height_s=screen.height-30;
	window.open(newname, "PhotoView", "width="+width_s+",height="+height_s+",left=0,top=0,location=no,toolbar=no,status=no,resizable=no,scrollbars=yes,menubar=no,directories=no");
}
function realsize()
{
	PhotoViewer.images1.height=PhotoViewer.images2.height;     
	PhotoViewer.images1.width=PhotoViewer.images2.width;
	PhotoViewer.images1.style.top=0;
	PhotoViewer.images1.style.left=0;
}
function featsize()
{
	var w;
	var h;
	picwidth=PhotoViewer.images2.offsetWidth;
	 
	picheight=PhotoViewer.images2.offsetHeight;
	picbl=picheight/picwidth;
	bodywidth=PhotoViewer.document.body.clientWidth;
	bodyheight=PhotoViewer.document.body.clientHeight;
	for(i=1;i<=picwidth;i++){
		w=i;
		h=i*picbl;
		if(w>=bodywidth||h>=bodyheight){
			break;
		}
	}
	PhotoViewer.images1.width=w;
	PhotoViewer.images1.height=h;
	PhotoViewer.images1.style.top=(bodyheight-h)/2;
	PhotoViewer.images1.style.left=(bodywidth-w)/2;
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
drag = 0
move = 0
function init() {
    window.document.onmousemove = mouseMove
    window.document.onmousedown = mouseDown
    window.document.onmouseup = mouseUp
    window.document.ondragstart = mouseStop
}
function mouseDown() {
    if (drag) {
        clickleft = window.event.x - parseInt(dragObj.style.left)
        clicktop = window.event.y - parseInt(dragObj.style.top)
        dragObj.style.zIndex += 1
        move = 1
    }
}
function mouseStop() {
    window.event.returnValue = false
}
function mouseMove() {
    if (move) {
        dragObj.style.left = window.event.x - clickleft
        dragObj.style.top = window.event.y - clicktop
    }
}
function mouseUp() {
    move = 0
}
var speed=5;
var k=0;
playid=null;
function playpic(){
    if(play.value=="开始播放" && photos.length>1){
		play.value="停止播放";
		plays();
    }else{
		play.value="开始播放";
		clearTimeout(playid);
    }
}
function plays(){
 
	if(k>=speed){
		if(curid==photos.length-1 && curid!=0){
			curid=0;
		}else{
			curid++;
		}
		 
		loadpics(photos[curid]);
		k=0;
		setjindu();
	}
	k++;
	playid=setTimeout("plays()",1000);
}
function  playnext  (){
	if(curid==photos.length-1 && curid!=0){
		    curid=0;
	}else{
		curid++;
	}
    
	loadpics(photos[curid]);
	k=0;
	setjindu();
}
function playprev(){
	if(curid==0 && curid!=photos.length-1){
		curid=photos.length-1;
	}else{
		curid--;
	}
	loadpics(photos[curid]);
	k=0;
	setjindu();
}
function show(){
	if(images1.filters.Alpha.opacity<100) {
		images1.filters.Alpha.opacity+=2;
		showid=setTimeout("show()",1);
	}else{
		clearTimeout(showid);
	}
}
function setjindu(){
  
	//  jindu.width=(curid+1)*580 / photos.length;
}
var flashid=-1;
function xiaoguo(fid){
	flashid=fid;
}
function loadpics(id){
	if(flashid=="-1"||flashid==undefined){
		var fids=Math.floor(Math.random() * 15);
	}else{
		var fids=flashid;
	}
	 
	  PhotoViewer.location.href="Photo_View.asp?flashid="+fids+"&ID="+id;
	//window.open("Photo_View.asp?x=x&flashid="+fids+"&ID="+id,"PhotoViewer");
}
function loadpic(){
var w;
var h;
 
picwidth=images2.offsetWidth;
 
picheight=images2.offsetHeight;
picbl=picheight/picwidth;
bodywidth=document.body.clientWidth;
bodyheight=document.body.clientHeight;
for(i=1;i<=picwidth;i++){
	w=i;
	h=i*picbl;
	if(w>=bodywidth||h>=bodyheight){
		break;
	}
}
images1.width=w;
images1.height=h;
images1.style.top=(bodyheight-h)/2;
images1.style.left=(bodywidth-w)/2;
//show();
images1.filters.Alpha.opacity=100;
}