function showpic(picurl,picwidth,picheight)
{
 var iHeight;
 var iWidth;
 
    iWidth = picwidth;
    iHeight = picheight;
    if(iWidth >700) 
    {
       iWidth=700;
       iHeight=iHeight*iWidth/picwidth;
    }
    
    if(iHeight >500) 
    {
       iHeight=500;
       iWidth=picwidth*iHeight/picheight;
    } 
     
    
   var newurl="<img src='"+picurl + "' width="+iWidth +" height="+iHeight +" border=1>";
     document.write(newurl);
}
function scckf(){
	document.all.scck.style.top=(document.body.clientHeight-400)/2+document.body.scrollTop;
	document.all.scck.style.left=(document.body.clientWidth-315)/2;
	document.all.scck.style.display='block';
	}
	
	var hassubmit=0;
	function checkform(){
		if(hassubmit==1){
			alert("正在执行上传，请等待片刻！");
			return false;
		}
		hassubmit=1;
		return true;
	}
	
	var img=null;
	var jl="";
	function s(l)
	{
	jl=l;
	if(img)img.removeNode(true);
	img=document.createElement("img");
	img.style.position="absolute";
	img.style.visibility="hidden";
	img.attachEvent("onreadystatechange",orsc);
	img.attachEvent("onerror",oe);
	document.body.insertAdjacentElement("beforeend",img);
	var lll=eval("document.upload.all.filename"+l);
	img.src=lll.value;
	}
	function oe()
	{
	alert("调入图片错误，请重新选择。");
	}
	function orsc()
	{
	if(img.readyState!="complete")return false;
	var ll=eval("document.upload.all.photohight"+jl);
	ll.value=img.offsetHeight;
	ll=eval("document.upload.all.photowidth"+jl);
	ll.value=img.offsetWidth;
	}
	
	
	function piclist1(l){
	var i=1;
	piclist.innerHTML="";
	while(i<=l){
	piclist.innerHTML=piclist.innerHTML+"&nbsp;照片"+i+"、<input type='file' name='filename"+i+"' onchange=s('"+i+"') style='width:430px' size='20' class='inp2'><input type='hidden' name='photohight"+i+"' size='10'><input type='hidden' name='photowidth"+i+"' size='10'>";
	if(i<l){piclist.innerHTML=piclist.innerHTML+"<br>";}
	i=i+1;
	}
	}
function showimages(picurl,picwidth,picheight)
{
 var iHeight;
 var iWidth;
    iWidth = picwidth;
    iHeight = picheight;
    if(iWidth >120) 
    {
       iWidth=120;
       iHeight=iHeight*iWidth/picwidth;
    }
    
    if(iHeight >90) 
    {
       iHeight=90;
       iWidth=picwidth*iHeight/picheight;
    } 
   var newurl="<img src='"+picurl + "' width="+iWidth +" height="+iHeight +" border=0>";
     document.write(newurl);
}
function CheckAll(form)
{
  if(form.picid!=undefined)
  {
    if(form.picid.length!=undefined)
    {
      for (var i=0;i<form.picid.length;i++)    
        form.picid[i].checked = true;
    }
    else
        form.picid.checked = true;
  }
}

function UnCheckAll(form)
{
  if(form.picid!=undefined)
  {
    if(form.picid.length!=undefined)
    {
      for (var i=0;i<form.picid.length;i++)    
        form.picid[i].checked = false;
    }
    else
      form.picid.checked = false;      
  }
}

function jj(form){
if(form.picid!=undefined){
var j,h,isNull
j=0;
isNull=1;
h="";
	for(var i=0;i<form.picid.length;i++)
	 {
	     if (form.picid[i].checked==true)
		{
			  j++;
			  h=h + form.picid[i].value + ",";
		 }
		 isNull=0;
	  }
	  if (j==0&&isNull==0)
	  {
		   alert("必须在要删除的图片上标记！");
	  }else{
			if(j==0&&isNull==1){
						if(form.picid.checked==true){
						location.href="myphotoxcdel.asp?picid="+form.picid.value;
						 }else
    					  {alert("必须在要删除的图片上标记！");}
			}else{
             location.href="myphotoxcdel.asp?picid=" + h;
	        }
      }
}
}
function jjj(form){
if(form.picid!=undefined){
var j,h,isNull
j=0;
isNull=1;
h="";
	for(var i=0;i<form.picid.length;i++)
	 {
	     if (form.picid[i].checked==true)
		{
			  j++;
			  h=h + form.picid[i].value + ",";
		 }
		 isNull=0;
	  }
	  if (j==0&&isNull==0)
	  {
		   alert("必须在要移动的图片上标记！");
	  }else{
			if(j==0&&isNull==1){
						if(form.picid.checked==true){
						location.href="myphotoxcyd.asp?picid="+form.picid.value;
						 }else
    					  {alert("必须在要移动的图片上标记！");}
			}else{
             location.href="myphotoxcyd.asp?picid=" + h;
	        }
      }
}
}

function jjjj(form){
if(form.picid!=undefined){
var j,h,isNull
j=0;
isNull=1;
h=0;
	for(var i=0;i<form.picid.length;i++)
	 {
	     if (form.picid[i].checked==true)
		{
			  j++;
			  h=i;
		 }
		 isNull=0;
	  }
	  if (j==0&&isNull==0)
	  {
		   alert("必须在要设置的图片上标记！");
	  }else if (j>1) {
		    alert("只能在一张图片上做标记！");
	  }else{
			if(j==0&&isNull==1){
						if(form.picid.checked==true){       
                        location.href="myphotoxcbj.asp?id="+form.picid.value;
						 }else
    					  {alert("必须在要设置的图片上标记！");}
			}else{
             location.href="myphotoxcbj.asp?id="+form.picid[h].value;
	        }
      }
}
}

function addtoclip(m)
{
	n=m-1;
	//alert(document.piclist.text.length);
	for(i=0;i<document.piclist.text2.length;i++)
	{
		if (i==n)
		{
			
			text1=document.piclist.text2[n].value;
			//alert(text1);
			window.clipboardData.setData('text',"");
			window.clipboardData.setData('text',text1);
			alert("已经复制到剪切板！");
		}
		
	}
}