
function checkSecurity(obj)
{

if(top.document.all('frmright')==null){

obj.style.visibility="hidden";
alert("禁止该访问方式！");
window.location.href ="/index.jsp";

} 

}
function checkHeaderSecurity(obj,fm)
{
if(parent.document.all.hideForm==null){
fm.style.display="none";
alert("禁止该访问方式！");
fm.action="/index.jsp";
fm.submit();
}
}
function checkFootSecurity(obj,fm)
{

if(parent.document.all.topFrame==null){
fm.style.display="none";
alert("禁止该访问方式！");
fm.action="/index.jsp";
fm.submit();
}
}

function checkInput(obj){
if(isNaN(obj.value)|| obj.value<=0)
{alert("请输入正整数!");
obj.focus();
}
}

/*
**************************************************   
*函数名：checkStrLen   
*作  用：求字符串长度。汉字算两个字符，英文算一个字符。   
*参  数：value     ----要求长度的字符串   
*返回值：字符串长度   
***************************************************   
*/
function checkStrLen(value){
var str,Num = 0;
 for (var i=0;i<value.length;i++){
  str = value.substring(i,i+1);
  if (str<="~")  //判断是否双字节
   Num+=1;
  else
   Num+=2;
 }
 return Num;

}
