 
 //去掉空格部分
function trim(str)
 {
	return str.replace(/(^\s*)|(\s*$)/g, ""); 
 }
 
 //JQUERY屏蔽页面
 function jqueryLEVEL(){
		var addUrlHtml = '<div class="hide_box">正在执行操作,请稍等……</div>';
		jQuery.blockUI({
    		message:addUrlHtml,
    		css:{
    			width:'350px' ,
    			height:'60px',
    			textAlign:'left',
				border:'2px solid #dddddd',
    			top:'60%',
    			left:'50%',
    			marginLeft:'-200px',
    			marginTop:'-50px',
    			cursor:'auto'
    		}
	  });
 //jQuery.unblockUI();
}
 
 
	 function checklogin(){
	     var username=document.getElementById("username").value;
	    if(trim(username)=="")
		{
				alert("请填写用户名！");
				return false;
		}
		 if(trim(document.getElementById("password").value)=="")
		{
				alert("请填写密码！");
				return false;
		}
  				$.ajax({
					url: '/pic/user?action=AjaxReplaceUrl', 
					type: 'POST',
					data:{username:username},
					dataType: 'html',
					timeout: 100000,
					error: function(){alert('操作失败');return false;},
					success: function(data){
									
					 
							if(data=='-1')
							{	
 									alert('对不起'+username+' 不存在此用户');
									return false;
	 
  							}else
  							{
  									//alert(data);
  								    document.loginform.action=data;
									document.loginform.submit();
								  	return true;
								     
  							} 
  					} 
					 
				});
			}


//显示指定的消息框
function countNumShowpanel(picname,flag,hiddenID){
   
   var messDiv =document.getElementById("countNumPanel");
 
   
		if(messDiv.style.display=="none")
		{
			$("#countNumPanel").show(400);
			var theRealTop=parseInt(document.body.scrollTop);
			var theRealLeft=parseInt(document.body.scrollLeft);
			//解决网页引用w3c标准时scrolltop属性失效的问题
			if(theRealTop==0){
				theRealTop=parseInt(document.documentElement.scrollTop);
			}
			if(theRealLeft==0){
				theRealLeft=parseInt(document.documentElement.scrollLeft);
			}

			 var old_x=parseInt(event.clientX);
			 var old_y=parseInt(event.clientY);
  
			  messDiv.style.top=old_y+theRealTop;
			 messDiv.style.left=old_x+theRealLeft; 
			
 		}
		else
		{
			messDiv.style.display="none";
		}
	}
 
 //计算图片搬家存储空间大小
function countNumTo()
{
var picmuch=document.getElementById("picmuch").value;
var piccount=document.getElementById("piccount").value;//原图名字后缀名
//var oldpicnameext=oldpicname.substr(oldpicname.lastIndexOf("."),oldpicname.length);
if(trim(picmuch)=="")
{
	alert("图片大小不能为空 ");
	return false;
}
 
if(trim(piccount)=="")
{
	alert("图片数量不能为空");
	return false;
}
if(isNaN(picmuch))
{
	 alert("图片大小必须是数字，请重新输入！");
	 return false;
 }
if(isNaN(piccount))
{
	alert("图片数量必须是数字，请重新输入");
	return false;  
}
 var lastval= Number((picmuch)*Number(piccount))/1024
document.getElementById("picSpace").value=(Math.round(lastval*100))/100;
//alert((Math.round(lastval*100))/100); 
 	 
}


