// JavaScript Document
function CloseWindow(bNoneTip) {
	if (bNoneTip) {
		window.open('', '_self');
		window.close();
	} else
		window.close();
}

function setPagerRC(rc, ps, np, vs, cs) {
	var n = ps * np;
	var sn;
	if (rc == 0) {
		sn = '0';
	} else {
		sn = (n - ps + 1).toString();
		if (n > rc) n = rc;
		sn += '-' + n.toString();
	}
	
	document.write(rc.toString() + '&nbsp;' + vs + 'ÖÐµÄ&nbsp;' + sn + '&nbsp;' + cs);
}

function doProdSort(o) {
	var ms = '';
	if (o != 'default')
		ms = 'SortString=' + escape(o);
	var upString = document.location.search.substr(1);
	if (upString.length > 0) {
		var urlParams = upString.split('&');
		for (i=0 ; i <= urlParams.length-1; i++) {
			var aParam = urlParams[i].split('=');
			if (aParam[0] != 'SortString') {
				if (ms.length > 0) ms += '&';
				ms += aParam[0] + '=' + aParam[1];
			}
		}
	}
	if (ms.length > 0)
		window.location = '?' + ms;
	else
		window.location = document.location.pathname;
}

function doEnter() {
	if (event.keyCode == 13) {
		doSearch();
		return false;
	}
}


function renewplace(obj)
{ 
	diffY=document.body.scrollTop;
	percent=0.1*(diffY-lastScrollY);
	if(percent>0)
		percent=Math.ceil(percent);
	else
		percent=Math.floor(percent);
	obj.style.top += percent;
	//obj.style.left = document.body.scrollLeft+10;  
	lastScrollY = lastScrollY+percent;
}
