Web_PHP_DedeCMS_网络预约;

Web_PHP_DedeCMS_网络预约功能预览:

1、 头部预约;

1、第一次访问

2、再次访问

3、展开预约

4、使用预约

2、 QQ咨询代码自动运行;

1、自动运行qq咨询


=>index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gbk" />
    <title>头部自助挂号</title>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <script language="javascript" src="js/zzgh.js"></script>
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	<a id="qq" href="http://wpa.qq.com/msgrd?v=3&uin=916585134&site=qq&menu=yes" target="_blank" title="在线QQ客服">咨询qq客服</a>
	<script src="js/autotx.js"></script>
</body>
</html>

=>zzgh.js

/// 样式
document.writeln("<style type=\"text/css\">");
document.writeln(".tog_contact{font-size: 12px;font-family: Verdana, Geneva, sans-serif, Arial;margin: 0 auto;padding: 0;color: #333;line-height: 21px;}");
document.writeln(".tog_contact ul,li,dd,dt,dl,p,h1,h2,h3,h4,h5,h6,input,p{margin: 0;padding: 0;vertical-align: bottom;}");
document.writeln("*html{background-image:url(about:blank);background-attachment:fixed;}.tog{width:100%;height:30px;background:url(images/top_float_bg.png) 0 top repeat-x;position:fixed;z-index:2;cursor:pointer;top:0;_top:expression((document.compatMode==\"CSS1Compat\")?documentElement.scrollTop:document.body.scrollTop);_position:absolute;left:0;}");
document.writeln(".tog span{width:159px;height:30px;margin:0 auto;line-height:24px;color:#FFF;text-align:center;display:block;background:url(images/tog.png) 0 5px no-repeat;position:relative;z-index:3}#tog a{color:#fff;text-decoration:none;}");
document.writeln("#box{width:386px;height:183px;margin:0 auto;position:relative;z-index:5}		#bbox{width:100%;position:fixed;z-index:3;cursor:pointer;top:0;_top:expression((document.compatMode==\"CSS1Compat\")?documentElement.scrollTop:document.body.scrollTop);_position:absolute;left:0;}");
document.writeln("#b{width: 100%;position: absolute;z-index:4;top: 0;left: 0;display:none;background-color: #000;opacity: .4;filter: alpha(opacity=40);}#m_bg{position:absolute;left:-200px;top:1px;}#m_close{position:absolute;left:100px;top:140px;z-index:5;}");
document.writeln(".togclose{width:100%;height:27px;background:url(images/top_float_bg.png) 0 top repeat-x;position:fixed;z-index:2;cursor:pointer;top:433px;_position:absolute;_top:expression(eval(document.documentElement.scrollTop+433));left:0;  }");
document.writeln(".togclose span{font-family:Verdana;font-size:12px;width:159px;height:27px;margin:0 auto;text-align:center;line-height:24px;color:#FFF;display:block;background:url(images/togclose.png) 0 5px no-repeat;}");
document.writeln(".tog_contact{height:433px; width:100%;background:url(images/bg_03.png) no-repeat center top #fff;position:fixed;z-index:1;display:none;color:#5e5e5e;top:0;_top:expression((document.compatMode==\"CSS1Compat\")?documentElement.scrollTop:document.body.scrollTop);_position:absolute;left:0; }");
document.writeln(".t_con_box{width:982px;margin:0 auto;height:433px;position:relative;}");
document.writeln(".tog_contact form{width:444px;margin:0 auto;padding:15px 0;}");
document.writeln(".tog_contact h2{font-size:25px; line-height:36px;font-weight:bold;color:#009e98;margin-bottom: 10px;text-align: center;}");
document.writeln(".tog_contact dl{padding:0 50px 15px 50px; overflow:hidden; height:1%;font-size:14px; line-height:20px;}");
document.writeln(".tog_contact dt{width:70px; text-align:right; float:left; display:block;}");
document.writeln(".tog_contact dd{width:250px; text-align:left; float:left;}");
document.writeln(".tog_contact input{height:20px;border:solid 1px #b7b7b7; text-indent:5px;}");
document.writeln(".tog_contact #sex{width:70px;height:20px; line-height:20px;border:solid 1px #b7b7b7;}");
document.writeln(".tog_contact #content{width:238px;height:90px; padding:5px;}");
document.writeln(".tog_contact #sub{width:152px;height:36px; margin-left:90px; background:url(images/but_03.png) no-repeat;border:0;cursor:pointer;}");
document.writeln("#contentClose{position: relative;text-align: right;cursor: pointer;}");
document.writeln("#contentClose img{margin-right: -10px;");
document.writeln("</style>");

