
function check()
{
	if($("pubTime").value=="")
	{
		alert("发布时间不能为空！");
		$("pubTime").focus();
		return false
		
	}
	else
	{
		return true;
		
	}
	
}

 checkit   =   true;   
  function   SelectAllCheckBox()   
  {   
      aa   =   document.getElementsByTagName("input");   
      if   (checkit)   
      {   
      for   (i=0;i<aa.length;i++)   
        aa.item(i).checked=true;   
        checkit   =   false;   
      }   
      else   
      {   
      for   (i=0;i<aa.length;i++)   
        aa.item(i).checked=false;   
        checkit   =   true;   
      }   
  }   








//随页面上下滚动函数
<!-- 
function initAd(MenuLayer) { 
eval("document.all."+MenuLayer+".style.posTop = -200"); 
//设置onLoad事件激发以后，广告层相对于固定后的y方向位置 
eval("document.all."+MenuLayer+".style.visibility = 'visible'");//设置层为可见 
MoveLayer(MenuLayer);//调用函数MoveLayer() 
} 
function MoveLayer(layerName) { 
var x = 600;//浮动广告层固定于浏览器的x方向位置 
var y = 50;//浮动广告层固定于浏览器的y方向位置 
var diff = (document.body.scrollTop + y - document.all.Layer1.style.posTop)*0.94; 
var y = document.body.scrollTop + y - diff; 
eval("document.all." + layerName + ".style.posTop = y"); 
//eval("document.all." + layerName + ".style.posLeft = x");//移动广告层 
setTimeout("MoveLayer('"+layerName+"');", 20);//设置20毫秒后再调用函数MoveLayer() 
} 
//--> 












//等比例缩放图片
function DrawImage(ImgD,width,height){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= width/height){
     if(image.width>width){  
     ImgD.width=width;
     ImgD.height=(image.height*width)/image.width;
     }else{
     ImgD.width  =image.width;  
     ImgD.height =image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    else{
     if(image.height>height){  
     ImgD.height=height;
     ImgD.width=(image.width*height)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    }
   } 
   
function showhide(obj) 
{
	if (obj.style.display == 'block') 
	{
		obj.style.display = 'none';
	}
	else 
	{
		obj.style.display = 'block';
	}

}


function ShowHideTableWithCorrectStr(flagStr)
{
	var obj=document.getElementsByTagName("table")
	for(i in obj)
	{	
		//document.write(typeof(obj[i]));//.style.display="none";
		//document.write("table3".substring(0,5));
		var len=flagStr.length;
		if(i.substring(0,len)==flagStr)
			showhide(obj[i]);
			
			
	}
	
}


function DrawImage(ImgD,width,height){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= width/height){
     if(image.width>width){  
     ImgD.width=width;
     ImgD.height=(image.height*width)/image.width;
     }else{
     ImgD.width  =image.width;  
     ImgD.height =image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    else{
     if(image.height>height){  
     ImgD.height=height;
     ImgD.width=(image.width*height)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    }
   } 
   
	
	function ShowSelectImg(CommonIDstr,PicPreStr,index,LabelNum)
	{
		for(var i=1;i<=LabelNum;i++)
		{	
			picPath="images_1/";
			imgSrcA=picPath+PicPreStr+i+"_A.jpg";
			imgSrcB=picPath+PicPreStr+i+"_B.jpg";
			if(i==index)
				eval("document.all."+CommonIDstr+i+".src='"+imgSrcA+"'");
			else 
			{
				eval("document.all."+CommonIDstr+i+".src='"+imgSrcB+"'");
			}
			
		}
	
	}
	
	
function ShowSelectTable(CommonTablestr,index,TableNum)
	{
		for(var i=1;i<=TableNum;i++)
		{	
			if(i==index)
				eval("document.getElementById('"+CommonTablestr+i+"').style.display='inline'");
			else 
			{
				eval("document.getElementById('"+CommonTablestr+i+"').style.display='none'");
			}
			
		}
	
	}
	
function OpenFullSizeWindow(theURL,winName) {
    aNewWin = window.open(theURL,winName, "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=350,height=50");
    aNewWin.focus();
  }
  
  
function ShowImg(imgobj,url)
{

	//alert(url);
    imgobj.width=0;
    imgobj.height=0;
    imgobj.src="../../"+url;
	//显示图片预览
	if(url!="")
	{
		imgobj.style.visibility='visible';
		imgobj.style.position  ='static';
	}
	else
	{
		 imgobj.style.visibility='hidden';
		 imgobj.style.position  ='absolute';
	}
}


//加入收藏
function AddFavorite(sURL, sTitle)
{
    try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}

//设为首页
function SetHome(obj,url){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
                        }  
                        catch (e)  { 
                                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");  
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',url);
                 }
        }
}
