﻿function Cookie(document, name, days, path, domain, secure) {
  this.$document = document;
  this.$name = name;
  if (days)
    this.$expiration = 
      new Date((new Date()).getTime() + days * 86400000);
  else this.$expiration = null;
  if (path)   this.$path   = path;   else this.$path   = null;
  if (domain) this.$domain = domain; else this.$domain = null;
  if (secure) this.$secure = true;   else this.$secure = false;
}

function _Cookie_store() {  
var cookieval = "";  
  for(var prop in this) { 
    if ((prop.charAt(0) == '$') || 
        ((typeof this[prop]) == 'function')) 
        continue;
    if (cookieval != "") cookieval += '&';
    cookieval += prop + ':' + escape(this[prop]);
  }

var cookie = this.$name + '=' + cookieval;
  if (this.$expiration)
      cookie += '; expires=' + this.$expiration.toGMTString();
  if (this.$path) cookie += '; path=' + this.$path;
  if (this.$domain) cookie += '; domain=' + this.$domain;
  if (this.$secure) cookie += '; secure';

  this.$document.cookie = cookie;  
}

function _Cookie_load() { 
var allcookies = this.$document.cookie;
  if (allcookies == "") return false;

 
  var start = allcookies.indexOf(this.$name + '=');
  if (start == -1) return false;   
  start += this.$name.length + 1; 
  var end = allcookies.indexOf(';', start);
  if (end == -1) end = allcookies.length;
  var cookieval = allcookies.substring(start, end);


var a = cookieval.split('&');     
  for(var i=0; i < a.length; i++)  
      a[i] = a[i].split(':');

  for(var i = 0; i < a.length; i++) {
    this[a[i][0]] = unescape(a[i][1]);
  }

  return true;
}

function _Cookie_remove() {  
var cookie;
  cookie = this.$name + '=';
  if (this.$path) cookie += '; path=' + this.$path;
  if (this.$domain) cookie += '; domain=' + this.$domain;
  cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';

  this.$document.cookie = cookie; 
}

Cookie.prototype.store  = _Cookie_store;  
Cookie.prototype.load   = _Cookie_load;
Cookie.prototype.remove = _Cookie_remove;

function getHost(){
	var href = window.location.href;
	var reg = new RegExp("http://(\\w+)\\.whrenai\\.com","ig");
	reg.exec(href);
	return RegExp.$1;
}



	document.writeln("<style>");
	document.writeln("body,td,th{font-size: 12px;}");
	document.writeln("ul,li{float:left;padding:0; margin:0; list-style:none;}");
	document.writeln("img{border:none;}");
	document.writeln(".minbox a,.maxbox a{color:#069; text-decoration:none;}");
	document.writeln(".minbox a:hover,.maxbox a:hover{color:#f60; text-decoration:underline;}");
	document.writeln(".minbox{width:145px; height:65px; background:url(http://images.whrenai.com/zixun/images/boxbg.gif) no-repeat 0 -85px; display:none;}");
	document.writeln(".minbox .title{float:left;width:85px; height:16px; padding:4px 0 0 20px; color:#fff;}");
	document.writeln(".btn_close{float:right;width:20px; height:20px;background:url(http://images.whrenai.com/zixun/images/boxbg.gif) no-repeat -198px -82px; cursor:pointer;}");
	document.writeln(".btn_min{float:right;width:20px; height:20px;background:url(http://images.whrenai.com/zixun/images/boxbg.gif) no-repeat -160px -82px; cursor:pointer;}");
	document.writeln(".btn_hf{float:right;width:20px; height:20px;background:url(http://images.whrenai.com/zixun/images/boxbg.gif) no-repeat -230px -82px; cursor:pointer;}");
	document.writeln(".minbox ul{width:145px;}");
	document.writeln(".minbox li{width:72px;padding:4px 0 0 0;}");
	document.writeln(".minbox li a{float:left;width:50px; padding:2px 0 0 21px;background:url(http://images.whrenai.com/zixun/images/boxbg.gif) no-repeat -260px -85px;}");
	document.writeln(".maxbox {width:455px; height:65px;background:url(http://images.whrenai.com/zixun/images/boxbg.gif) no-repeat 0 0;}");
	document.writeln(".maxbox .title{float:left;width:395px; height:16px; padding:4px 0 0 20px; color:#fff;}");
	document.writeln(".maxbox .doctor{float:left;width:112px;margin:4px 0 0 1px;display:inline;background:url(http://images.whrenai.com/zixun/images/line.gif) no-repeat 0 right;}");
	document.writeln(".maxbox .nobg{background:none;}");
	document.writeln(".maxbox .doctor .pic{float:left;width:46px;text-align:center;}");
	document.writeln(".maxbox .doctor .tt{float:left;width:58px;padding:1px 0 2px 7px;background:url(http://images.whrenai.com/zixun/images/boxbg.gif) no-repeat -165px -121px;}");
	document.writeln("<\/style>");

	function getHost(){
		var href = window.location.href;
		var reg = new RegExp("http://(\\w+)\\.whrenai\\.com","ig");
		reg.exec(href);
		return RegExp.$1;
	}
	function showMinbox(){
		document.getElementById("maxbox").style.display = "none";
		document.getElementById("minbox").style.display = "block";
		document.getElementById("mainbox").style.width = 145 + "px";
	}
	function closeBox(id){
		document.getElementById(id).style.display = "none";
	}

	function showMinbox(){
		document.getElementById("maxbox").style.display = "none";
		document.getElementById("minbox").style.display = "block";
		document.getElementById("mainbox").style.width = 145 + "px";
	}
	function showMaxbox(){
		document.getElementById("maxbox").style.display = "block";
		document.getElementById("minbox").style.display = "none";
		document.getElementById("mainbox").style.width = 455 + "px";
	}
	function closeBox(id){
		document.getElementById(id).style.display = "none";
	}

	if( typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat'){
		document.writeln('<div id="mainbox" style="z-index:1001;left:0;bottom:0; height:65px;width:455px;overflow:hidden;position:fixed;_position:absolute; _margin-top:expression(document.documentElement.clientHeight-this.style.pixelHeight+document.documentElement.scrollTop);">');
	}else {
		document.writeln('<div id="mainbox" style="z-index:1001;left:0;bottom:0; height:65px;width:455px;overflow:hidden;position:fixed;*position:absolute; *top:expression(eval(document.body.scrollTop)+eval(document.body.clientHeight)-this.style.pixelHeight);">');
	}
	
