function Addme(UrlName,NetTitle){//加入收藏
	url = UrlName; //你自己的主页地址 
	title = NetTitle; //你自己的主页名称 
	window.external.AddFavorite(url,title); 
}

function Del(text,form)//确定后再删除
	{
		if (confirm(text))
		{
		form.submit();
		}
	}

function ConfirmDel(text)//确定后再删除
{
   if(confirm(text))
     return true;
   else
     return false;
	
}

/* admin_index_left.htm 点中后 */
function switchTab(tabpage,tabid){
var oItem = document.getElementById(tabpage).getElementsByTagName("a"); 
    for(var i=0; i<oItem.length; i++){
        var x = oItem[i];    
        x.className = "";
}
	document.getElementById(tabid).className = "Selected";
	/*var dvs=document.getElementById("cnt").getElementsByTagName("div");
	for (var i=0;i<dvs.length;i++){
	  if (dvs[i].id==('d'+tabid))
	    dvs[i].style.display='block';
	  else
  	  dvs[i].style.display='none';
	}*/
}
/*点中后结束 */

function menu(oblog){//显示/隐藏行
	if(oblog.style.display==''){
	oblog.style.display='none';
	}
	else {
	oblog.style.display='';
	}
}


function CheckAll(form)//全选
{
	for (var i = 0; i < form.elements.length; i++)
	{
		var e = form.elements[i];
			e.checked=true;
			//alert(e.value);
	}
}
function DelCheck(form)//取消全选
{
	for (var i = 0; i < form.elements.length; i++)
	{
		var e = form.elements[i];
			e.checked=false;
	}
}

function CheckItem(form){
	CheckButton="要执行的操作:<input type='button' value='全选' onclick='CheckAll(form)'>&nbsp;";
	CheckButton+="<input type='button' value='清空' onclick='DelCheck(form)'>";
	document.writeln(CheckButton);
}


function OpenTR(text,text1,id,id1)//显示/隐藏行
{
	  if(id.firstChild.innerHTML==text) 
	  {
	  id1.style.display='block';
	  id.firstChild.innerHTML=text1;
	  }
	   else 
	   {
	   id1.style.display='none';
	   id.firstChild.innerHTML=text;
	   }
}

oldLayer = 0;//单击显示隐藏层
function showdiv(el)
{
  whichEr = eval(el);
  if( oldLayer != "0" && oldLayer != whichEr ) 
  {
	   oldLayer.style.display = "none";
  }
  if( whichEr.style.display=="block" )
   { 
	   whichEr.style.display = "none";
   }
	//A.innerHTML="<img src='images/close.jpg'>";
  else 
  {
		whichEr.style.display="block";
		 oldLayer=whichEr;
	}
	//A.innerHTML="<img src='images/open.jpg'>";
}

function OpenWindow(url,winName,winWidth,winHeight)//打开自定义大小窗口
{
	//window.showModelessDialog(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight)
	//window.showModalDialog(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight)
	window.open(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight)
}

function OpenWindowSet(url,winName,winWidth,winHeight,left,top)//打开自定义大小窗口
{
	//window.showModelessDialog(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight)
	//window.showModalDialog(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight)
	window.open(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight+',left='+left+',top='+top)
}

function Open(url,winName,winWidth,winHeight)//打开自定义大小窗口
{
	//window.showModelessDialog(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight)
	//window.showModalDialog(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,width='+winWidth+',height='+winHeight)
	window.open(url,winName,'toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=yes,resizable=yes,width='+winWidth+',height='+winHeight)
}

function OpenModel(url,winWidth,winHeight)
{
	window.window.showModalDialog(url,'','toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=yes,resizable=no,DialogWidth='+winWidth+',DialogHeight='+winHeight)
}
function OpenModeless(url,winWidth,winHeight)
{
	window.window.showModelessDialog(url,'','toolbar=no,location=no,status=no,hidefocus=true,menubar=no,scrollbars=no,resizable=no,dialogWidth='+winWidth+',dialogHeight='+winHeight)
}

function openDel(text,url)//确定后再删除
	{
		if (confirm(text))
		{
		window.location=url;
		}
	}
	
function doZoom(size){//改变字体大小
	document.getElementById('zoom').style.fontSize=size+'px'
	//setTailPosition()
}
//图片自适应窗口大小
function imgResize(obj){
if (obj.width >= obj.height)
{
    if (obj.width > obj.parentElement.width)
    {obj.height = obj.height * (obj.parentElement.width/obj.width);
     obj.width = obj.parentElement.width;
     if (obj.height > obj.parentElement.height)
         {obj.width = obj.width * (obj.parentElement.height/obj.height);
          obj.height = obj.parentElement.height;}
     }
}
else if (obj.height > obj.parentElement.height)
      {obj.width = obj.width * (obj.parentElement.height/obj.height);
       obj.height = obj.parentElement.height;
       if (obj.width > obj.parentElement.width)
          {obj.height = obj.height * (obj.parentElement.width/obj.width);
           obj.width = obj.parentElement.width;}
       }
}


//正则表达式方法

function checkRate(input)
{
     var re = /^[0-9]+.?[0-9]*$/;   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/   
     if (!re.test(input.rate.value))
    {
        alert("请输入数字(例:0.02)");
        input.rate.focus();
        return false;
     }
}  


function BASEisNotNum(theNum)
{
//判断是否为数字
if (BASEtrim(theNum)=="")
return true;
for(var i=0;i<theNum.length;i++){
oneNum=theNum.substring(i,i+1);
if (oneNum<"0" || oneNum>"9")
return true;
}
return false;
}

function BASEisNotInt(theInt)
{
//判断是否为整数
theInt=BASEtrim(theInt);
if ((theInt.length>1 && theInt.substring(0,1)=="0") || BASEisNotNum(theInt)){
return true;
}
return false;
}

function BASEisNotFloat(theFloat)
{
//判断是否为浮点数
len=theFloat.length;
dotNum=0;
if (len==0)
return true;
for(var i=0;i<len;i++){
oneNum=theFloat.substring(i,i+1);
if (oneNum==".")
dotNum++;
if ( ((oneNum<"0" || oneNum>"9") && oneNum!=".") || dotNum>1)
return true;
}
if (len>1 && theFloat.substring(0,1)=="0"){
if (theFloat.substring(1,2)!=".")
return true;
}
return false;
} 

///
