// JavaScript Document
var Switch = 1;  ////开关, 是否显示Notices    0不显示,1显示
/*
var href_text = 'http://medical.cetimes.com/';
////var content_text = '全新应用子网站<br>医疗电子网站现已上线啦！';
var content_text = '<br>&#x5168;&#x65B0;&#x5E94;&#x7528;&#x5B50;&#x7F51;&#x7AD9;<br>&#x533B;&#x7597;&#x7535;&#x5B50;&#x7F51;&#x7AD9;&#x73B0;&#x5DF2;&#x4E0A;&#x7EBF;&#x5566;&#xFF01;';
////var linker_text = '点击进入&gt;&gt;';
var linker_text = '&#x70B9;&#x51FB;&#x8FDB;&#x5165;&gt;&gt;';

//content_text=content_text.replace(/\\/gim, "\\\\").replace(/'/gim, "\\'").replace(/"/gim, '\\"');

var url = window.location.href.toLowerCase();
if(url.indexOf('medical.cetimes.com') > 0){
	href_text = 'http://member.cetimes.com/signup_2.asp';
	////content_text = '4月20号前注册成为医疗电子网站会员，有机会获得<b>第三届中国国际医疗电子技术大会CMET2010</b>免费门票。';
	content_text = '<br>4&#x6708;20&#x53F7;&#x524D;&#x6CE8;&#x518C;&#x6210;&#x4E3A;&#x533B;&#x7597;&#x7535;&#x5B50;&#x7F51;&#x7AD9;&#x4F1A;&#x5458;&#xFF0C;&#x6709;&#x673A;&#x4F1A;&#x83B7;&#x5F97;<b>&#x7B2C;&#x4E09;&#x5C4A;&#x4E2D;&#x56FD;&#x56FD;&#x9645;&#x533B;&#x7597;&#x7535;&#x5B50;&#x6280;&#x672F;&#x5927;&#x4F1A;CMET2010</b>&#x514D;&#x8D39;&#x95E8;&#x7968;&#x3002;';
	////linker_text = '点击注册医疗电子网站会员';
	linker_text = '&#x70B9;&#x51FB;&#x6CE8;&#x518C;&#x533B;&#x7597;&#x7535;&#x5B50;&#x7F51;&#x7AD9;&#x4F1A;&#x5458;';
}
*/
var AD_text = '';
//AD_text += '<A target=_blank id="PopupWin1aCnt" onMouseOver="this.style.textDecoration=\'underline\';" style="FONT:14px arial,sans-serif;COLOR:red;TEXT-DECORATION: none;" onmouseout="this.style.textDecoration=\'none\';" href="' + href_text + '">' + content_text + '<br> [' + linker_text + ']</A>';
AD_text += '<a href="http://www.cetimes.com/Category_498/Index.aspx" target=_blank><img src="http://www.cetimes.com/Ad/pdpm2010_subject.gif" border=0 /></a>';


var bottoms='bottom:10px;';
var cH= document.documentElement.clientHeight-160;
if(isIE()){
	//bottoms='top:expression(offsetParent.scrollTop+'+cH+');';
	bottoms='top:expression(offsetParent.scrollTop+scrollHeight*3);';
}