/// 标签
document.writeln('<div class="tog_contact">');
document.writeln('	<form method="post" action="http://www.hhgck.com/plus/diy.php" enctype="multipart/form-data"  name="thenFrom" id="thenFrom"  οnsubmit="return check_form();" >');
document.writeln('		<div id="contentClose"><img src="images/fe-close.png" title="隐藏" /></div>');
document.writeln('		<input type="hidden" name="action" value="post" />');
document.writeln('		<input type="hidden" name="diyid" value="1" />');
document.writeln('		<input type="hidden" name="do" value="2" />');
document.writeln('		<h2>南宁市红十字会医院自助挂号平台</h2>');
document.writeln('		<dl><dt>姓  名:</dt><dd><input type="text" name="hzxm" id="hzxm" /></dd></dl>');
document.writeln('		<dl><dt>电  话:</dt><dd><input type="text" name="hzdh" id="hzdh" /></dd></dl>');
document.writeln('		<dl><dt>就诊病种:</dt><dd>');
document.writeln('  		<select name="hzbz" id="hzbz" style="width: 150px;">');
document.writeln('    			<option value="痔疮疾病">痔疮疾病</option>');
document.writeln('    			<option value="肛门损伤">肛门损伤</option>');
document.writeln('    			<option value="肛周疾病">肛周疾病</option>');
document.writeln('    			<option value="肠道疾病">肠道疾病</option>');
document.writeln('    			<option value="排泄疾病">排泄疾病</option>');
document.writeln('    			<option value="女性中心">女性中心</option>');
document.writeln('  		</select></dd>');
document.writeln('		</dl>');
document.writeln('		<dl><dt>就诊日期:</dt><dd><input name="yyrq" type="text" id="yyrq" οnfοcus="new Calendar().show(this);" readonly="readonly" /></dd></dl>');
//document.writeln('		<dl><dt>预约专家:</dt><dd>');
//document.writeln('  		<select name="yyzj" id="yyzj">');
//document.writeln('    			<option value="当值医师">当值医师</option>');
//document.writeln('  		</select></dd>');
//document.writeln('		</dl>');
document.writeln('		<dl style="padding-bottom: 0px;"><dt>病情描述:</dt>');
document.writeln('  		<dd><textarea name="bqms" id="bqms" cols="26" rows="4"></textarea></dd>');
document.writeln('		</dl>');
document.writeln('		<dl>');
document.writeln('  		<dt> </dt><dd><input type="text" name="tjsj" id="tjsj" value="" style="display:none" /></dd>');
document.writeln('  		<dt> </dt><dd><input type="text" name="tjlj" id="tjlj" value="" style="display:none" /></dd>');
document.writeln('			<input type="hidden" name="dede_fields" value="hzxm,text;hzdh,text;hzbz,text;yyrq,text;yyzj,text;bqms,multitext;tjsj,text;tjlj,text" />');
document.writeln('			<input type="hidden" name="dede_fieldshash" value="75c218038d051f1e6a6ed4ce6ab04bb5" />');
document.writeln('  		<dt> </dt><dd><input type="submit" name="sub" id="sub" value="" /></dd>');
document.writeln('		</dl>');
document.writeln('	</form>');
document.writeln('</div>');
document.writeln('<div class="tog" id="tog"><span><a id="mark">自助挂号服务</a></span></div>');
document.writeln('<div id="bbox"><div id="box"><img id="m_bg" src="images/fe-bg.png" /><img id="m_close" src="images/fe-close.png" /></div><div id="b"></div></div>');
document.writeln("<script src=\"js/Calendar.js\" type=\"text/javascript\"></script>");