document.writeln('<div class="maxbox" id="maxbox"><span class="title">仁爱医院专家团(在线咨询)</span><span class="btn_close" onClick="closeBox(\'mainbox\');"></span><span class="btn_min" onClick="showMinbox();"></span><div class="doctor"><span class="pic"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank"><img src="http://www.whrenai.com/upload/news/200803/20080321161704167437.jpg" alt="医生简介" width="36" height="36" border="0" /></a></span><span class="tt"><a href="http://wpa.qq.com/msgrd?V=1&Uin=133998099&Site=互动服务&Menu=yes" target="_blank">美容整形</a></span><span class="btn"><a href="http://wpa.qq.com/msgrd?V=1&Uin=133998099&Site=互动服务&Menu=yes" target="_blank"><img src="http://www.wh16.com/files/css/images/btn_ask.gif" alt="在线咨询" border="0" /></a></span></div><div class="doctor"><span class="pic"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank"><img src="http://www.whrenai.com/upload/news/200803/20080321145500396562.jpg" alt="医生简介" width="36" height="36" border="0" /></a></span><span class="tt"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank">妇科专家</a></span><span class="btn"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank"><img src="http://www.wh16.com/files/css/images/btn_ask.gif" alt="在线咨询" border="0" /></a></span></div><div class="doctor"><span class="pic"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank"><img src="http://www.whrenai.com/upload/news/200803/20080321150343613312.jpg" alt="医生简介" width="36" height="36" border="0" /></a></span><span class="tt"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank">早孕专线</a></span><span class="btn"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank"><img src="http://www.wh16.com/files/css/images/btn_ask.gif" alt="在线咨询" border="0" /></a></span></div><div class="doctor nobg"><span class="pic"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank"><img src="http://www.whrenai.com/upload/news/200803/20080321161601659321.jpg" alt="医生简介" width="36" height="36" border="0" /></a></span><span class="tt"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank">男科专家</a></span><span class="btn"><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank"><img src="http://www.wh16.com/files/css/images/btn_ask.gif" alt="在线咨询" border="0" /></a></span></div></div>');

document.writeln('<div class="minbox" id="minbox"><span class="title">仁爱医院专家团</span><span class="btn_close" onClick="closeBox(\'mainbox\');"></span><span class="btn_hf" onClick="showMaxbox();"></span><ul><li><a href="http://wpa.qq.com/msgrd?V=1&Uin=133998099&Site=互动服务&Menu=yes" target="_blank">美容整形</a></li><li><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank">妇科专家</a></li><li><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank">早孕专线</a></li><li><a href="http://dgt.zoosnet.net/LR/chatwin.aspx?id=DGT13232427" target="_blank">男科专家</a></li></ul></div>');

document.writeln('</div>');


var urladdress="whrenai.com";
if(getHost()==null || getHost()==''){
	urladdress = "";
}
var cke = new Cookie(document, "showboxmax", 10, "/",urladdress);
cke.showMainBox = 'true';
if(!cke.load()){
	cke.store();
}
else{
	showMinbox();
}
