var joeUtility;if(!joeUtility)throw new Error("joeUtility has not been loaded!");var joeAjax;if(!joeAjax)throw new Error("joeAjax has not been loaded!");var joePopup;if(!joePopup)joePopup={};else if(typeof joePopup!="object")throw new Error("joePopup already exists and is not an object");joePopup.Class={};joePopup.Functions={};joePopup.TempVars={};joePopup.Class.popup=function(){this.path='/js/joe/lib/module/popup';this.loaderImgId='joePopup_defaultLoader';this.loaderDivId='joePopup_defaultLoaderDiv';this.styleContainerName='joePopup_divContainer';this.styleCNObj;this.preLoaderImg={'location':'/images/default_loading.gif','width':16,'height':16};this.globalConfig={'global_on_off':'on','on_off':'on','style':'Drag_me','trig_evt':'onclick','act':'style','data':'add default data','target':'xml','mouseClose':1};this.obj_self=this;this.xmlHttp=new joeAjax.getPage();};joePopup.Class.popup.prototype._loadPopup=function(l){l.blur();var newConfig={};eval('newConfig={'+l.rel+'};');this.tempConfig=joeUtility.objectCombiner(this.globalConfig,newConfig);if(this.tempConfig.global_on_off=='on'){if(this.tempConfig.on_off=='on'){this.specialPixels=(joeUtility.broswer.name()=='msie')?(-2):(0);this.dl=joeUtility.$id(this.loaderImgId);this.dld=joeUtility.$id(this.loaderDivId);this.ele={options:joeUtility.position.get(l),optionsCenter:joeUtility.position.getCenter(l)};if(!this.dl|| !this.dld){var f=window.document.getElementsByTagName('body');}if(!this.dl){var g=joeUtility.makeHTMLElement('img',{id:this.loaderImgId});f[0].appendChild(g);this.dl=joeUtility.$id(this.loaderImgId);this.dl.className='joePopup_defaultLoaderImg';}this.dl.style.top=Math.floor((this.ele.optionsCenter.top-(this.preLoaderImg.height/2))+this.specialPixels)+'px';this.dl.style.left=Math.floor((this.ele.optionsCenter.left-(this.preLoaderImg.width/2))+this.specialPixels)+'px';this.dl.src=this.path+this.preLoaderImg.location;this.dl.style.display='block';if(!this.dld){var j=joeUtility.makeHTMLElement('div',{id:this.loaderDivId});f[0].appendChild(j);this.dld=joeUtility.$id(this.loaderDivId);this.dld.className='joePopup_defaultLoaderDiv';}this.dld.style.width=this.ele.options.width+'px';this.dld.style.height=this.ele.options.height+'px';this.dld.style.top=this.ele.options.top+this.specialPixels+'px';this.dld.style.left=this.ele.options.left+this.specialPixels+'px';this.dld.style.display='block';if(joeUtility.broswer.name()=='msie'){var n=navigator.userAgent.toLowerCase();var o=n.substring(n.indexOf("msie"),n.indexOf(";",n.indexOf("msie")));o=o.split(" ");if(o[1]=='6.0'){setTimeout(function(){var img=joeUtility.$id(joePopup.TempVars.popup_obj.loaderImgId);img.src=img.src;},50);}}this.xmlHttp.returnFunction=joeUtility.bindWithTriggerXtraFunc(this.obj_self,'_readResponse');var params='act='+this.tempConfig.act+'&style='+this.tempConfig.style+'&data='+this.tempConfig.data+'&target='+this.tempConfig.target;this.xmlHttp._fetch({'loc':this.path+'/ajax/getData.php','params':params});}}};joePopup.Class.popup.prototype._closeMe=function(){this.dl.style.display='none';this.dld.style.display='none';this.styleCNObj.style.display='none';if(this.globalConfig.mouseClose){joeUtility.evtHandler.remove(document,"mousedown",joePopup.Functions.closeMeTrigger);this.dld.innerHTML='';}};joePopup.Class.popup.prototype._readResponse=function(l){m=l.responseXML;var xmlDoc=m.documentElement;var js,data='',c,joe_popup;js=xmlDoc.getElementsByTagName("popup_js")[0].firstChild.data;data=xmlDoc.getElementsByTagName("popup_data")[0];if(data.childNodes.length>1){var r='';for(var i=0;i<data.childNodes.length;i++){r+=data.childNodes[i].data;}data=r;}else{data=data.firstChild.data;}if(this.tempConfig.target=='iframe')content=xmlDoc.getElementsByTagName("popup_content")[0].firstChild.data;this.styleCNObj=joeUtility.$id(this.styleContainerName);if(!this.styleCNObj){joe_popup=joeUtility.makeHTMLElement('div',{id:this.styleContainerName});c=joeUtility.$tn('body');c[0].appendChild(joe_popup);this.styleCNObj=joeUtility.$id(this.styleContainerName);}if(this.globalConfig.mouseClose){joeUtility.evtHandler.add(document,"mousedown",joePopup.Functions.closeMeTrigger);this.styleCNObj.onmouseover=function(){joeUtility.evtHandler.remove(document,"mousedown",joePopup.Functions.closeMeTrigger);};this.styleCNObj.onmouseout=function(){joeUtility.evtHandler.add(document,"mousedown",joePopup.Functions.closeMeTrigger);};}this.styleCNObj.innerHTML=data;this.styleCNObj.style.display='none';eval(js);};joePopup.Class.popup.prototype._recall=function(data){this.tempConfig.data=data;this.xmlHttp.returnFunction=joeUtility.bindWithTriggerXtraFunc(this.obj_self,'_recallReadResponse');var params='act='+this.tempConfig.act+'&style='+this.tempConfig.style+'&data='+this.tempConfig.data+'&target='+this.tempConfig.target;this.xmlHttp._fetch({'loc':this.path+'/ajax/getData.php','params':params});};joePopup.Class.popup.prototype._recallReadResponse=function(l){m=l.responseXML;var xmlDoc=m.documentElement;var js,data,c,joe_popup;js=xmlDoc.getElementsByTagName("popup_js")[0].firstChild.data;data=xmlDoc.getElementsByTagName("popup_data")[0].firstChild.data;if(this.tempConfig.target=='iframe')content=xmlDoc.getElementsByTagName("popup_content")[0].firstChild.data;this.styleCNObj=joeUtility.$id(this.styleContainerName);if(!this.styleCNObj){joe_popup=joeUtility.makeHTMLElement('div',{id:this.styleContainerName});c=joeUtility.$tn('body');c[0].appendChild(joe_popup);this.styleCNObj=joeUtility.$id(this.styleContainerName);}eval(js);};joePopup.Functions.findElements=function(){var d=document.getElementsByTagName('a');var popup_list=[];for(var i=0;i<d.length;i++){if(d[i].rev&&d[i].rel){if(d[i].rev=='joe_popup'){popup_list.push(d[i]);}}}if(popup_list.length){joePopup.TempVars.popup_obj=new joePopup.Class.popup();var newConfig={};for(var i=0;i<popup_list.length;i++){eval('newConfig={'+popup_list[i].id+'};');if(newConfig.hasOwnProperty('trig_evt')){if(newConfig.trig_evt=='onmouseover'){popup_list[i].onmouseover=function(){joePopup.TempVars.popup_obj._loadPopup(this);};}else if(newConfig.trig_evt=='onclick'){popup_list[i].onclick=function(){joePopup.TempVars.popup_obj._loadPopup(this);};}}else{popup_list[i].onclick=function(){joePopup.TempVars.popup_obj._loadPopup(this);};}}}};joePopup.Functions.closeMeTrigger=function(){joePopup.TempVars.popup_obj._closeMe();};joePopup.TempVars.loc='/js/joe/lib/module/popup/images/';joePopup.TempVars.k=new Image();joePopup.TempVars.k.src=joePopup.TempVars.loc+'default_loading.gif';joeUtility.evtHandler.add(window,"load",joePopup.Functions.findElements);