//popwin_type 10:确认后以popwin的参数10弹出窗口，如省略参数则在当前frame或窗口打开连接
function link_confirm(message,url,popwin_type)
{
if (confirm(message))
	{	
	if (popwin_type==10)
		{popwin(url,10);}
		else
		{window.location.href=url;}
	}
}

//验证字符串长度，中文为2字节
function strlen(str)
{
	var len;
	var i;
	len = 0;
	for (i=0;i<str.length;i++)
	{
	if (str.charCodeAt(i)>255) len+=2; else len++;
	}
	return len;
}


//功能介绍：检查是否为数字
//返回值：1为是数字，0为不是数字
function fucCheckNUM(NUM)
{
 var i,j,strTemp;
 strTemp="0123456789";
 if ( NUM.length== 0)
  return 0;
 for (i=0;i<NUM.length;i++)
 {
  j=strTemp.indexOf(NUM.charAt(i)); 
  if (j==-1)
  {
  //说明有字符不是数字
   return 0;
  }
 }
 //说明是数字
 return 1;
}





function popwin(url,popwin_type,popwin_width,popwin_height)

{
	switch(popwin_type)
	{
		case 1: //指定大小的window，toolbar，scrollbars
			fl="width=" + popwin_width + ",height=" + popwin_height + ",resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=no,location=no"
			break;
		
		case 2: //指定大小的window，toolbar
			fl="width=" + popwin_width + ",height=" + popwin_height + ",resizable=yes,scrollbars=no,status=no,toolbar=yes,menubar=no,location=no"
			break;

		case 3: //指定大小的window，scrollbars
			fl="width=" + popwin_width + ",height=" + popwin_height + ",resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no"
			break;

		case 4: //指定大小的window，none
			fl="width=" + popwin_width + ",height=" + popwin_height + ",resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,location=no"
			break;
											
		case 10: //临时窗口，无实际内容显示
			fl="width=1,height=1,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no"
			break;

		case 11: //发送留言弹出窗口
			fl="width=550,height=420,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=no,location=no"
			break;
			
		case 12: //发（看）评论弹出窗口
			fl="width=520,height=420,resizable=yes,scrollbars=yes,status=no,toolbar=yes,menubar=no,location=no"
			break;
					
	}
	
	
	window.open(url,"",fl);

}