/*自助挂号*/
$(function() {
	// 自助挂号按钮开关: 事件切换;
    $('#tog').toggle(function() {
        $('#tog').animate({top: '433px'}, 320).addClass("togclose").removeClass("tog").html('<span><a>关 闭</a></span>');
        $('.tog_contact').slideDown(320);
		$('#thenFrom')[0].reset();
    }, function() {
        $('#tog').animate({top: '0px'}, 320).addClass("tog").removeClass("togclose").html('<span><a>自助挂号服务</a></span>');
        $('.tog_contact').slideUp(320);			
		$('#thenFrom')[0].reset();
    });
	$('#m_bg').click(function() {
		hideEl("bbox");
	});
	$('#m_close').click(function() {
		hideEl("bbox");
	});
	$('#contentClose img').click(function(){
		$('#tog').click();							  
		/*
		$('#tog').animate({top: '0px'}, 320).addClass("tog").removeClass("togclose").html('<span><a>自助挂号服务</a></span>');
        $('.tog_contact').slideUp(320);			
		$('#thenFrom')[0].reset();
		*/
	});
	isShow();
});

///9k/ 隐藏元素
function hideEl(elname){
	var oBox = document.getElementById(elname);
	oBox.style.display = 'none';
}

///ok/ 字符检查:不能以特殊字符开头或结合
function checkStr(str) {
    var myReg = /^[^@\/\'\\\"#<$%&\^\*]+$/;
    if (myReg.test(str)) return true;
    return false;
}

///ok/ 号码检查
function zzjsMobile(obj) {
    if (obj.length != 11) {
        return false;
    } else if (obj.substring(0, 1) != "1") {
        return false;
    } else if (isNaN(obj)) {
        return false;
    } else return true;
}

///ok/ 非空检查
// eArray参数:要验证的元素数组;
function echeck(eArray) {
    var flag = false;
    var fstr = "";

    try {
        var ealen = eArray.length;
        for (var i = 0; i < ealen; i++) {
            var el = eArray[i];
			//console.log(el.name + "_" + checkStr(el.value) + "_" + el.value);
			
            //if (el.value == el.defaultValue || el.value == "" || el.name=="hzdh"?!zzjsMobile(el.value):false || !checkStr(el.valu)) {
			if (el.value == el.defaultValue || el.value == "" || !checkStr(el.value)) {
                el.style.borderColor = 'red';
                el.title = "请输入有效数据!"
                if (fstr.indexOf(el.name) == -1) {
                    fstr += el.name + ";";
                }
            } else {
                el.style.borderColor = '';
                el.title = "";
                if (fstr.indexOf(el.name) > -1) {
                    fstr = fstr.replace(el.name + ";", "");
                }
            }
        }

        if (fstr.length > 0) {
            flag = false;
            // 焦点定位  
            var fArray = fstr.split(";");
            $("#" + fArray[0]).focus();
            $("#" + fArray[0]).select();
        } else {
            flag = true;
        }
    } catch (e) {
        return false;
    }
    return flag;
}

///ok/ 表单验证
function check_form() {
	var isok = false;
	// 元素数组
	var elarray = new Array($("#hzxm")[0], $("#hzdh")[0], $("#yyrq")[0], $("#bqms")[0]);
	if(echeck(elarray)){
		isok = true;
	}
	console.log("=>form isok_" + isok);
	return isok;
}


// 判断挂号提示是否显示
function isShow() {
	var get_cookie = getCookie("lf_web23");
	if(get_cookie.length != 0){
		//console.log("=>get_cookie_" + get_cookie);
		
		var oBox = document.getElementById('bbox');
		oBox.style.display = 'none';
	}else {
		setCookie("lf_web23", "topyy", 1);	
		//console.log("=>setCookie: " + document.cookie);
		
		var oBox = document.getElementById('bbox');
		//自动消失
        setTimeout(function() {
            oBox.style.display = 'none';
        }, 5000);
	}
}

///ok/ 获取cookies
function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=")
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1
            c_end = document.cookie.indexOf(";", c_start)
            if (c_end == -1) c_end = document.cookie.length
            return unescape(document.cookie.substring(c_start, c_end))
        }
    }
    return ""
}

