/*
艾恩JavaScript插件
声明: 日历功能代码非本人原创,本人只是修改部分代码实现初始化时日历日期和文本框日期的同步(原代码日历初始化只能绑定当前系统日期);
望本日历作者能够联系本人
作者 :Anlige
QQ :1034555083
Email :zhanghuiguoanlige@126.com
主页 :http://www.ii-home.cn
var settings = {asc: true,url: "",dataType: "text",method: "get",data: "",succeed: function(a,b,c){return true},error: function(a,b,c){return true}}
EndragEx : function (source,target,offSetX, offSetY)
*/
var APlus=_=window._={
version:"艾恩JavaScript插件1.0",index:100,is_ie:(navigator.appName=='Microsoft Internet Explorer'),
QString : function (searchStr){var url=window.location.search;if(url.indexOf("?")>=0){url=url.substr(1);var varis=url.split("&");for(var i in varis){var Ary=varis[i].split("=");if(Ary[0].toLowerCase()==searchStr.toLowerCase()){return Ary[1];}}return "";}else{return "";}},
extend : function (a, b){for(var m in b){a[m]=b[m];}return a;},
h : function (){var b=null;if (window.ActiveXObject) {b= new ActiveXObject("Microsoft.XMLHTTP");}else if (window.XMLHttpRequest) {b= new XMLHttpRequest(); }return b;},
r : function (){return Math.random().toString().substr(2);},
abs : function (a){a=this.$(a);var b = { x: a.offsetLeft, y: a.offsetTop};a = a.offsetParent;while (a) {b.x += a.offsetLeft;b.y += a.offsetTop;a = a.offsetParent;}return b;},
$ : function (a){return typeof a == "string" ? document.getElementById(a) : a;},
trim : function (a){return a.replace(/^(\s+)|(\s+)$/,"$2");},
ask : function (a){return window.confirm(typeof a == "string" ?a:"操作不可恢复,确定要执行本操作吗?");},
len : function (a){return (this.is_ie && a.indexOf('\n') != -1) ? a.replace(/\r?\n/g, '_').length : a.length;},
getFocus : function (a){if(a.style.zIndex!=this.index){this.index += 2; var idx = this.index; a.style.zIndex=idx; } },
addEvent : function (target, type, func) {if (target.addEventListener){target.addEventListener(type, func, false);}else if (target.attachEvent){target.attachEvent("on" + type, func);}else {target["on" + type] = func;}},
DU : function (p){return decodeURI(p);},
EU : function (p){return encodeURI(p);},
DS : function (p){return unescape(p);},
ES : function (p){return escape(p);},
EC : function (p){return encodeURIComponent(p);},
DC : function (p){return decodeURIComponent(p);},
plus : function (str){str=str.replace(/\+/g," ");return (str);},
Endrag : {x0:0,y0:0,x1:0,y1:0,moveable:false,NS:(navigator.appName=='Netscape'),offSets:{x:0,y:0},startDrag:function (e){e = e ? e : (window.event ? window.event : null);_.getFocus(this); if(e.button==(_.Endrag.NS)?0 :1) { if(!_.Endrag.NS){this.setCapture();}_.Endrag.x0 = e.clientX ; _.Endrag.y0 = e.clientY ; _.Endrag.x1 = parseInt(_.abs(this).x); _.Endrag.y1 = parseInt(_.abs(this).y); _.Endrag.moveable = true; } }, drag:function (e){e = e ? e : (window.event ? window.event : null); if(_.Endrag.moveable){ this.style.left = (_.Endrag.x1 + e.clientX - _.Endrag.x0 - _.Endrag.offSets.x) + "px"; this.style.top = (_.Endrag.y1 + e.clientY - _.Endrag.y0 - _.Endrag.offSets.y) + "px"; this.style.cursor = "move"; } }, stopDrag:function (e){ if(_.Endrag.moveable) { if(!_.Endrag.NS){this.releaseCapture();} _.Endrag.moveable = false; this.style.cursor = "default"; } }, offSet:function(setting){this.offSets=setting;},bind:function(obj){var obj=_.$(obj);obj.onmousedown=this.startDrag;obj.onmouseup=this.stopDrag;obj.onmousemove=this.drag;return this;}},
EndragEx : function (source,target,offSetX, offSetY){source=typeof(source)=="object" ? source:document.getElementById(source);target=typeof(target)=="object" ? target:document.getElementById(target);var x0=0,y0=0,x1=0,y1=0,moveable=false,NS=(navigator.appName=='Netscape');offSetX=typeof offSetX== "undefined" ? 0:offSetX;offSetY=typeof offSetY== "undefined" ? 0:offSetY;source.onmousedown=function(e){e = e ? e : (window.event ? window.event : null);_.getFocus(target); if(e.button==(NS)?0 :1) {if(!NS){this.setCapture()}x0 = e.clientX ; y0 = e.clientY ; x1 = parseInt(_.abs(target).x); y1 = parseInt(_.abs(target).y); moveable = true; } }; source.onmousemove=function(e){e = e ? e : (window.event ? window.event : null); if(moveable){ target.style.left = (x1 + e.clientX - x0 - offSetX) + "px"; target.style.top = (y1 + e.clientY - y0 - offSetY) + "px"; this.style.cursor = "move";} }; source.onmouseup=function (e){ if(moveable) { if(!NS){this.releaseCapture();}moveable = false; this.style.cursor = "default";} };}};
;(function(_){
var Ai=window.Ai=window.$A=function(obj){
obj=_.$(obj);
return {
currentO:0,
load:function(fn){_.addEvent(obj,"load",fn);},
click:function(fn){_.addEvent(obj,"click",fn);},
focus:function(fn){_.addEvent(obj,"focus",fn);},
blur:function(fn){_.addEvent(obj,"blur",fn);},
mouseover:function(fn){_.addEvent(obj,"mouseover",fn);},
mouseout:function(fn){_.addEvent(obj,"mouseout",fn);},
hover:function(fn,fn1){_.addEvent(obj,"mouseover",fn);_.addEvent(obj,"mouseout",fn1);},
html:function(){if(arguments.length==1){obj.innerHTML=arguments[0];return $A(obj);}else{return obj.innerHTML;}},
text:function(){if(arguments.length==1){if(!_.is_ie){obj.textContent=arguments[0];}else{obj.innerText=arguments[0];}return $A(obj);}else{return _.is_ie ? obj.innerText : obj.textContent;}},
val:function(){if(arguments.length==1){obj.value=arguments[0];return $A(obj);}else{return obj.value;}},
hide:function(){obj.style.display="none";return $A(obj);},
show:function(){obj.style.display="block";return $A(obj);},
attr:function(){
if(arguments.length==2){
if(arguments[0]=="className" && !_.is_ie){
obj.setAttribute("class",arguments[1]);
}else{
obj.setAttribute(arguments[0],arguments[1]);
}
return $A(obj);
}else if(arguments.length==1){
if(arguments[0]=="className" && !_.is_ie){
return obj.getAttribute("class");
}else{
return obj.getAttribute(arguments[0]);
}
}
}
};
};})(APlus);
/*
*/