
if(typeof(QZFL)=="undefined"||!QZFL){
var QZFL={
version:"1.5.0",
_qzfl:true};
var QZONE=QZFL;}
QZFL.userAgent=(function(){
var vie,vff,vopera,vsf,vapple,wintype,mactype,vair,vchrome;
var discerned=false;
var agent=(/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel|Minefield).(\d+\.\d+))|(?:Opera.(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/).exec(navigator.userAgent);
var os=(/(Windows.*?;)|(Mac OS X.*?;)/).exec(navigator.userAgent);
if(agent){
vie=agent[1]?parseFloat(agent[1]):NaN;
vff=agent[2]?parseFloat(agent[2]):NaN;
vopera=agent[3]?parseFloat(agent[3]):NaN;
vsf=agent[4]?parseFloat(agent[4]):NaN;
if(!isNaN(vsf)){
var _ua=navigator.userAgent;
if(/AdobeAIR/.test(_ua)){
vair=1;}else if(/Chrome/.test(_ua)){
vchrome=1;}else{
try{
vapple=parseFloat((/Version\/(\d+(?:\.\d+)?)/).exec(_ua)[1]);}catch(e){
vapple=0.1}}}}else{
vie=vff=vopera=vsf=vapple=vair=NaN;}
if(os){
wintype=!!os[1];
mactype=!!os[2];}else{
wintype=mactype=false;}
function adjustBehaviors(){
if(ua.ie<7){
try{
document.execCommand('BackgroundImageCache',false,true);}catch(ignored){}}
adjusted=true;}
return{
firefox:vff,
ie:window.XDomainRequest?8:vie,
opera:vopera,
air:vair,
safari:vsf,
safariV:vapple,
windows:wintype,
macs:mactype,
chrome:vchrome,
adjustBehaviors:adjustBehaviors};})();
QZFL.namespace={
map:function(namespace){
if((namespace!==null)&&(typeof(namespace)=='object')){
for(var k in namespace){
window[k]=namespace[k];}}},
extend:function(namespace,extendModule){
if((namespace!==null)&&(typeof(namespace)=='object')){
for(var k in extendModule){
namespace[k]=extendModule[k];}}
extendModule=null;}};
QZFL.emptyFn=function(){};
QZFL.widget={};
var ua=QZFL.userAgent;
QZFL.console={
print:function(msg,type){
if(window.console){
console.log((type==4?(new Date()+":"):"")+msg);}}}
QZFL.report={
receive:QZFL.emptyFn,
addRule:QZFL.emptyFn}
QZFL.dom={
getById:function(id){
return document.getElementById(id);},
getByName:function(name,tagName){
if(!tagName)
return document.getElementsByName(name);
var arr=[];
var e=document.getElementsByTagName(tagName);
for(var i=0;i<e.length;++i){
if(!!e[i].getAttribute("name")&&(e[i].getAttribute("name").toLowerCase()==name.toLowerCase())){
arr.push(e[i]);}}
return arr;},
get:function(e){
if(e&&(e.tagName||e.item)){
return e;}
return this.getById(e);},
getNode:function(e){
if(e&&(e.nodeType||e.item)){
return e;}
if(typeof e==='string'){
return this.getById(e);}
return null;},
removeElement:function(el){
if(typeof(el)=="string"){
el=QZFL.dom.getById(el);}
if(!el){
return;}
if(el.removeNode){
el.removeNode(true);}else{
if(el.childNodes.length>0){
for(var ii=el.childNodes.length-1;ii>=0;ii--){
QZFL.dom.removeElement(el.childNodes[ii]);}}
if(el.parentNode){
el.parentNode.removeChild(el);}}
el=null;
return null;},
searchElementByClassName:function(el,className){
el=this.get(el);
if(!el){
return null}
var re=QZFL.css.getClassRegEx(className);
while(el){
if(re.test(el.className)){
return el;}
el=el.parentNode;}
return null;},
getElementsByClassName:function(className,tag,root){
tag=tag||'*';
root=(root)?this.get(root):null||document;
if(!root){
return[];}
var nodes=[],
elements=root.getElementsByTagName(tag),
re=QZFL.css.getClassRegEx(className);
for(var i=0,len=elements.length;i<len;++i){
if(re.test(elements[i].className)){
nodes[nodes.length]=elements[i];}}
return nodes;},
isAncestor:function(node1,node2){
if(!node1||!node2){
return false;}
if(node1.contains&&node2.nodeType&&!QZFL.userAgent.Safari){
return node1.contains(node2)&&node1!=node2;}
if(node1.compareDocumentPosition&&node2.nodeType){
return !!(node1.compareDocumentPosition(node2)&16);}else if(node2.nodeType){
return !!this.getAncestorBy(node2,function(el){
return el==node1;});}
return false;},
getAncestorBy:function(node,method){
while(node=node.parentNode){
if(node&&node.nodeType==1&&(!method||method(node))){
return node;}}
return null;},
getFirstChild:function(node){
node=this.getNode(node);
if(!node){
return null;}
var child=QZFL.lang.isElement(node.firstChild)?node.firstChild:null;
return child||this.getNextSibling(node.firstChild);},
getNextSibling:function(node){
node=this.getNode(node);
if(!node){
return null;}
while(node){
node=node.nextSibling;
if(QZFL.lang.isElement(node)){
return node;}}
return null;},
getPreviousSibling:function(node){
node=this.getNode(node);
if(!node){
return null;}
while(node){
node=node.previousSibling;
if(QZFL.lang.isElement(node)){
return node;}}
return null;},
swapNode:function(node1,node2){
if(node1.swapNode){
node1.swapNode(node2);}else{
var parent=node2.parentNode;
var next=node2.nextSibling;
if(next==node1){
parent.insertBefore(node1,node2);}else if(node2==node1.nextSibling){
parent.insertBefore(node2,node1);}else{
node1.parentNode.replaceChild(node2,node1);
parent.insertBefore(node1,next);}}},
createElementIn:function(tagName,el,insertFirst,attributes){
tagName=tagName||"div";
el=this.get(el)||document.body;
var _doc=el.ownerDocument;
var _e=_doc.createElement(tagName);
if(attributes){
for(var k in attributes){
if(/class/.test(k)){
_e.className=attributes[k];}else if(/style/.test(k)){
_e.style.cssText=attributes[k];}else{
_e[k]=attributes[k];}}}
if(insertFirst){
el.insertBefore(_e,el.firstChild);}else{
el.appendChild(_e);}
return _e;},
getStyle:function(el,property){
el=this.get(el);
var w3cMode=document.defaultView&&document.defaultView.getComputedStyle;
var computed=!w3cMode?null:document.defaultView.getComputedStyle(el,'');
var value="";
switch(property){
case "float":
property=w3cMode?"cssFloat":"styleFloat";
break;
case "opacity":
if(!w3cMode){
var val=100;
try{
val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){
try{
val=el.filters('alpha').opacity;}catch(e){}}
return val/100;}
break;
case "backgroundPositionX":
if(w3cMode){
property="backgroundPosition";
return((computed||el.style)[property]).split(" ")[0];}
break;
case "backgroundPositionY":
if(w3cMode){
property="backgroundPosition";
return((computed||el.style)[property]).split(" ")[1];}
break;}
if(w3cMode){
return(computed||el.style)[property];}else{
return(el.currentStyle[property]||el.style[property]);}},
setStyle:function(el,property,value){
el=this.get(el);
if(!el){
return false;}
var w3cMode=document.defaultView&&document.defaultView.getComputedStyle;
switch(property){
case "float":
property=w3cMode?"cssFloat":"styleFloat";
case "opacity":
if(!w3cMode){
if(value>=1){
el.style.filter="";
return;}
el.style.filter='alpha(opacity='+(value*100)+')';
return true;}else{
el.style[property]=value;
return true;}
break;
case "backgroundPositionX":
if(w3cMode){
var _y=QZFL.dom.getStyle(el,"backgroundPositionY");
el.style["backgroundPosition"]=value+" "+(_y||"top");}else{
el.style[property]=value;}
break;
case "backgroundPositionY":
if(w3cMode){
var _x=QZFL.dom.getStyle(el,"backgroundPositionX");
el.style["backgroundPosition"]=(_x||"left")+" "+value;}else{
el.style[property]=value;}
break;
default:
if(typeof el.style[property]=="undefined"){
return false}
el.style[property]=value;
return true;}},
createNamedElement:function(type,name,doc){
doc=doc||document;
var element;
try{
element=doc.createElement('<'+type+' name="'+name+'">');}catch(ignore){}
if(!element||!element.name){
element=doc.createElement(type);
element.name=name;}
return element;},
getPosition:function(el){
var xy=QZFL.dom.getXY(el);
var size=QZFL.dom.getSize(el);
return{
"top":xy[1],
"left":xy[0],
"width":size[0],
"height":size[1]};},
setPosition:function(el,pos){
QZFL.dom.setXY(el,pos['left'],pos['top']);
QZFL.dom.setSize(el,pos['width'],pos['height']);},
getXY:function(el){
var _t=0;
var _l=0;
if(document.documentElement.getBoundingClientRect){
var box=el.getBoundingClientRect();
var oDoc=el.ownerDocument;
var _fix=QZFL.userAgent.ie?2:0;
_t=box.top-_fix+this.getScrollTop(oDoc);
_l=box.left-_fix+this.getScrollLeft(oDoc);}else{
while(el.offsetParent){
_t+=el.offsetTop;
_l+=el.offsetLeft;
el=el.offsetParent;}}
return[_l,_t];},
getSize:function(el){
var _w=el.offsetWidth;
var _h=el.offsetHeight;
return[_w,_h];},
setXY:function(el,x,y){
el=this.get(el);
var _ml=parseInt(this.getStyle(el,"marginLeft"))||0;
var _mt=parseInt(this.getStyle(el,"marginTop"))||0;
this.setStyle(el,"left",parseInt(x)-_ml+"px");
this.setStyle(el,"top",parseInt(y)-_mt+"px");},
getScrollLeft:function(doc){
doc=doc||document;
return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},
getScrollTop:function(doc){
doc=doc||document;
return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},
getScrollHeight:function(doc){
doc=doc||document;
return Math.max(doc.documentElement.scrollHeight,doc.body.scrollHeight);},
getScrollWidth:function(doc){
doc=doc||document;
return Math.max(doc.documentElement.scrollWidth,doc.body.scrollWidth);},
setScrollLeft:function(value,doc){
doc=doc||document;
doc[doc.compatMode=="CSS1Compat"&&!QZFL.userAgent.safari?"documentElement":"body"].scrollLeft=value;},
setScrollTop:function(value,doc){
doc=doc||document;
doc[doc.compatMode=="CSS1Compat"&&!QZFL.userAgent.safari?"documentElement":"body"].scrollTop=value;},
getClientHeight:function(doc){
doc=doc||document;
return doc.compatMode=="CSS1Compat"?doc.documentElement.clientHeight:doc.body.clientHeight;},
getClientWidth:function(doc){
doc=doc||document;
return doc.compatMode=="CSS1Compat"?doc.documentElement.clientWidth:doc.body.clientWidth;},
setSize:function(el,width,height){
el=this.get(el);
var _wFix=/\d+([a-z%]+)/i.exec(width);
_wFix=_wFix?_wFix[1]:"";
var _hFix=/\d+([a-z%]+)/i.exec(height);
_hFix=_hFix?_hFix[1]:"";
this.setStyle(el,"width",(!width||width<0||/auto/i.test(width))?"auto":(parseInt(width)+(_wFix||"px")));
this.setStyle(el,"height",(!height||height<0||/auto/i.test(height))?"auto":(parseInt(height)+(_hFix||"px")));},
getDocumentWindow:function(doc){
_doc=doc||document;
return _doc.parentWindow||_doc.defaultView;},
getElementsByTagNameNS:function(node,ns,tgn){
var res=[];
if(node){
if(node.getElementsByTagNameNS){
return node.getElementsByTagName(ns+":"+tgn);}else if(node.getElementsByTagName){
var n=document.namespaces;
if(n.length>0){
var l=node.getElementsByTagName(tgn);
for(var i=0,len=l.length;i<len;++i){
if(l[i].scopeName==ns){
res.push(l[i]);}}}}}
return res;}};
var _CN=QZFL.dom.createNamedElement;
var $=QZFL.dom.getById;
var removeNode=QZFL.dom.removeElement;
QZFL.css={
getClassRegEx:function(className){
var re=QZFL.css.classNameCache[className];
if(!re){
re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');
QZFL.css.classNameCache[className]=re;}
return re;},
convertHexColor:function(color){
color=/^#/.test(color)?color.substr(1):color;
var reColor=new RegExp("\\w{2}","ig");
color=color.match(reColor);
if(!color||color.length<3){
return[0,0,0]}
var r=parseInt(color[0],16);
var g=parseInt(color[1],16);
var b=parseInt(color[2],16);
return[r,g,b];},
styleSheets:{},
getStyleSheetById:function(id){
try{
return QZFL.dom.get(id).sheet||document.styleSheets[id];}catch(e){
return null}},
getRulesBySheet:function(sheetId){
var ss=QZFL.css.getStyleSheetById(sheetId);
if(ss){
try{
return ss.cssRules||ss.rules;}catch(e){return null}}else{
return null}},
getRuleBySelector:function(sheetId,selector){
var _ss=this.getStyleSheetById(sheetId);
if(!_ss.cacheSelector){
_ss.cacheSelector={}};
if(_ss){
var _rs=_ss.cssRules||_ss.rules;
var re=new RegExp('^'+selector+'$',"i");
var _cs=_ss.cacheSelector[selector];
if(_cs&&re.test(_rs[_cs].selectorText)){
return _rs[_cs];}else{
for(var i=0;i<_rs.length;i++){
if(re.test(_rs[i].selectorText)){
_ss.cacheSelector[selector]=i;
return _rs[i];}}
return null;}}else{
return null;}},
insertCSSLink:function(url,id,sco){
var dom=document;
if(sco!=null){
var dom=sco.document;}
if(id!=null&&dom.getElementById(id)!=null){
return;}
var cssLink=dom.createElement("link");
if(id){cssLink.id=id;}
cssLink.rel="stylesheet";
cssLink.rev="stylesheet";
cssLink.type="text/css";
cssLink.media="screen";
cssLink.href=url;
dom.getElementsByTagName("head")[0].appendChild(cssLink);
return cssLink.sheet||cssLink;},
insertStyleSheet:function(sheetId){
var ss=document.createElement("style");
ss.id=sheetId;
document.getElementsByTagName("head")[0].appendChild(ss);
return ss.sheet||ss;},
removeStyleSheet:function(id){
var _ss=this.getStyleSheetById(id);
if(_ss){
var own=_ss.owningElement||_ss.ownerNode;
QZFL.dom.removeElement(own);}},
hasClassName:function(elem,cname){
return(elem&&cname)?new RegExp('\\b'+trim(cname)+'\\b').test(elem.className):false;},
swapClassName:function(elements,class1,class2){
function _swap(el,c1,c2){
if(QZFL.css.hasClassName(el,c1)){
el.className=el.className.replace(c1,c2);}else if(QZFL.css.hasClassName(el,c2)){
el.className=el.className.replace(c2,c1);}}
if(elements.constructor !=Array){
elements=[elements];}
for(var i=0,len=elements.length;i<len;i++){
_swap(elements[i],class1,class2);}},
replaceClassName:function(elements,sourceClass,targetClass){
function _replace(el,c1,c2){
if(QZFL.css.hasClassName(el,c1)){
el.className=el.className.replace(c1,c2);}}
if(elements.constructor !=Array){
elements=[elements];}
for(var i=0,len=elements.length;i<len;i++){
_replace(elements[i],sourceClass,targetClass);}},
addClassName:function(elem,cname){
if(elem&&cname){
if(elem.className){
if(QZFL.css.hasClassName(elem,cname)){
return false;}else{
elem.className+=' '+trim(cname);
return true;}}else{
elem.className=cname;
return true;}}else{
return false;}},
removeClassName:function(elem,cname){
if(elem&&cname&&elem.className){
var old=elem.className;
elem.className=trim(elem.className.replace(new RegExp('\\b'+trim(cname)+'\\b'),''));
return elem.className!=old;}else{
return false;}},
toggleClassName:function(elem,cname){
var r=QZFL.css;
if(r.hasClassName(elem,cname)){
r.removeClassName(elem,cname);}else{
r.addClassName(elem,cname);}}}
QZFL.css.classNameCache={};
QZFL.event={
KEYS:{
BACKSPACE:8,
TAB:9,
RETURN:13,
ESC:27,
SPACE:32,
LEFT:37,
UP:38,
RIGHT:39,
DOWN:40,
DELETE:46},
extendType:/(click|mousedown|mouseover|mouseout|mouseup|mousemove|scroll|contextmenu|resize)/i,
_eventListDictionary:{},
_fnSeqUID:0,
_objSeqUID:0,
addEvent:function(obj,eventType,fn,argArray){
var cfn=fn,
res=false,l;
if(!obj){
return res;}
if(!obj.eventsListUID){
obj.eventsListUID="e"+(++QZFL.event._objSeqUID);
QZFL.event._eventListDictionary[obj.eventsListUID]={};}
l=QZFL.event._eventListDictionary[obj.eventsListUID];
if(!fn.__elUID){
fn.__elUID="e"+(++QZFL.event._fnSeqUID)+obj.eventsListUID;}
if(!l[eventType]){
l[eventType]={};}
if(typeof(l[eventType][fn.__elUID])=='function'){
return false;}
if(QZFL.event.extendType.test(eventType)){
argArray=argArray||[];
cfn=function(e){
return fn.apply(null,([QZFL.event.getEvent(e)]).concat(argArray));};}
if(obj.addEventListener){
obj.addEventListener(eventType,cfn,false);
res=true;}else if(obj.attachEvent){
res=obj.attachEvent("on"+eventType,cfn);}else{
res=false;}
if(res){
l[eventType][fn.__elUID]=cfn;}
return res;},
removeEvent:function(obj,eventType,fn){
var cfn=fn,res=false,l;
if(!obj){
return res;}
if(!cfn){
return QZFL.event.purgeEvent(obj,eventType);}
if(!obj.eventsListUID){
obj.eventsListUID="e"+(++QZFL.event._objSeqUID);
QZFL.event._eventListDictionary[obj.eventsListUID]={};}
l=QZFL.event._eventListDictionary[obj.eventsListUID];
if(!fn.__elUID){
fn.__elUID="e"+(++QZFL.event._fnSeqUID)+obj.eventsListUID;}
if(!l[eventType]){
l[eventType]={};}
if(QZFL.event.extendType.test(eventType)&&
l[eventType]&&
l[eventType][fn.__elUID]){
cfn=l[eventType][fn.__elUID];}
if(obj.removeEventListener){
obj.removeEventListener(eventType,cfn,false);
res=true;}else if(obj.detachEvent){
obj.detachEvent("on"+eventType,cfn);
res=true;}else{
rt.error("Error.!.");
return false;}
if(res&&l[eventType]){
delete l[eventType][fn.__elUID];}
return res;},
purgeEvent:function(obj,type){
var l;
if(obj.eventsListUID&&(l=QZFL.event._eventListDictionary[obj.eventsListUID])&&l[type]){
for(var k in l[type]){
if(obj.removeEventListener){
obj.removeEventListener(type,l[type][k],
false);}else if(obj.detachEvent){
obj.detachEvent('on'+type,l[type][k]);}}}
if(obj['on'+type]){
obj['on'+type]=null;}
if(l){
l[type]=null;
delete l[type];}
return true;},
getEvent:function(evt){
evt=evt||window.event;
if(!evt&&!QZFL.userAgent.ie){
var c=this.getEvent.caller,
cnt=1;
while(c){
evt=c.arguments[0];
if(evt&&Event==evt.constructor){
break;}else if(cnt>32){
break;}
c=c.caller;
cnt++;}}
return evt;},
getButton:function(evt){
var e=QZFL.event.getEvent(evt);
if(!e){
return -1}
if(QZFL.userAgent.ie){
return e.button-Math.ceil(e.button/2);}else{
return e.button;}},
getTarget:function(evt){
var e=QZFL.event.getEvent(evt);
if(e){
return e.target||e.srcElement;}else{
return null;}},
getCurrentTarget:function(evt){
var e=QZFL.event.getEvent(evt);
if(e){
return e.currentTarget||document.activeElement;}else{
return null;}},
cancelBubble:function(evt){
evt=QZFL.event.getEvent(evt);
if(!evt){
return false}
if(evt.stopPropagation){
evt.stopPropagation();}else{
if(!evt.cancelBubble){
evt.cancelBubble=true;}}},
preventDefault:function(evt){
evt=QZFL.event.getEvent(evt);
if(!evt){
return false}
if(evt.preventDefault){
evt.preventDefault();}else{
evt.returnValue=false;}},
mouseX:function(evt){
evt=QZFL.event.getEvent(evt);
return evt.pageX||(evt.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},
mouseY:function(evt){
evt=QZFL.event.getEvent(evt);
return evt.pageY||(evt.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},
getRelatedTarget:function(ev){
ev=QZFL.event.getEvent(ev);
var t=ev.relatedTarget;
if(!t){
if(ev.type=="mouseout"){
t=ev.toElement;}else if(ev.type=="mouseover"){
t=ev.fromElement;}else{}}
return t;},
bind:function(obj,method){
var args=Array.prototype.slice.call(arguments,2);
return function(){
var _obj=obj||this;
var _args=args.concat(Array.prototype.slice.call(arguments,0));
if(typeof(method)=="string"){
if(_obj[method]){
return _obj[method].apply(_obj,_args);}}else{
return method.apply(_obj,_args);}}}};
QZFL.event.on=QZFL.event.addEvent;
window.addEvent=QZFL.event.addEvent;
window.removeEvent=QZFL.event.removeEvent;
window.getEvent=QZFL.event.getEvent;
QZFL.cookie={
set:function(name,value,domain,path,hour){
if(hour){
var today=new Date();
var expire=new Date();
expire.setTime(today.getTime()+3600000*hour);}
document.cookie=name+"="+value+"; "+(hour?("expires="+expire.toGMTString()+"; "):"")+(path?("path="+path+"; "):"path=/; ")+(domain?("domain="+domain+";"):("domain="+QZFL.config.domainPrefix+";"));
return true;},
get:function(name){
var r=new RegExp("(?:^|;+|\\s+)"+name+"=([^;]*)");
var m=document.cookie.match(r);
return(!m?"":m[1]);},
del:function(name,domain,path){
document.cookie=name+"=; expires=Mon, 26 Jul 1997 05:00:00 GMT; "+(path?("path="+path+"; "):"path=/; ")+(domain?("domain="+domain+";"):("domain="+QZFL.config.domainPrefix+";"));}};
QZFL.dragdrop={
dragdropPool:{},
dragTempId:0,
_scrollRange:0,
dragGhostStyle:"cursor:move;position:absolute;border:1px solid #06c;background:#6cf;z-index:1000;color:#003",
registerDragdropHandler:function(handler,target,options){
var _e=QZFL.event;
var _hDom=QZFL.dom.get(handler);
var _tDom=QZFL.dom.get(target);
options=options||{
range:[null,null,null,null],
ghost:0};
if(!_hDom){
return null}
var targetObject=_tDom||_hDom;
if(!_hDom.id){
_hDom.id="dragdrop_"+this.dragTempId;
QZFL.dragdrop.dragTempId++;}
_hDom.style.cursor=options.cursor||"move";
this.dragdropPool[_hDom.id]=new this.eventController();
_e.on(_hDom,"mousedown",_e.bind(this,this.startDrag),[_hDom.id,targetObject,options]);
return this.dragdropPool[_hDom.id];},
unRegisterDragdropHandler:function(handler){
var _hDom=QZFL.dom.get(handler);
var _e=QZFL.event;
if(!_hDom){
return null}
_hDom.style.cursor="default";
delete this.dragdropPool[_hDom.id];
_e.removeEvent(_hDom,"mousedown");},
startDrag:function(e,handlerId,target,options){
var _d=QZFL.dom;
var _e=QZFL.event;
if(_e.getButton()!=0||_e.getTarget().noDrag){
return;}
if(options.ignoreTagName==_e.getTarget().tagName||_e.getTarget().noDragdrop){
return;}
var size=_d.getSize(target);
var stylePosition=_d.getStyle(target,"position");
var isAbsolute=stylePosition=="absolute"||stylePosition=="fixed";
var ghost=null,hasGhost=false;
var xy=null;
if(options.rangeElement){
var _re=options.rangeElement;
var _el=QZFL.dom.get(_re[0]);
var _elXY=QZFL.dom.getSize(_el);
var _r=_re[1];
options.range=[_r[0]?0:null,_r[1]?0:null,_r[2]?_elXY[1]:null,_r[3]?_elXY[0]:null];}
if(!isAbsolute||options.ghost){
xy=isAbsolute?[parseInt(target.style.left),parseInt(target.style.top)]:_d.getXY(target);
ghost=_d.createElementIn("div",isAbsolute?target.parentNode:document.body,false,{
style:this.dragGhostStyle});
ghost.id="dragGhost";
_d.setStyle(ghost,"opacity","0.8");
setTimeout(function(){
_d.setStyle(target,"opacity","0.5");},0);
if(options.ghostSize){
_d.setSize(ghost,options.ghostSize[0],options.ghostSize[1]);
xy=[e.clientX+QZFL.dom.getScrollLeft()-30,e.clientY+QZFL.dom.getScrollTop()-20];}else{
_d.setSize(ghost,size[0]-2,size[1]-2);}
_d.setXY(ghost,xy[0],xy[1]);
hasGhost=true;}else{
xy=[parseInt(_d.getStyle(target,"left")),parseInt(_d.getStyle(target,"top"))];}
var dragTarget=ghost||target;
this.currentDragCache={
size:size,
xy:xy,
mXY:xy,
dragTarget:dragTarget,
target:target,
x:e.clientX-parseInt(xy[0]),
y:e.clientY-parseInt(xy[1]),
ghost:ghost,
hasGhost:hasGhost,
isAbsolute:isAbsolute,
options:options,
scrollRangeTop:QZFL.dragdrop._scrollRange,
scrollRangeBottom:QZFL.dom.getClientHeight()-QZFL.dragdrop._scrollRange,
maxScrollRange:Math.max(QZFL.dom.getScrollHeight()-QZFL.dom.getClientHeight(),0)}
_e.on(document,"mousemove",_e.bind(this,this.doDrag),[handlerId,this.currentDragCache,options]);
_e.on(document,"mouseup",_e.bind(this,this.endDrag),[handlerId,this.currentDragCache,options]);
this.dragdropPool[handlerId].onStartDrag.apply(null,[e,handlerId,this.currentDragCache,options]);
_e.preventDefault();},
doDrag:function(e,handlerId,dragCache,options){
var pos={};
if(options.autoScroll){
if(e.clientY<dragCache.scrollRangeTop){
if(!QZFL.dragdrop._scrollTop){
QZFL.dragdrop._stopScroll();
QZFL.dragdrop._scrollTimer=setTimeout(function(){
QZFL.dragdrop._doScroll(true,dragCache)},200);}}else if(e.clientY>dragCache.scrollRangeBottom){
if(!QZFL.dragdrop._scrollBottom){
QZFL.dragdrop._stopScroll();
QZFL.dragdrop._scrollTimer=setTimeout(function(){
QZFL.dragdrop._doScroll(false,dragCache)},200);}}else{
QZFL.dragdrop._stopScroll();}}
var mX=e.clientX-dragCache.x;
var mY=e.clientY-dragCache.y;
var xy=this._countXY(mX,mY,dragCache.size,options);
mX=xy.x;
mY=xy.y;
QZFL.dom.setXY(dragCache.dragTarget,mX,mY);
dragCache.mXY=[mX,mY];
this.dragdropPool[handlerId].onDoDrag.apply(null,[e,handlerId,dragCache,options]);
if(QZFL.userAgent.ie){
document.body.setCapture();}
QZFL.event.preventDefault();},
endDrag:function(e,handlerId,dragCache,options){
var _d=QZFL.dom;
if(dragCache.hasGhost){
QZFL.dom.removeElement(dragCache.dragTarget);
var _t=dragCache.target;
setTimeout(function(){
QZFL.dom.setStyle(_t,"opacity","1");
_t=null;},0);
if(dragCache.isAbsolute){
var x=parseInt(_d.getStyle(dragCache.target,"left"))+(dragCache.mXY[0]-dragCache.xy[0]);
var y=parseInt(_d.getStyle(dragCache.target,"top"))+(dragCache.mXY[1]-dragCache.xy[1]);
var xy=this._countXY(x,y,dragCache.size,options);
QZFL.dom.setXY(dragCache.target,xy.x,xy.y);}}
QZFL.event.removeEvent(document,"mousemove");
QZFL.event.removeEvent(document,"mouseup");
this.dragdropPool[handlerId].onEndDrag.apply(null,[e,handlerId,dragCache,options]);
dragCache=null;
QZFL.dragdrop._stopScroll();
if(QZFL.userAgent.ie){
document.body.releaseCapture();}},
_doScroll:function(isUp,dc){
step=isUp?-15:15;
var _st=QZFL.dom.getScrollTop();
if(isUp&&_st+step<0){
step=0;}
if(!isUp&&_st+step>dc.maxScrollRange){
step=0;}
QZFL.dom.setScrollTop(_st+step);
dc.y=dc.y-step;
QZFL.dragdrop._scrollTop=isUp;
QZFL.dragdrop._scrollBottom=!isUp;
QZFL.dragdrop._scrollTimer=setTimeout(function(){
QZFL.dragdrop._doScroll(isUp,dc)},16);},
_stopScroll:function(){
QZFL.dragdrop._scrollTop=QZFL.dragdrop._scrollBottom=false;
clearTimeout(QZFL.dragdrop._scrollTimer);},
_countXY:function(x,y,size,options){
var pos={
x:x,
y:y};
if(options.x){
pos["x"]=parseInt(pos["x"]/options.x,10) * options.x + (pos["x"] % options.x<options.x/2?0:options.x);}
if(options.y){
pos["y"]=parseInt(pos["y"]/options.y,10) * options.y + (pos["y"] % options.y<options.y/2?0:options.y);}
if(options.range){
var _r=options.range;
var i=0,j=0;
while(i<_r.length&&j<2){
if(typeof _r[i]!="number"){
i++;
continue;};
var k=i%2?"x":"y";
var v=pos[k];
pos[k]=i<2?Math.max(pos[k],_r[i]):Math.min(pos[k],_r[i]-size[(i+1)%2]);
if(pos[k]!=v){
j++;};
i++;}}
return pos;}};
QZFL.dragdrop.eventController=function(){
this.onStartDrag=QZFL.emptyFn
this.onDoDrag=QZFL.emptyFn
this.onEndDrag=QZFL.emptyFn};
QZFL.Tween=function(el,property,func,startValue,finishValue,duration){
this._func=func||QZFL.transitions.simple;
this._obj=QZFL.dom.get(el);
this.isColor=/^#/.test(startValue);
this._prop=property;
var reSuffix=/\d+([a-z%]+)/i.exec(startValue);
this._suffix=reSuffix?reSuffix[1]:"";
this._startValue=this.isColor?0:parseFloat(startValue);
this._finishValue=this.isColor?100:parseFloat(finishValue);
if(this.isColor){
this._startColor=QZFL.css.convertHexColor(startValue);
this._finishColor=QZFL.css.convertHexColor(finishValue);}
this._duration=duration||10;
this._timeCount=0;
this._startTime=0;
this._changeValue=this._finishValue-this._startValue;
this.currentValue=0;
this.isPlayed=false;
this.isLoop=false;
this.onMotionStart=QZFL.emptyFn;
this.onMotionChange=QZFL.emptyFn;
this.onMotionStop=QZFL.emptyFn;};
QZFL.Tween.prototype.start=function(loop){
this._reloadTimer();
this.isPlayed=true;
this._runTime();
this.isLoop=loop?true:false;
this.onMotionStart.apply(this);
return "d"};
QZFL.Tween.prototype.pause=function(){
this.isPlayed=false;};
QZFL.Tween.prototype.stop=function(){
this.isPlayed=false;
this._playTime(this._duration+0.1);};
QZFL.Tween.prototype._reloadTimer=function(){
this._startTime=new Date().getTime()-this._timeCount*1000;};
QZFL.Tween.prototype._playTime=function(time){
var _isEnd=false;
if(time>this._duration){
time=this._duration;
_isEnd=true;}
var pValue=this._func(time,this._startValue,this._changeValue,this._duration);
this.currentValue=/(opacity)/i.test(this._prop)?pValue:Math.round(pValue);
if(this.isColor){
this.currentValue=this.getColor(this._startColor,this._finishColor,pValue);}
var _try2setCSS=QZFL.dom.setStyle(this._obj,this._prop,this.currentValue+this._suffix);
if(!_try2setCSS){
this._obj[this._prop]=this.currentValue+this._suffix;}
this.onMotionChange.apply(this,[this._obj,this._prop,this.currentValue]);
if(_isEnd){
this.isPlayed=false;
if(this.isLoop){
this.isPlayed=true;
this._reloadTimer();}
this.onMotionStop.apply(this);
if(window.CollectGarbage)
CollectGarbage();}};
QZFL.Tween.prototype._runTime=function(){
var o=this;
if(o.isPlayed){
o._playTime((new Date().getTime()-this._startTime)/1000);
setTimeout(function(){
o._runTime.apply(o,[])},0);}};
QZFL.Tween.prototype.getPercent=function(){
return(this.currentValue-this._startValue)/this._changeValue*100;};
QZFL.Tween.prototype.swapValue=function(){
if(this.isColor){
var tempValue=this._startColor.join(",");
this._startColor=this._finishColor;
this._finishColor=tempValue.split(",");}else{
var tempValue=this._startValue;
this._startValue=this._finishValue;
this._finishValue=tempValue;
this._changeValue=this._finishValue-this._startValue;}};
QZFL.Tween.prototype.getColor=function(startColor,finishColor,percent){
var _sc=startColor;
var _fc=finishColor;
var _color=[];
if(percent>100){
percent=100;}
if(percent<0){
percent=0;}
for(var i=0;i<3;i++){
_color[i]=Math.floor(_sc[i]*1+(percent/100)*(_fc[i]-_sc[i])).toString(16);
if(_color[i].length<2){
_color[i]="0"+_color[i];}}
return "#"+_color.join("");};
QZFL.transitions={
simple:function(time,startValue,changeValue,duration){
return changeValue*time/duration+startValue;},
regularEaseIn:function(t,b,c,d){
return c*(t/=d)*t+b;},
regularEaseOut:function(t,b,c,d){
return -c*(t/=d)*(t-2)+b;},
regularEaseInOut:function(t,b,c,d){
if((t/= d/ 2)<1){
return c/2*t*t+b;}
return -c/2*((--t)*(t-2)-1)+b;}}
QZFL.namespace.extend(QZFL.transitions,{
backEaseIn:function(t,b,c,d){
var s=1.70158;
return c*(t/=d)*t*((s+1)*t-s)+b;},
backEaseOut:function(t,b,c,d,a,p){
var s=1.70158;
return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},
backEaseInOut:function(t,b,c,d,a,p){
var s=1.70158;
if((t/= d/ 2)<1){
return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},
bounceEaseOut:function(t,b,c,d){
if((t/= d)<(1/ 2.75)){
return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){
return c*(7.5625*(t-=(1.5/ 2.75))* t+ 0.75)+ b;} else if(t<(2.5/ 2.75)){
return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}else{
return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;}},
bounceEaseIn:function(t,b,c,d){
return c-QZFL.transitions.bounceEaseOut(d-t,0,c,d)+b;},
bounceEaseInOut:function(t,b,c,d){
if(t<d/2){
return QZFL.transitions.bounceEaseIn(t*2,0,c,d)*0.5+b;}else
return QZFL.transitions.bounceEaseOut(t*2-d,0,c,d)*0.5+c*0.5+b;},
strongEaseIn:function(t,b,c,d){
return c*(t/=d)*t*t*t*t+b;},
strongEaseOut:function(t,b,c,d){
return c*((t=t/d-1)*t*t*t*t+1)+b;},
strongEaseInOut:function(t,b,c,d){
if((t/= d/ 2)<1){
return c/2*t*t*t*t*t+b;}
return c/2*((t-=2)*t*t*t*t+2)+b;},
elasticEaseIn:function(t,b,c,d,a,p){
if(t==0)
return b;
if((t/=d)==1)
return b+c;
if(!p)
p=d*0.3;
if(!a||a<Math.abs(c)){
a=c;
var s=p/4;}else{
var s=p/(2* Math.PI)* Math.asin(c/ a);}
return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},
elasticEaseOut:function(t,b,c,d,a,p){
if(t==0)
return b;
if((t/=d)==1)
return b+c;
if(!p)
p=d*0.3;
if(!a||a<Math.abs(c)){
a=c;
var s=p/4;}else{
var s=p/(2* Math.PI)* Math.asin(c/ a);}
return(a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b);},
elasticEaseInOut:function(t,b,c,d,a,p){
if(t==0){
return b;}
if((t/= d/ 2)==2){
return b+c;}
if(!p){
var p=d*(0.3*1.5);}
if(!a||a<Math.abs(c)){
var a=c;
var s=p/4;}else{
var s=p/(2* Math.PI)* Math.asin(c/ a);}
if(t<1){
return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;}});
QZFL.dialog={
items:[],
lastFocus:null,
tween:true,
create:function(title,content,width,height,useTween,noBorder){
var _i=this.items;
_i.push(new QZFL.DialogHandler(_i.length,noBorder,useTween));
var dialog=_i[_i.length-1];
dialog.init(width||300,height||200);
dialog.fillTitle(title||"");
dialog.fillContent(content||"");
return dialog;},
createBorderNone:function(content,width,height){
var _i=this.items;
var dialog;
_i.push(dialog=(new QZFL.DialogHandler(_i.length,true)));
dialog.init(width||300,height||200,true);
dialog.fillContent(content||"");
return dialog;}};
QZFL.DialogHandler=function(id,isNoBorder,useTween){
this._id=id;
this._isIE6=(QZFL.userAgent.ie&&QZFL.userAgent.ie<7);
this.id="dialog_"+id;
this.mainId="dialog_main_"+id;
this.headId="dialog_head_"+id;
this.titleId="dialog_title_"+id;
this.closeId="dialog_button_"+id;
this.contentId="dialog_content_"+id;
this.frameId="dialog_frame_"+id;
this.useTween=(typeof(useTween)!="boolean")?QZFL.dialog.tween:useTween;
this.zIndex=6000+this._id;
this.iconClass="none";
this.onBeforeUnload=function(){
return true;};
this.onUnload=QZFL.emptyFn;
this.isFocus=false;
var _t=[
'<div id="',this.mainId,'" class="',(isNoBorder?"":"layer_global_main"),
'">',
'<div id=',this.headId,' class="',(isNoBorder?"none":"layer_global_title"),
'">',
'<h3><img src="/ac/b.gif" alt="icon" class="',this.iconClass,'"/><span id=',this.titleId,' ></span></h3>',
'<button id="',this.closeId,'" title="关闭"><span class="none">&#9587;</span></button>',
'</div>',
'<div id="',this.contentId,'" class="',(isNoBorder?"":"layer_global_cont"),
'"></div>',
'</div>'];
if(this._isIE6&&!isNoBorder){
_t.push('<iframe id="'+this.frameId+'" style="position:absolute;width:100%;top:0px;z-index:-1;"></iframe>');}
this.temlate=_t.join("");};
QZFL.DialogHandler.prototype.init=function(width,height,isNoneBerder){
this.dialog=document.createElement("div");
this.dialog.id=this.id;
var _l=(QZFL.dom.getClientWidth()-width)/2+QZFL.dom.getScrollLeft();
var _t=Math.max((QZFL.dom.getClientHeight()-height)/2+QZFL.dom.getScrollTop(),0);
with(this.dialog){
if(!isNoneBerder){
className="layer_global";}
style.position="absolute";
style.left=_l+"px";
style.top=_t+"px";
style.zIndex=this.zIndex;
innerHTML=this.temlate;}
document.body.appendChild(this.dialog);
this.dialogClose=QZFL.dom.get(this.closeId);
var o=this;
QZFL.event.addEvent(this.dialog,"mousedown",QZFL.event.bind(o,o.focus));
QZFL.event.addEvent(this.dialogClose,"click",function(){
var t=QZFL.dialog.items[o._id];
if(t){
t.unload();}})
if(QZFL.dragdrop){
QZFL.dragdrop.registerDragdropHandler(QZFL.dom.get(this.headId),QZFL.dom.get(this.id),{
range:[0,null,null,null],
ghost:0});}
this.focus();
this.setSize(width,height);
if(this.useTween&&QZFL.Tween){
QZFL.dom.setStyle(this.dialog,"opacity",0);
var tween1=new QZFL.Tween(this.dialog,"top",QZFL.transitions.regularEaseIn,_t-30+"px",_t+"px",0.3);
tween1.onMotionChange=function(){
QZFL.dom.setStyle(o.dialog,"opacity",this.getPercent()/100);}
tween1.onMotionStop=function(){
QZFL.dom.setStyle(o.dialog,"opacity",1);
tween1=null;}
tween1.start();}else{}};
QZFL.DialogHandler.prototype.focus=function(title){
if(this.isFocus){
return;}
this.dialog.style.zIndex=this.zIndex+3000;
if(QZFL.dialog.lastFocus){
QZFL.dialog.lastFocus.blur();};
this.isFocus=true;
QZFL.dialog.lastFocus=this;};
QZFL.DialogHandler.prototype.blur=function(title){
this.isFocus=false;
this.dialog.style.zIndex=this.zIndex;};
QZFL.DialogHandler.prototype.getZIndex=function(){
return this.dialog.style.zIndex;};
QZFL.DialogHandler.prototype.fillTitle=function(title){
var _t=QZFL.dom.get(this.titleId);
_t.innerHTML=title;};
QZFL.DialogHandler.prototype.fillContent=function(html){
var _c=QZFL.dom.get(this.contentId);
_c.innerHTML=html;};
QZFL.DialogHandler.prototype.setSize=function(width,height){
var _m=QZFL.dom.get(this.id);
var _c=QZFL.dom.get(this.contentId);
height=height-28<0?50:height-28;
_m.style.width=width+"px";
_c.style[QZFL.userAgent.ie<7?"height":"minHeight"]=height+"px";
if(this._isIE6){
var _s=QZFL.dom.getSize(QZFL.dom.get(this.mainId));
var _f=QZFL.dom.get(this.frameId);
QZFL.dom.setSize(_f,_s[0],_s[1]);}};
QZFL.DialogHandler.prototype.unload=function(){
if(!this.onBeforeUnload()){
return;};
var o=this;
if(this.useTween&&QZFL.Tween){
var tween1=new QZFL.Tween(this.dialog,"opacity",QZFL.transitions.regularEaseIn,1,0,0.2);
tween1.onMotionStop=function(){
o._unload();
tween1=null;};
tween1.start();}else{
this._unload();};};
QZFL.DialogHandler.prototype._unload=function(){
this.onUnload();
if(QZFL.dragdrop){
QZFL.dragdrop.unRegisterDragdropHandler(QZFL.dom.get(this.headId));}
this.dialog.innerHTML="";
QZFL.dom.removeElement(this.dialog);
delete QZFL.dialog.items[this._id];};
QZFL.maskLayout={
count:0,
items:{},
create:function(zindex,_doc){
this.count++;
zindex=zindex||5000;
_doc=_doc||document;
var _m=QZFL.dom.createElementIn("div",_doc.body,false,{
className:"qz_mask_layout"});
var _h=(QZFL.userAgent.ie&&QZFL.userAgent.ie<7)?Math.max(_doc.documentElement.scrollHeight,
_doc.body.scrollHeight):QZFL.dom.getClientHeight();
_m.style.zIndex=zindex;
_m.style.height=_h+"px";
this.items[this.count]=_m;
return this.count;},
remove:function(countId){
QZFL.dom.removeElement(this.items[countId]);
delete this.items[countId];}};
