
    //关闭窗口
    function winclose()
    {
	    window.close();
    }

    function swapiamge(imgObj,imagePath)
    {
        imgObj.src = imagePath
    }    

    function winopen(urls,pwidth,pheight)
    {
      winstatus="unadorned:yes;scroll:auto;status:no;resizable:yes;dialogWidth:"+pwidth+"px;dialogHeight:"+pheight+"px;help:no";
     if (urls.indexOf('?')>0)
      urls=urls+'&temp='+Math.random();
     else
      urls=urls+'?temp='+Math.random();
       	  
      //alert(urls);
      re=showModalDialog(urls,window,winstatus);
      if(re) //刷新页面
         __doPostBack('fresh','')
      return;
    }
    
    function pick_day(strField)
	{
	    var nwinWidth,nwinHeight;
	    nwinWidth=418;
	    nwinHeight=352; 
		winstatus="unadorned:yes;scroll:no;status:no;center:yes;resizable:yes;dialogWidth:"+nwinWidth+"px;dialogHeight:"+nwinHeight+"px;help:no";
		showModalDialog('DatePicker.aspx?field=' + strField,window,winstatus);
	}	
	
	 //判断是否有CheckBox选中
    function ifCheckBoxChecked()
    {
        for (var i=0;i<document.form1.elements.length;i++)
        {
          var e = document.form1.elements[i];
          if (e.type.toUpperCase() == 'CHECKBOX')
            if (e.checked)
            return true;
        }
        alert('未选中任何复选框,请核对!')
        return false;
    }
    
    function ifCanDelete()
    {
        if (ifCheckBoxChecked())
          return confirm('删除记录后将不可恢复，确定要删除选定的记录吗?')
        else 
          return false;  
    }
    
    function ShowFlashImages(pics,links,texts)
    {
        setTime = 4;
        picWidth = 999;
        //picHeight = 329;
        picHeight = 180;
        textHeight = 1;
        strPics = pics;
        strLinks = links;
        strTexts = texts;
        textAlign = "left";
        swfHeight = picHeight + textHeight;

        var strResponse = "";
        strResponse += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ picWidth +'" height="'+ swfHeight +'">';
        strResponse += '<param name="movie" value="Control/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">';
        strResponse += '<param name="menu" value="false"><param name=wmode value="opaque">';
        strResponse += '<param name="FlashVars" value="pics='+ strPics +'&links='+ strLinks +'&texts='+ strTexts +'&borderwidth='+ picWidth +'&borderheight='+ picHeight +'&textheight='+ textHeight +'&text_align='+ textAlign +'&interval_time='+ setTime +'">';
        strResponse += '<embed src="Control/pixviewer.swf" wmode="opaque" FlashVars="pics='+ strPics +'&links='+ strLinks +'&texts='+ strTexts +'&borderwidth='+ picWidth +'&borderheight='+ picHeight +'&textheight='+ textHeight +'&text_align='+ textAlign +'&interval_time='+ setTime +'" menu="false" bgcolor="#ffffff" quality="high" width="'+ picWidth +'" height="'+ swfHeight +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
        strResponse += '</object>';
        document.write(strResponse);
   }
   
    function showflash(flashsrc,widthpx,heightpx)
    {
        var fStr = '';
        fStr += ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ widthpx +'" height="'+ heightpx +'">');
        fStr += ('<param name="movie" value="'+ flashsrc +'">');
        fStr += ('<param name="quality" value="high">');
        fStr += ('<param name="menu" value="false">');
        fStr += ('<param name="wmode" value="transparent">');
        fStr += ('<embed alt="flash player" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ widthpx +'" height="'+ heightpx +'">');
        fStr += ('</embed>');
        fStr += ('</object>');
        document.write(fStr);
    }
   
   function GetDateDay()
   {
         var day=""; 
         var month=""; 
         var ampm=""; 
         var ampmhour=""; 
         var myweekday=""; 
         var year=""; 
         mydate=new Date(); 
         myweekday=mydate.getDay(); 
         mymonth=mydate.getMonth()+1; 
         myday= mydate.getDate(); 
         myyear= mydate.getYear(); 
         year=(myyear > 200) ? myyear :1900+myyear; 
         if(myweekday == 0) 
         weekday=" 星期日 "; 
         else if(myweekday == 1) 
         weekday=" 星期一 "; 
         else if(myweekday == 2) 
         weekday=" 星期二 "; 
         else if(myweekday == 3) 
         weekday=" 星期三 "; 
         else if(myweekday == 4) 
         weekday=" 星期四 "; 
         else if(myweekday == 5) 
         weekday=" 星期五 "; 
         else if(myweekday == 6) 
         weekday=" 星期六 "; 
         document.write(year+"年"+mymonth+"月"+myday+"日 "+weekday); 
   }
   
   function menuFix() 
   {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),

"");
}
}
}
   
  
	


