﻿var Invite_ToRight=1;

var Invite_ToBottom=1;


//说明：浮动图标的水平方向对齐方式，1为右对齐，0为左对齐；
var Invite_left=10;
//说明：浮动图标的水平方向的边距；

//说明：浮动图标的垂直方向对齐方式，1为底部对齐，0为顶部对齐；
var Invite_top=30;




//商务通设置

var LrinviteTimeout=0;
var LiveAutoInvite0='您好，来自%IP%的朋友';
var LiveAutoInvite1='来自首页的对话';
var LiveAutoInvite2='<P>您好!您是否有<FONT color=red>大便带血、便后疼痛、肛门出血、黏膜脱垂、肛门有脱出物、肛门瘙痒、肛门潮湿等症状？微创无痛，随治随走，无需住院。我来为您详细解答！咨询热线：010-52215221<BR></P>';//右下角弹出窗口

var LR_next_invite_seconds = 15; 

var $ = function(s){
    return document.getElementById(s);
};

var Class = {
    create : function () {
        return function () {
            this.initialize.apply(this, arguments);
        };
    }
};

var AutoScroll=Class.create();

AutoScroll.prototype.initialize=function(){
    this.obj=new Array();
};

AutoScroll.prototype.Build=function(){
    var me=this;
    this.box=arguments;
    for(var i=0;i<this.box.length;i++){
        $(this.box[i].id).style.position="absolute";
        this.obj.push({
            id:this.box[i].id,
            width:$(this.box[i].id).offsetWidth,
            height:$(this.box[i].id).offsetHeight,
            style:this.box[i].style
        });
    }
    window.onscroll=function(){
        this.common={
            t:document.documentElement.scrollTop,
            h:document.documentElement.clientHeight,
            w:document.documentElement.clientWidth
        };
        this.position=new Array();
        for(var i=0;i<me.box.length;i++){
            this.style=new Object();
            this.position[i]=[
                {x:0,y:this.common.t},
                {x:this.common.w-me.obj[i].width,y:this.common.t},
                {x:0,y:(this.common.h+this.common.t-me.obj[i].height)/2+(this.common.t)/2},
                {x:this.common.w-me.obj[i].width,y:(this.common.h+this.common.t-me.obj[i].height)/2+(this.common.t)/2},
                {x:0,y:this.common.h+this.common.t-me.obj[i].height},
                {x:this.common.w-me.obj[i].width,y:this.common.h+this.common.t-me.obj[i].height}
            ];
            this.style="object"==typeof me.obj[i].style?{x:me.obj[i].style.left,y:me.obj[i].style.top+this.common.t}:{x:this.position[i][me.obj[i].style].x,y:this.position[i][me.obj[i].style].y};
            $(me.obj[i].id).style.left=this.style.x+"px";
            $(me.obj[i].id).style.top=this.style.y+"px";
        }
    }
    this.start=window.scroll(1,1);
};

//document.getElementById('d1').style.display="none";


window.onload=function(){
  var d2=document.createElement('div');
  document.body.appendChild(d2);
  d2.id="d2";
  d2.className="d1";
 // d2.innerHTML='<IFRAME src="/online.aspx" id="popf" frameBorder=0 width=210 scrolling=no height=160></IFRAME>';
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=b_version.split(";"); 
	var trim_Version=version[1].replace(/[ ]/g,""); 
	if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0") 
	{ 
	  var a=new AutoScroll();
		a.Build(
		{id:"d2",style:1}
		);
	}
	


//	var bd=document.createElement('div');
//	document.body.appendChild(bd);
//	bd.id="bd";
//	bd.innerHTML='<a href="/zt/index.htm" target="_blank"><img src="/images/leftpic.jpg" alt="" /></a>';
//	bd.style.width="100px";
//	bd.style.height="300px";
//	bd.style.left="0";
//	bd.style.position="absolute";
//	 var b=new AutoScroll();
//	b.Build(
//	{id:"bd",style:0}
//	);

	
	//2009-5-7 字号、鼠标经过下划线
	if($('ContentBodyPart1')){
	makeline('ContentBodyPart1');
	var content=$('ContentBodyPart1');
	
	var fsize=document.createElement('div');
	fsize.id='fsize';
	fsize.style.textAlign="right";
	fsize.style.margin="5px 0";
	fsize.style.fontWeight="600";
	fsize.innerHTML='字号：<a href="javascript:changesize(\'s\')">小</a> <a href="javascript:changesize(\'m\')">中</a> <a href="javascript:changesize(\'b\')">大</a>';
	content.parentNode.insertBefore(fsize,content);
	}
	//字号完，鼠标完
}
	//2009-5-7 字号、鼠标经过下划线