function isIE(){//ie
	if(window.navigator.userAgent.indexOf("MSIE")>=1)return true;
	return false;
}

		var PopupWin1oldonloadHndlr=window.onload, PopupWin1popupHgt, PopupWin1actualHgt, PopupWin1tmrId=-1, PopupWin1resetTimer;
        var PopupWin1titHgt, PopupWin1cntDelta, PopupWin1tmrHide=-1, PopupWin1hideAfter=22000;  //// PopupWin1hideAfter: 显示的时间长， 单位毫秒
		var PopupWin1hideAlpha, PopupWin1hasFilters=true;
        var PopupWin1nWin, PopupWin1showBy=null, PopupWin1dxTimer=-1, PopupWin1popupBottom, PopupWin1oldLeft;
        var PopupWin1nText,PopupWin1nMsg,PopupWin1nTitle,PopupWin1bChangeTexts=false;

        var PopupWin1oldonscrollHndr=window.onscroll;
        ////PopupWin1nText="<head><title>网站公告</title><style type=\"text/css\">body{background:#E0E9F8;padding:5px;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#FFE0E9F8', EndColorStr='#FFFFFFFF');}h1{font:bold 16px arial,sans-serif;color:#1F336B;text-align:center;margin:0px;}p{font:14px arial,sans-serif;color:#1F336B;}</style></head><body><h1>网站公告</h1><p>"+content_text+"</p></body>";

        function PopupWin1espopup_winScroll()
        {
          if (PopupWin1oldonscrollHndr!=null) PopupWin1oldonscrollHndr();
          if (PopupWin1tmrHide!=-1)
          {
            el=document.getElementById('PopupWin1');
            el.style.display='none'; el.style.display='block';
          }
        }

        function PopupWin1espopup_ShowPopup(show)
        {
          if (PopupWin1dxTimer!=-1) { el.filters.blendTrans.stop(); }

          if ((PopupWin1tmrHide!=-1) && ((show!=null) && (show==PopupWin1showBy)))
          {
            clearInterval(PopupWin1tmrHide);
            PopupWin1tmrHide=setInterval(PopupWin1espopup_tmrHideTimer,PopupWin1hideAfter);
            return;
          }
          if (PopupWin1tmrId!=-1) return;
          PopupWin1showBy=show;

          elCnt=document.getElementById('PopupWin1_content')
          elTit=document.getElementById('PopupWin1_header');
          el=document.getElementById('PopupWin1');
          el.style.left=PopupWin1oldLeft;
          el.style.top='';
          el.style.filter='';

          if (PopupWin1tmrHide!=-1) clearInterval(PopupWin1tmrHide); PopupWin1tmrHide=-1;

          document.getElementById('PopupWin1_header').style.display='none';
          document.getElementById('PopupWin1_content').style.display='none';

          if (navigator.userAgent.indexOf('Opera')!=-1)
            el.style.bottom=(document.body.scrollHeight*1-document.body.scrollTop*1
                            -document.body.offsetHeight*1+1*PopupWin1popupBottom)+'px';
          
          if (PopupWin1bChangeTexts)
          {
            PopupWin1bChangeTexts=false;
            //document.getElementById('PopupWin1aCnt').innerHTML=PopupWin1nMsg;
            document.getElementById('PopupWin1titleEl').innerHTML=PopupWin1nTitle;
          }

          PopupWin1actualHgt=0; el.style.height=PopupWin1actualHgt+'px';
          el.style.visibility='';
          if (!PopupWin1resetTimer) el.style.display='';
          PopupWin1tmrId=setInterval(PopupWin1espopup_tmrTimer,(PopupWin1resetTimer?1000:20));
        }

        function PopupWin1espopup_winLoad()
        {
          if (PopupWin1oldonloadHndlr!=null) PopupWin1oldonloadHndlr();

          elCnt=document.getElementById('PopupWin1_content')
          elTit=document.getElementById('PopupWin1_header');
          el=document.getElementById('PopupWin1');
					PopupWin1oldLeft=el.style.left;
          PopupWin1popupBottom=el.style.bottom.substr(0,el.style.bottom.length-2);
          
          PopupWin1titHgt=elTit.style.height.substr(0,elTit.style.height.length-2);
          PopupWin1popupHgt=el.style.height;
          PopupWin1popupHgt=PopupWin1popupHgt.substr(0,PopupWin1popupHgt.length-2); PopupWin1actualHgt=0;
          PopupWin1cntDelta=PopupWin1popupHgt-(elCnt.style.height.substr(0,elCnt.style.height.length-2));

          if (true)
          {
            PopupWin1resetTimer=true;
            PopupWin1espopup_ShowPopup(null);
          }
        }

        function PopupWin1espopup_tmrTimer()
        {
          el=document.getElementById('PopupWin1');
          if (PopupWin1resetTimer)
          {
            el.style.display='';
            clearInterval(PopupWin1tmrId); PopupWin1resetTimer=false;
            PopupWin1tmrId=setInterval(PopupWin1espopup_tmrTimer,20);
          }
          PopupWin1actualHgt+=5;
          if (PopupWin1actualHgt>=PopupWin1popupHgt)
          {
            PopupWin1actualHgt=PopupWin1popupHgt; clearInterval(PopupWin1tmrId); PopupWin1tmrId=-1;
            document.getElementById('PopupWin1_content').style.display='';
            if (PopupWin1hideAfter!=-1) PopupWin1tmrHide=setInterval(PopupWin1espopup_tmrHideTimer,PopupWin1hideAfter);
          }
          if (PopupWin1titHgt<PopupWin1actualHgt-6)
            document.getElementById('PopupWin1_header').style.display='';
          if ((PopupWin1actualHgt-PopupWin1cntDelta)>0)
          {
            elCnt=document.getElementById('PopupWin1_content')
            elCnt.style.display='';
            elCnt.style.height=(PopupWin1actualHgt-PopupWin1cntDelta)+'px';
          }
          el.style.height=PopupWin1actualHgt+'px';
        }
        
        function PopupWin1espopup_tmrHideTimer()
        {
          clearInterval(PopupWin1tmrHide); PopupWin1tmrHide=-1;
          el=document.getElementById('PopupWin1');
          if (PopupWin1hasFilters)
          {
            backCnt=document.getElementById('PopupWin1_content').innerHTML;
            backTit=document.getElementById('PopupWin1_header').innerHTML;
            document.getElementById('PopupWin1_content').innerHTML='';
            document.getElementById('PopupWin1_header').innerHTML='';
			
			if(!isIE()) PopupWin1espopup_Close();
			
            el.style.filter='blendTrans(duration=1)';
            el.filters.blendTrans.apply();
            el.style.visibility='hidden';
            el.filters.blendTrans.play();
            document.getElementById('PopupWin1_content').innerHTML=backCnt;
            document.getElementById('PopupWin1_header').innerHTML=backTit;
            
            PopupWin1dxTimer=setInterval(PopupWin1espopup_dxTimer, 1000);
          }
          else el.style.visibility='hidden';
        }
        
        function PopupWin1espopup_dxTimer()
        {
          clearInterval(PopupWin1dxTimer); PopupWin1dxTimer=-1;
        }
     
        function PopupWin1espopup_Close()
        {
          if (PopupWin1tmrId==-1)
          {
            el=document.getElementById('PopupWin1');
            el.style.filter='';
            el.style.display='none';
            if (PopupWin1tmrHide!=-1) clearInterval(PopupWin1tmrHide); PopupWin1tmrHide=-1;
            
          }
        }
    