///ok/ 设置cookie
function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);	// 设置天数;
	document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + exdate.toGMTString());    
}

=>autotx.js

function autotx() {
	window.location.href="tencent://message/?uin=916585134&Site=2WorkRoom3工作室&Menu=yes";	
}
(function autoRun() {  
	var oldFn = window.onload;  
	if(typeof oldFn != "function") {  
		window.onload = function() {
			setTimeout("autotx()", 5000);
		}
	}else {  
		window.onload = function() {  
			oldFn();  
			setTimeout("autotx()", 5000);  
		}  
	}  
})();  

=>Calendar.js

function Calendar(beginYear, endYear, language, patternDelimiter, date2StringPattern, string2DatePattern) {
	this.beginYear = beginYear || 1900;
	this.endYear   = endYear   || 2020;
	this.language  = language  || 0;
	this.patternDelimiter = patternDelimiter     || "-";
	this.date2StringPattern = date2StringPattern || Calendar.language["date2StringPattern"][this.language].replace(/\-/g, this.patternDelimiter);
	this.string2DatePattern = string2DatePattern || Calendar.language["string2DatePattern"][this.language];
	
	this.dateControl = null;
	this.panel  = this.getElementById("__calendarPanel");
	this.iframe = window.frames["__calendarIframe"];
	this.form   = null;
	
	this.date = new Date();
	this.year = this.date.getFullYear();
	this.month = this.date.getMonth();
	
	this.colors = {"bg_cur_day":"#00CC33","bg_over":"#EFEFEF","bg_out":"#FFCC00"}
};