function changesize(size){
	var content=$('ContentBodyPart1');
	if(content.getElementsByTagName('p')[0]){
		if(size=='s') content.getElementsByTagName('p')[0].style.fontSize="12px";
		if(size=='m') content.getElementsByTagName('p')[0].style.fontSize="14px";
		if(size=='b') content.getElementsByTagName('p')[0].style.fontSize="16px";
	}
	if(size=='s') content.style.fontSize="12px";
	if(size=='m') content.style.fontSize="14px";
	if(size=='b') content.style.fontSize="16px";
	makeline('ContentBodyPart1');
}
function GetCurrentStyle (obj, prop) {     //IE中使用的是obj.currentStyle方法，而FF是用的是getComputedStyle 方法
   if (obj.currentStyle) {     //判断IE
        return obj.currentStyle[prop];     
   }     
    else if (window.getComputedStyle) {     //判断FF 
        propprop = prop.replace (/([A-Z])/g, "-$1");           
       propprop = prop.toLowerCase ();        
         return document.defaultView.getComputedStyle (obj,null)[prop];     
    }      
    return null;   
}
window.onresize=function(){
makeline('ContentBodyPart1');
}
function makeline(tid){
//window.onload=function(){
	var change=$(tid);
	k=0;
	while(1){
		var tk="textline"+k.toString();
			if($(tk)){
			//try{
				$(tk).parentNode.removeChild($(tk));
			}
			else{
			//catch(e){
				break;
			}
		
		k++;
	}
	var num=0;
	var objHeight=change.offsetHeight;
	var objLineheight=GetCurrentStyle(change, 'lineHeight');
	var objMarginTop=GetCurrentStyle(change, 'marginTop');
	var objPaddingTop=GetCurrentStyle(change, 'paddingTop');
	var objMarginBottom=GetCurrentStyle(change, 'marginBottom');
	var objPaddingBottom=GetCurrentStyle(change, 'paddingBottom');
	//document.write(111);
	num=(objHeight)/objLineheight.toString().replace("px","");
	num=parseInt(num);
	for(i=0;i<num;i++){
		var textline=document.createElement('div');
		$(tid).appendChild(textline);
		textline.className="line";
		textline.id="textline"+i;
		textline.style.position="absolute";
		textline.style.right=0;
		textline.style.height=objLineheight.toString();
		var tmp=parseInt(objLineheight.toString().replace("px","")*i);
		
		var browser=navigator.appName;
		var b_version=navigator.appVersion;
		var version=b_version.split(";"); 
		var trim_Version=version[1].replace(/[ ]/g,""); 
		if(browser=="Microsoft Internet Explorer") 
		{ 
			tmp=tmp-8;
		}
		textline.style.top=tmp+"px";
		textline.onmouseover=function(){
			soh('textline',this.id,num);
		}
	}
}
function soh(name,tid,n){
	for(i=0;i<n;i++){
		var t=name+i;
		if(t==tid){
			$(t).style.borderBottom="1px dotted #0063DC";
		}else{
			$(t).style.border="none";
		}
	}
}
	//字号完，鼠标完

//google-e-
