<!--
//显示/隐藏菜单层
function showHiddenLayer(obj,isShow,width) {
	obj.style.cssText="WIDTH: "+width+"px; VISIBILITY: "+isShow+"; CURSOR: hand; POSITION: absolute";
}


//弹出窗口
function onload_popwin(thiswidth,thisheight,thisurl,thisno,thissite) {
	if (typeof(thissite)=='undefined') { thissite=0 }
	var thisleft=0,thistop=0;
	switch ( thissite ) {
		case 0:	//居中位置
			thisleft=(screen.width-thiswidth)/2;
			thistop=(screen.height-thisheight)/2;
			break;
		case 1:	//左上角
			thisleft=0;
			thistop=0;
			break;
		case 2:	//右上角
			thisleft=screen.width-thiswidth-10;
			thistop=0;
			break;
		case 3:	//左下角
			thisleft=0;
			thistop=screen.height-thisheight-30;
			break;
		case 4:	//右下角
			thisleft=screen.width-thiswidth-10;
			thistop=screen.height-thisheight-30;
			break;
	}
	var kkk=window.open(thisurl,'jjonline_popwin'+thisno,'scrollbars=no,left='+thisleft+',top='+thistop+',width='+thiswidth+',height='+thisheight);
	kkk.focus();
}


//读写Cookie
function GetCookie (name) { 
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; 
	while (i < clen) {
		var j = i + alen; 
		if (document.cookie.substring(i, j) == arg) 
		return getCookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1; 
		if (i == 0) break; 
	} 
	return null;
}
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) 
	endstr = document.cookie.length; 
	return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie (name, value) { 
	var argv = SetCookie.arguments; 
	var argc = SetCookie.arguments.length; 
	var expires = (argc > 2) ? argv[2] : null; 
	var path = (argc > 3) ? argv[3] : null; 
	var domain = (argc > 4) ? argv[4] : null; 
	var secure = (argc > 5) ? argv[5] : false; 
	document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}
//读写Cookie


//计算字符串的长度，汉字算2
String.prototype.len=function() {
	return this.replace(/[^\x00-\xff]/g,"aa").length;
}


//检查是否空字符串
function isEmpty(s) {  
	return ((s == null) || (s.length == 0))
}

//检查是否含有空白字符，如空格，换行符
function isWhitespace (s) {  
  var whitespace = " \t\n\r";
  var i;
   for (i = 0; i < s.length; i++) {
       var c = s.charAt(i);
       if (whitespace.indexOf(c) >= 0) {
		  return true;
	   }
   }
   return false;
}

//要接受检查的字符串s中若含有bag中的任一字符，则返回该字符，否则返回空
function isCharsInBagEx (s, bag) {  
	var i,c;
	for (i = 0; i < s.length; i++) {
		c = s.charAt(i);
		if (bag.indexOf(c) > -1)
			return c;
	}
	return "";
}

//检查字符串s中的所有字符是否取自bag中定义的字符
function isCharsInBag (s, bag) {  
	var i;
	// Search through string's characters one by one.
	// If character is in bag, append to returnString.

	for (i = 0; i < s.length; i++) {
		// Check that current character isn't whitespace.
		var c = s.charAt(i);
		if (bag.indexOf(c) == -1) return false;
	}
	return true;
}

function onlyNum() { //在input域中加入：onkeydown="onlyNum();"
	if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
	//考虑小键盘上的数字键
	event.returnValue=false;
}


//使用鼠标滚轮缩放图片
function bbimg(o) {
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}
//-->