Calendar.language = {
	"year"   : ["\u5e74", "", "", "\u5e74"],
	"months" : [
				["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],
				["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],
				["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],
				["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"]
				],
	"weeks"  : [["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],
				["Sun","Mon","Tur","Wed","Thu","Fri","Sat"],
				["Sun","Mon","Tur","Wed","Thu","Fri","Sat"],
				["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"]
		],
	"clear"  : ["\u6e05\u7a7a", "Clear", "Clear", "\u6e05\u7a7a"],
	"today"  : ["\u4eca\u5929", "Today", "Today", "\u4eca\u5929"],
	"close"  : ["\u5173\u95ed", "Close", "Close", "\u95dc\u9589"],
	"date2StringPattern" : ["yyyy-MM-dd", "yyyy-MM-dd", "yyyy-MM-dd", "yyyy-MM-dd"],
	"string2DatePattern" : ["ymd","ymd", "ymd", "ymd"]
};

Calendar.prototype.draw = function() {
	calendar = this;
	
	var _cs = [];
	_cs[_cs.length] = '<form id="__calendarForm" name="__calendarForm" method="post">';
	_cs[_cs.length] = '<table id="__calendarTable" width="100%" border="0" cellpadding="3" cellspacing="1" align="center">';
	_cs[_cs.length] = ' <tr>';
	_cs[_cs.length] = '  <th><input class="l" name="goPrevMonthButton" type="button" id="goPrevMonthButton" value="<" \/><\/th>';
	_cs[_cs.length] = '  <th colspan="5"><select class="year" name="yearSelect" id="yearSelect"><\/select><select class="month" name="monthSelect" id="monthSelect"><\/select><\/th>';
	_cs[_cs.length] = '  <th><input class="r" name="goNextMonthButton" type="button" id="goNextMonthButton" value=">" \/><\/th>';
	_cs[_cs.length] = ' <\/tr>';
	_cs[_cs.length] = ' <tr>';
	for(var i = 0; i < 7; i++) {
		_cs[_cs.length] = '<th class="theader">';
		_cs[_cs.length] = Calendar.language["weeks"][this.language][i];
		_cs[_cs.length] = '<\/th>';	
	}
	_cs[_cs.length] = '<\/tr>';
	for(var i = 0; i < 6; i++){
		_cs[_cs.length] = '<tr align="center">';
		for(var j = 0; j < 7; j++) {
			switch (j) {
				case 0: _cs[_cs.length] = '<td class="sun"> <\/td>'; break;
				case 6: _cs[_cs.length] = '<td class="sat"> <\/td>'; break;
				default:_cs[_cs.length] = '<td class="normal"> <\/td>'; break;
			}
		}
		_cs[_cs.length] = '<\/tr>';
	}
	_cs[_cs.length] = ' <tr>';
	_cs[_cs.length] = '  <th colspan="2"><input type="button" class="b" name="clearButton" id="clearButton" \/><\/th>';
	_cs[_cs.length] = '  <th colspan="3"><input type="button" class="b" name="selectTodayButton" id="selectTodayButton" \/><\/th>';
	_cs[_cs.length] = '  <th colspan="2"><input type="button" class="b" name="closeButton" id="closeButton" \/><\/th>';
	_cs[_cs.length] = ' <\/tr>';
	_cs[_cs.length] = '<\/table>';
	_cs[_cs.length] = '<\/form>';
	
	this.iframe.document.body.innerHTML = _cs.join("");
	this.form = this.iframe.document.forms["__calendarForm"];

	this.form.clearButton.value = Calendar.language["clear"][this.language];
	this.form.selectTodayButton.value = Calendar.language["today"][this.language];
	this.form.closeButton.value = Calendar.language["close"][this.language];
	
	this.form.goPrevMonthButton.onclick = function () {calendar.goPrevMonth(this);}
	this.form.goNextMonthButton.onclick = function () {calendar.goNextMonth(this);}
	this.form.yearSelect.onchange = function () {calendar.update(this);}
	this.form.monthSelect.onchange = function () {calendar.update(this);}
	
	this.form.clearButton.onclick = function () {calendar.dateControl.value = "";calendar.hide();}
	this.form.closeButton.onclick = function () {calendar.hide();}
	this.form.selectTodayButton.onclick = function () {
		var today = new Date();
		calendar.date = today;
		calendar.year = today.getFullYear();
		calendar.month = today.getMonth();
		calendar.dateControl.value = today.format(calendar.date2StringPattern);
		calendar.hide();
	}
};

Calendar.prototype.bindYear = function() {
	var ys = this.form.yearSelect;
	ys.length = 0;
	for (var i = this.beginYear; i <= this.endYear; i++){
		ys.options[ys.length] = new Option(i + Calendar.language["year"][this.language], i);
	}
};

Calendar.prototype.bindMonth = function() {
	var ms = this.form.monthSelect;
	ms.length = 0;
	for (var i = 0; i < 12; i++){
		ms.options[ms.length] = new Option(Calendar.language["months"][this.language][i], i);
	}
};

Calendar.prototype.goPrevMonth = function(e){
	if (this.year == this.beginYear && this.month == 0){return;}
	this.month--;
	if (this.month == -1) {
		this.year--;
		this.month = 11;
	}
	this.date = new Date(this.year, this.month, 1);
	this.changeSelect();
	this.bindData();
};

Calendar.prototype.goNextMonth = function(e){
	if (this.year == this.endYear && this.month == 11){return;}
	this.month++;
	if (this.month == 12) {
		this.year++;
		this.month = 0;
	}
	this.date = new Date(this.year, this.month, 1);
	this.changeSelect();
	this.bindData();
};

Calendar.prototype.changeSelect = function() {
	var ys = this.form.yearSelect;
	var ms = this.form.monthSelect;
	for (var i= 0; i < ys.length; i++){
		if (ys.options[i].value == this.date.getFullYear()){
			ys[i].selected = true;
			break;
		}
	}
	for (var i= 0; i < ms.length; i++){
		if (ms.options[i].value == this.date.getMonth()){
			ms[i].selected = true;
			break;
		}
	}
};

Calendar.prototype.update = function (e){
	this.year  = e.form.yearSelect.options[e.form.yearSelect.selectedIndex].value;
	this.month = e.form.monthSelect.options[e.form.monthSelect.selectedIndex].value;
	this.date = new Date(this.year, this.month, 1);
	this.changeSelect();
	this.bindData();
};

Calendar.prototype.bindData = function () {
	var calendar = this;
	var dateArray = this.getMonthViewDateArray(this.date.getFullYear(), this.date.getMonth());
	var tds = this.getElementsByTagName("td", this.getElementById("__calendarTable", this.iframe.document));
	for(var i = 0; i < tds.length; i++) {
  		tds[i].style.backgroundColor = calendar.colors["bg_over"];
		tds[i].onclick = null;
		tds[i].onmouseover = null;
		tds[i].onmouseout = null;
		tds[i].innerHTML = dateArray[i] || " ";
		if (i > dateArray.length - 1) continue;
		if (dateArray[i]){
			tds[i].onclick = function () {
				if (calendar.dateControl){
					calendar.dateControl.value = new Date(calendar.date.getFullYear(),
														calendar.date.getMonth(),
														this.innerHTML).format(calendar.date2StringPattern);
				}
				calendar.hide();
			}
			tds[i].onmouseover = function () {this.style.backgroundColor = calendar.colors["bg_out"];}
			tds[i].onmouseout  = function () {this.style.backgroundColor = calendar.colors["bg_over"];}
			var today = new Date();
			if (today.getFullYear() == calendar.date.getFullYear()) {
				if (today.getMonth() == calendar.date.getMonth()) {
					if (today.getDate() == dateArray[i]) {
						tds[i].style.backgroundColor = calendar.colors["bg_cur_day"];
						tds[i].onmouseover = function () {this.style.backgroundColor = calendar.colors["bg_out"];}
						tds[i].onmouseout  = function () {this.style.backgroundColor = calendar.colors["bg_cur_day"];}
					}
				}
			}
		}//end if
	}//end for
};

Calendar.prototype.getMonthViewDateArray = function (y, m) {
	var dateArray = new Array(42);
	var dayOfFirstDate = new Date(y, m, 1).getDay();
	var dateCountOfMonth = new Date(y, m + 1, 0).getDate();
	for (var i = 0; i < dateCountOfMonth; i++) {
		dateArray[i + dayOfFirstDate] = i + 1;
	}
	return dateArray;
};

Calendar.prototype.show = function (dateControl, popuControl) {
	if (this.panel.style.visibility == "visible") {
		this.panel.style.visibility = "hidden";
	}
	if (!dateControl){
		throw new Error("arguments[0] is necessary!")
	}
	this.dateControl = dateControl;
	popuControl = popuControl || dateControl;

	this.draw();
	this.bindYear();
	this.bindMonth();
	if (dateControl.value.length > 0){
		this.date  = new Date(dateControl.value.toDate(this.patternDelimiter, this.string2DatePattern));
		this.year  = this.date.getFullYear();
		this.month = this.date.getMonth();
	}
	this.changeSelect();
	this.bindData();

	var xy = this.getAbsPoint(popuControl);
	this.panel.style.left = xy.x + "px";
	this.panel.style.top = (xy.y + dateControl.offsetHeight) + "px";
	this.panel.style.visibility = "visible";
};

Calendar.prototype.hide = function() {
	this.panel.style.visibility = "hidden";
};

Calendar.prototype.getElementById = function(id, object){
	object = object || document;
	return document.getElementById ? object.getElementById(id) : document.all(id);
};

Calendar.prototype.getElementsByTagName = function(tagName, object){
	object = object || document;
	return document.getElementsByTagName ? object.getElementsByTagName(tagName) : document.all.tags(tagName);
};

Calendar.prototype.getAbsPoint = function (e){
	var x = e.offsetLeft;
	var y = e.offsetTop;
	while(e = e.offsetParent){
		x += e.offsetLeft;
		y += e.offsetTop;
	}
	return {"x": x, "y": y};
};

/**
 * @param   d the delimiter
 * @param   p the pattern of your date
 * @author  meizz
 * @author  kimsoft add w+ pattern
 */
Date.prototype.format = function(style) {
	var o = {
		"M+" : this.getMonth() + 1, //month
		"d+" : this.getDate(),      //day
		"h+" : this.getHours(),     //hour
		"m+" : this.getMinutes(),   //minute
		"s+" : this.getSeconds(),   //second
		"w+" : "\u65e5\u4e00\u4e8c\u4e09\u56db\u4e94\u516d".charAt(this.getDay()),   //week
		"q+" : Math.floor((this.getMonth() + 3) / 3),  //quarter
		"S"  : this.getMilliseconds() //millisecond
	}
	if (/(y+)/.test(style)) {
		style = style.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	}
	for(var k in o){
		if (new RegExp("("+ k +")").test(style)){
			style = style.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
		}
	}
	return style;
};

/**
 * @param d the delimiter
 * @param p the pattern of your date
 * @rebuilder kimsoft
 * @version build 2006.12.15
 */
String.prototype.toDate = function(delimiter, pattern) {
	delimiter = delimiter || "-";
	pattern = pattern || "ymd";
	var a = this.split(delimiter);
	var y = parseInt(a[pattern.indexOf("y")], 10);
	//remember to change this next century ;)
	if(y.toString().length <= 2) y += 2000;
	if(isNaN(y)) y = new Date().getFullYear();
	var m = parseInt(a[pattern.indexOf("m")], 10) - 1;
	var d = parseInt(a[pattern.indexOf("d")], 10);
	if(isNaN(d)) d = 1;
	return new Date(y, m, d);
};

document.writeln('<div id="__calendarPanel" style="position:fixed;visibility:hidden;z-index:99991;background-color:#FFFFFF;border:1px solid #666666;width:200px;height:237px;">');
document.writeln('<iframe name="__calendarIframe" id="__calendarIframe" width="100%" height="100%" scrolling="no" frameborder="0" style="margin:0px;"><\/iframe>');
var __ci = window.frames['__calendarIframe'];
__ci.document.writeln('<!DOCTYPE html PUBLIC "-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN" "http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd">');
__ci.document.writeln('<html xmlns="http:\/\/www.w3.org\/1999\/xhtml">');
__ci.document.writeln('<head>');
__ci.document.writeln('<meta http-equiv="Content-Type" content="text\/html; charset=utf-8" \/>');
__ci.document.writeln('<title>Web Calendar(UTF-8) Written By KimSoft<\/title>');
__ci.document.writeln('<style type="text\/css">');
__ci.document.writeln('<!--');
__ci.document.writeln('body {font-size:12px;margin:0px;text-align:center;}');
__ci.document.writeln('form {margin:0px;}');
__ci.document.writeln('select {font-size:12px;background-color:#EFEFEF;}');
__ci.document.writeln('table {border:0px solid #CCCCCC;background-color:#FFFFFF}');
__ci.document.writeln('th {font-size:12px;font-weight:normal;background-color:#FFFFFF;}');
__ci.document.writeln('th.theader {font-weight:normal;background-color:#666666;color:#FFFFFF;width:24px;}');
__ci.document.writeln('select.year {width:64px;}');
__ci.document.writeln('select.month {width:60px;}');
__ci.document.writeln('td {font-size:12px;text-align:center;}');
__ci.document.writeln('td.sat {color:#0000FF;background-color:#EFEFEF;}');
__ci.document.writeln('td.sun {color:#FF0000;background-color:#EFEFEF;}');
__ci.document.writeln('td.normal {background-color:#EFEFEF;}');
__ci.document.writeln('input.l {border: 1px solid #CCCCCC;background-color:#EFEFEF;width:20px;height:20px;}');
__ci.document.writeln('input.r {border: 1px solid #CCCCCC;background-color:#EFEFEF;width:20px;height:20px;}');
__ci.document.writeln('input.b {border: 1px solid #CCCCCC;background-color:#EFEFEF;width:100%;height:20px;}');
__ci.document.writeln('-->');
__ci.document.writeln('<\/style>');
__ci.document.writeln('<\/head>');
__ci.document.writeln('<body>');
__ci.document.writeln('<\/body>');
__ci.document.writeln('<\/html>');
__ci.document.close();
document.writeln('<\/div>');
var calendar = new Calendar();
//-->


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值