/* parse the entered query String */
function parseSearchQuery(theForm, message) {
	var queryValue = theForm.elements["query2"].value;
	var testValue = queryValue.replace(/ /g, "");
	if (testValue.length < 1) {
		alert(message);
		return (false);
	}
	theForm.elements["query"].value = queryValue;
	return (true);
}

function doZoom(size) {
    document.getElementById('zoom').style.fontSize=size+'pt';
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// ˵���� JavaScript ʵ����ҳͼƬ�ȱ������ 
function DrawImage(ImgD,FitWidth,FitHeight){
	var image=new Image();
	image.src=ImgD.src;
	
	if(image.width>0 && image.height>0){
		if(image.width/image.height>= FitWidth/FitHeight){
			if(image.width>FitWidth){
				ImgD.width=FitWidth;
				ImgD.height=(image.height*FitWidth)/image.width;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		} else{
			if(image.height>FitHeight){
				ImgD.height=FitHeight;
				ImgD.width=(image.width*FitHeight)/image.height;
				}else{
					ImgD.width=image.width;
					ImgD.height=image.height;
			}
		}
	}
}

var first = false;
function swapOnce(l1, l2){
	if(!first){
	var tmp = l1.innerHTML;
	l1.innerHTML = l2.innerHTML;
	l2.innerHTML = tmp;
	first = true;
	}
}

function swap(l1, l2){	
	var tmp = l1.innerHTML;
	l1.innerHTML = l2.innerHTML;
	l2.innerHTML = tmp;	
	first = false;
}