//        function PopupWin1espopup_ShowWindow()
//        {
//          if (PopupWin1nWin!=null) PopupWin1nWin.close();
//          PopupWin1nWin=window.open('','PopupWin1nWin','width=400,height=250,scrollbars=yes, '+
//            'menubar=no, resizable=no, status=no, toolbar=no, location=no');
//          PopupWin1nWin.document.write(PopupWin1nText);
//        }

//        var PopupWin1mousemoveBack,PopupWin1mouseupBack;
//        var PopupWin1ofsX,PopupWin1ofsY;
//        function PopupWin1espopup_DragDrop(e)
//        {
//          PopupWin1mousemoveBack=document.body.onmousemove;
//          PopupWin1mouseupBack=document.body.onmouseup;
//          ox=(e.offsetX==null)?e.layerX:e.offsetX;
//          oy=(e.offsetY==null)?e.layerY:e.offsetY;
//          PopupWin1ofsX=ox; PopupWin1ofsY=oy;
//
//          document.body.onmousemove=PopupWin1espopup_DragDropMove;
//          document.body.onmouseup=PopupWin1espopup_DragDropStop;
//          if (PopupWin1tmrHide!=-1) clearInterval(PopupWin1tmrHide);
//        }
//
//        function PopupWin1espopup_DragDropMove(e)
//        {
//          el=document.getElementById('PopupWin1');          
//          if (e==null&&event!=null)
//          {
//            el.style.left=(event.clientX*1+document.body.scrollLeft-PopupWin1ofsX)+'px';
//            el.style.top=(event.clientY*1+document.body.scrollTop-PopupWin1ofsY)+'px';
//            event.cancelBubble=true;
//          }
//          else
//          {
//            el.style.left=(e.pageX*1-PopupWin1ofsX)+'px';
//            el.style.top=(e.pageY*1-PopupWin1ofsY)+'px';
//            e.cancelBubble=true;
//          }
//          if ((event.button&1)==0) PopupWin1espopup_DragDropStop();
//        }
//
//        function PopupWin1espopup_DragDropStop()
//        {
//          document.body.onmousemove=PopupWin1mousemoveBack;
//          document.body.onmouseup=PopupWin1mouseupBack;
//        }


