$(function() {
    $('.jquery-notes').jQueryNotes({
	minWidth: 50,
	minHeight: 50,
	aspectRatio: false,
	allowLink: false,
	allowEdit: false,
	allowDelete: false,
	dateFormat: 'Y/M/D H:I',
	maxNotes: 10,
	operator: 'jquery-notes/jquery-notes_php/notes.php'
    });
});

function killErrors() {
	return true;
}

window.onerror = killErrors;

//按比例缩放图片
function WindsPhotoResizeImage(objImage,maxWidth,maxHeight) {
try{
  if(maxWidth>0 && maxHeight>0){
   var objImg = $(objImage);
   var objImg = $(objImage);
   if(objImg.width()>maxWidth && objImg.width()>objImg.height() || objImg.height()==objImg.width()){
    objImg.width(maxWidth).css("cursor","pointer")
    objImg.height(objImg.height() / (objImg.width() / maxWidth)).css("cursor","pointer")
   }
  else if(objImg.height()>maxHeight && objImg.height()>objImg.width() || objImg.height()==objImg.width()){
    objImg.height(maxHeight).css("cursor","pointer")
    bjImg.width(objImg.width() / (objImg.height() / maxHeight)).css("cursor","pointer")
   }
  }
}catch(e){};
}

//检查上传表单
function CheckForm() {  
if ((document.upload.file0.value.length == 0) && (document.upload.url.value.length == 0)) {  
	alert("一个也没填?!");
	document.upload.file1.focus();
	return false;
}
document.getElementById('upupup').value = '上传中...';
document.getElementById('upupup').disabled=true;
return true;  
}

//键盘快捷键翻页
function ToPage(event){
	event = event ? event : (window.event ? window.event : null); 
	if (event.keyCode==37) location=prevpage
	if (event.keyCode==38) location=prevpage
	if (event.keyCode==39) location=nextpage
	if (event.keyCode==40) location=nextpage
}