var ih=115, iw=252;
if(!isIE()){ih=115; iw=252;}
var dstr='';
dstr+='\
<DIV align="left" onselectstart="return false;" id="PopupWin1" \
style="Z-INDEX:9999;DISPLAY:none;BORDER-RIGHT:#455690 1px solid;BORDER-TOP:#b9c9ef 1px solid;BACKGROUND:#e0e9f8;BORDER-LEFT:#b9c9ef 1px solid;BORDER-BOTTOM:#455690 1px solid;POSITION:absolute;RIGHT:15px;'+bottoms+'WIDTH:262px;HEIGHT:150px;">\
\
<DIV id="PopupWin1_header" \
style="DISPLAY: none; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=\'#FFE0E9F8\', EndColorStr=\'#FFFFFFFF\'); LEFT:2px;FONT:14px arial,sans-serif; WIDTH: 256px; CURSOR: default; COLOR: #1f336b; POSITION: absolute;TOP: 2px;HEIGHT:14px;TEXT-DECORATION: none;"><SPAN \
id="PopupWin1titleEl"><strong>&#x70ED;&#x70B9;&#x63A8;&#x8350;</strong></SPAN><SPAN onmousedown="event.cancelBubble=true;" onmouseover="this.style.color=\'#455690\';" style="RIGHT: 3px; FONT: bold 14px arial,sans-serif; CURSOR: pointer; COLOR: #728eb8; POSITION: absolute; TOP: 0px" onclick="PopupWin1espopup_Close();" \
onmouseout="this.style.color=\'#728EB8\';">X</SPAN></DIV>\
\
<DIV onmousedown="event.cancelBubble=true;" id="PopupWin1_content" \
style="BORDER-RIGHT: #b9c9ef 1px solid;PADDING-RIGHT:2px;BORDER-TOP:#728eb8 1px solid;DISPLAY:none;PADDING-LEFT:2px;BACKGROUND:#e0e9f8;FILTER:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=\'#FFE0E9F8\', EndColorStr=\'#FFFFFFFF\');PADDING-BOTTOM:2px;OVERFLOW:hidden;BORDER-LEFT: #728eb8 1px solid;PADDING-TOP: 10px;BORDER-BOTTOM:#b9c9ef 1px solid;POSITION:absolute;LEFT:2px;TOP:20px;HEIGHT:'+ih+'px;WIDTH:'+iw+'px;TEXT-ALIGN:center;">\
'+ AD_text +'\
</DIV>\
\
</DIV>\
';  ////javascript:PopupWin1espopup_ShowWindow();  //COLOR:#1f336b    网站公告   &#x7F51;&#x7AD9;&#x516C;&#x544A;       热点推荐  &#x70ED;&#x70B9;&#x63A8;&#x8350;

if(Switch)
{
	document.write(dstr);
	PopupWin1espopup_winLoad(); //window.onload=
	//window.onscroll=function(){var el=document.getElementById('PopupWin1');};
}
