var Library=new Class({initialize:function(){this.scriptString='<script type="text/javascript" src="{filename}"><\/script>';this.header=$$("head")[0]},data:{},jsFiles:{},events:[],DS_REPLACE:true,DS_MERGE:false,areAllReceived:function(name){var module=this[name];var stat1=module.html.status;var stat2=module.data.status;var stat3=module.js;if(stat1=="done"&&stat2=="done"&&stat3=="done"){return true}else{return false}},setModule:function(name,opt,func){var stateHtml=(opt.html)?"pending":"done";var stateData=(opt.data)?"pending":"done";var stateJs=(opt.js)?"pending":"done";this[name]={ajaxFunction:func,jsFile:opt.jsf,js:stateJs,html:{status:stateHtml},data:{status:stateData}}},loadModule:function(name){var ajax=this[name].ajaxFunction;ajax()},storeHTML:function(name,index,content){this[name].html[index]=content;this[name].html.status="done"},storeDATA:function(name,index,content){this[name].data[index]=content;this[name].data.status="done"},jsStored:function(name){this[name].js="done"},injectJS:function(filename){if(this.jsFiles[filename]!="y"){var element=new Element("script",{src:filename,type:"text/javascript"});element.inject(this.header,"bottom");this.jsFiles[filename]="y"}},use:function(name,callback){if(this.areAllReceived(name)){callback("done")}else{var ajax=this[name].ajaxFunction;ajax(callback,name)}},getConference:function(number,forceLoad,showWait,callBack){var conference=forceLoad?null:lib.startup_module.data.Conferences[number];if(conference){return true}else{if(showWait!==false){showWatingPopup("Please wait..."+showWait)}var params={};params.service="adminRegistration_module";params.securityname="manage_regs";params.type="json";params.action="getConference";params.number=number;var requestObj={data:params,url:wm.serverAddress+"controller.php",onFailure:function(){destroyPopup();return null},onSuccess:function(response){destroyPopup();checkSessionTimeout(response,function(response){var resp=JSON.decode(response);lib.startup_module.data.Conferences[number]=response.conference;callBack()},null,setupNewRegistration,null)}};var req=new Request(requestObj);req.send();return false}},readyData:function(req,forceLoad,showWait,callback){var destination=this.getDestination(req);var params=destination.params;if(forceLoad){data=false}else{data=this.hasData(destination)}if(data){return true}else{if(showWait!==false){showWatingPopup("Please wait..."+(showWait?showWait:""))}var requestObj={data:params,url:wm.serverAddress+"controller.php",onFailure:function(){destroyPopup();return null},onSuccess:function(response){destroyPopup();var resp=JSON.decode(response);checkSessionTimeout(response,function(response){if(resp){if(destination.storeas){if(destination.index){lib.startup_module.data[destination.location][destination.index]=resp[destination.jsonKey]}else{lib.startup_module.data[destination.location]=resp[destination.jsonKey]}}else{if(destination.index){lib.startup_module.data[destination.location][destination.index]=$H(lib.startup_module.data[destination.location]).extend(resp[destination.jsonKey])}else{lib.startup_module.data[destination.location]=$H(lib.startup_module.data[destination.location]).extend(resp[destination.jsonKey])}}if(callback){callback()}}else{alert("Sorry, we could not get the data you require.  please try again.")}})}};var theReq=new Request(requestObj);theReq.send();return false}},getDestination:function(req){var destination={params:{type:"json"},storeas:this.DS_REPLACE};switch(req.type){case"conference":destination.location="Conferences";destination.index=req.key;destination.params.service="adminRegistration_module";destination.params.securityname="manage_regs";destination.params.action="getConference";destination.params.number=req.key;destination.jsonKey="conference";break;case"archive_conference":destination.location="Archived_Conferences";destination.index=req.key;destination.params.service="adminRegistration_module";destination.params.securityname="manage_regs";destination.params.action="getConference";destination.params.number=req.key;destination.jsonKey="conference";break;case"conferencesBasedOnIDs":destination.location="Archived_Conferences";destination.params.service="eventAdministrations_module";destination.params.securityname="manage_conf";destination.params.action="conferenceSearchBasedOnIDs";destination.params.ids=req.key;destination.jsonKey="archivedConferences";break;case"conferences":destination.location="Conferences";destination.params.service="adminRegistration_module";destination.params.securityname="manage_regs";destination.params.action="getConferences";destination.params.number=req.key;destination.jsonKey="conference";break;case"archive_conferences":destination.location="Archived_Conferences";destination.params.service="eventAdministrations_module";destination.params.securityname="manage_conf";destination.params.action="getArchivedConferences";destination.params.number=req.key;destination.jsonKey="archivedConferences";break;default:return null}return destination},hasData:function(req){var destination=(req.location?req:this.getDestination(req));if(!lib.startup_module.data[destination.location]){lib.startup_module.data[destination.location]=$H({});return false}if(destination.index){data=destination.storeas?lib.startup_module.data[destination.location][destination.index]:lib.startup_module.data[destination.location]}else{data=lib.startup_module.data[destination.location]}return data?true:false},getData:function(req){var destination=(req.location?req:this.getDestination(req));if(!lib.startup_module.data[destination.location]){return null}if(destination.index){data=destination.storeas?lib.startup_module.data[destination.location][destination.index]:lib.startup_module.data[destination.location]}else{data=lib.startup_module.data[destination.location]}return data?data:null},removeData:function(req){var destination=(req.location?req:this.getDestination(req));if(lib.startup_module.data[destination.location]){if(destination.index){lib.startup_module.data[destination.location].erase(destination.index)}else{lib.startup_module.data[destination.location]=null}}}});var wm={edit:-1,registrationStep:-1,regList:null,isLoggedIn:false,currentPopup:null,confChk:false};function doSize(){var el=$(document.body);var size=window.getSize();var makeHeight=size.y-136-26-20;makeHeight=(makeHeight>380)?makeHeight:380;wm.divs.leftContainer.setStyle("height",makeHeight);wm.divs.mainContent.setStyle("height",makeHeight);var tabs=wm.divs.tabs;var tabHeight=tabs.hasClass("hidden")?0:tabs.getElement("li")?tabs.getElement("li").getSize().y+7:0;var remainingHeight=makeHeight-tabHeight-16;var searchResults=$("searchresults");var searchForm=$("searchForm");if(searchResults&&searchForm){var srHeight=makeHeight-tabHeight-20-searchForm.getSize().y-90;searchResults.setStyle("height",srHeight)}wm.divs.fixed.setStyle("height","");var fixedRealSize=wm.divs.fixed.getScrollSize().y+5;var fixedActualSize=(fixedRealSize<remainingHeight)?fixedRealSize:remainingHeight;wm.divs.fixed.setStyle("height",fixedActualSize);if(wm.divs.dynamic){if(!wm.divs.dynamic.hasClass("hidden")){wm.divs.dynamic.setStyle("height",makeHeight-tabHeight-5-fixedActualSize);wm.divs.dynamic.set("height",makeHeight-tabHeight-5-fixedActualSize);if(lib.divtable){lib.divtable.doResize()}}else{wm.divs.fixed.setStyle("height",remainingHeight)}}var loginForm=$("login-form");var newsForm=$("news-form");if(loginForm){var loginContentSize=loginForm.getScrollSize();if(newsForm){newsForm.setStyle("height",makeHeight-loginContentSize.y-6)}else{loginForm.setStyle("height",makeHeight-6)}}else{if(newsForm){newsForm.setStyle("height",makeHeight-6)}}}function submitTxtSearch(){submitSearch($("txtSearch").value);lib.enableTextSearch=true}function catchEnter(identifier,action){var el=$(identifier);if(el){el.addEvent("keypress",function(e){if(!e){e=window.event}if(e.key=="enter"){var el=e.target;var obj={element:el};e.stop();action(obj);return false}})}}function initJS(){wm.divs={};wm.divs.tabs=$("tabs");wm.divs.mainContent=$("main-content");wm.divs.leftContainer=$("left-container");wm.divs.fixed=$("fixed");wm.divs.dynamic=$("dynamic");loadHome();window.addEvent("resize",doSize);catchEnter("txtSearch",submitTxtSearch);catchEnter("logform",loginCatchEnter);lib.listofNormalText=["the","a","an","is","on","at","in","this","these","other","one","only"]}Element.implement({appendTopHTML:function(html){this.set({html:html+this.innerHTML})},appendBottomHTML:function(html){this.set({html:this.innerHTML+html})},asString:function(){var el=new Element("div");el.adopt(this);var markup=el.innerHTML;return markup}});String.implement({rightOf:function(str){var pos=this.indexOf(str);return(pos<0)|(pos+str.length>=this.length)?"":this.substring(pos+str.length)},fmtmap:function(str){var result="";for(var i=0;i<str.length;i++){var fmt=str.substr(i,1);var nextchar=this.substr(i,1);if(fmt=="A"){result=result+nextchar.toUpperCase()}else{if(fmt=="a"){result=result+nextchar.toLowerCase()}else{if(fmt=="x"){result=result+this.substr(i)}else{if(fmt=="#"){return(""+parseInt(this,10))}}}}}return result},stringSub:function(object,regexp){if(navigator.appVersion.indexOf("MSIE")<0){return this.replace(regexp||(/\\?\{([^{}]+)\}/g),function(match,name){if(match.charAt(0)=="\\"){match.slice(1)}return(object[name]!==undefined)?object[name]:""})}else{return this.replace(regexp||(/\\?\{([^{}]+)\}/g),function(match,name){if(match.charAt(0)=="\\"){match.slice(1)}return(object[name]!==undefined&&object[name]!=="")?object[name]:"''"})}}});var HelpSystem=new Class({initialize:function(){},addHelp:function(id,helpReference,position,eventType){var positions={right:2,left:10,top:12,bottom:6,bottomRight:5,bottomLeft:7,topRight:1,topLeft:11};var styles={};if(position=="left"||position=="right"){styles[position]="175px";styles.top="-25px"}else{if(position=="top"||position=="bottom"){styles.left="10px";styles[position]="15px";if(position=="bottom"){styles[position]="20px"}}else{if(position=="bottomRight"){styles.right="55px";styles.bottom="20px"}else{if(position=="bottomLeft"){styles.left="75px";styles.bottom="20px"}else{if(position=="topRight"){styles.right="-22px";styles.top="30px"}else{if(position=="topLeft"){styles.left="-22px";styles.top="30px"}}}}}}var content=lib.startup_module.html[helpReference];var wrapper=new Element("div",{"class":"pointyWrap",styles:{display:"none"}});var parent=new Element("div",{"class":"helpSystem",styles:styles});parent.adopt(StickyWin.ui.pointy("","<br/>"+content+"<br/>",{theme:"light",direction:positions[position],closeButton:false}));wrapper.adopt(parent);wrapper.inject($(id),"after");var eventActivate="mouseover";var eventDeActivate="mouseout";if(eventType=="focus"){eventActivate="focus";eventDeActivate="blur"}$(id).addEvent(eventActivate,function(event){var target=$(event.target);target.getNext().setStyle("display","")});$(id).addEvent(eventDeActivate,function(event){var target=$(event.target);target.getNext().setStyle("display","none")})},addHelpObj:function(helpObj){}});var QuantityDropDown=new Class({initialize:function(name,select,className){this.name=name;this.select=select;this.className=(className)?className:""},setupQuantityList:function(quantity,name){if(name){this.name=name}var len=Number(quantity);var option="<select name='"+this.name+"' style='width:40px'>";for(var i=0;i<=len;i++){option+="<option value='"+i+"'>"+i+"</option>"}var selectBox=option+"</select>";return selectBox},getString:function(){if(this.size!=this.list.length){this.size=this.list.length;this.setupList()}return this.content}});var SelectBox=new Class({initialize:function(list,name,select,className,type){this.list=list;this.size=list.length;this.name=name;this.select=select;this.className=(className)?className:"";if(type=="keyValue"){this.setupKeyValueList()}else{this.setupList()}},setupKeyValueList:function(){var content="<select name='"+this.name+"' class='"+this.className+"'>";var select=this.select;this.list.each(function(el){var isSelected=(select==el)?"selected":"";content+="<option value='"+el[0]+"' "+isSelected+">"+el[1]+"</option>"});content+="</select>";this.content=content},setupList:function(){var content="<select name='"+this.name+"' class='"+this.className+"'>";var select=this.select;this.list.each(function(el){var isSelected=(select==el)?"selected":"";content+="<option value='"+el+"' "+isSelected+">"+el+"</option>"});content+="</select>";this.content=content},addItem:function(item){this.list[this.list.length]=item;this.list.sort();this.setupList()},getString:function(){if(this.size!=this.list.length){this.size=this.list.length;this.setupList()}return this.content}});var ScrollBox2=new Class({initialize:function(list,style,colDef,colMod){var ulStyle=JSON.encode(style).replace(/,/,";");this.ulStyle=ulStyle.replace(/[\"{}]/gi,"");this.list=$H(list);this.size=list.length;this.colDef=colDef;this.colMod=colMod;this.setupList()},setupList:function(){var ul="<div class='scrollBox' style='"+this.ulStyle+"'>";var ulEnd="</div>";var li="<div class='scrollBoxContent'>";var liEnd="</div><br />";var buildScrollBox=ul;var colDef=$H(this.colDef);var colMod=this.colMod;var colM;var cnt=0;var spans="";$H(colDef).each(function(dim,colName){var pre="";var post="";var val="{"+colName+"}";if(colMod){colM=colMod[colName];if(colM&&colM.pre){pre=colM.pre}if(colM&&colM.post){post=colM.post}if(colM&&colM.sub){val=colM.sub}}spans+="<span style='width:"+dim+"' >"+pre+val+post+"</span>"});spans=li+spans+liEnd;this.list.each(function(el){cnt++;el.alt=(cnt%2)?"scalt":"";buildScrollBox+=spans.substitute(el)});this.content=buildScrollBox+ulEnd},getString:function(){if(this.size!=this.list.length){this.size=this.list.length;this.setupList()}return this.content}});var Storage=new Class({});var RegUser=new Class({initialize:function(){this.userid="";this.firstname="";this.surname="";this.mobile="";this.email="";this.telephone="";this.fax="";this.position="";this.department="";this.workplace="";this.namebadge="";this.title="";this.address1="";this.address2="";this.address3="";this.suburb="";this.state="";this.postcode="";this.country="";this.irattention="";this.irdepartment="";this.irworkplace="";this.iraddress1="";this.iraddress2="";this.iraddress3="";this.irsuburb="";this.irstate="";this.irpostcode="";this.ircountry="";this.accessreg="";this.dietaryreq="";this.isbill="0";this.homework="0";this.sameaddress="0";this.attending="1";this.days=[];this.billismail="0";this.maillist="0";this.customercomments=""}});var Paging=new Class({initialize:function(array,rows){this.array=array;this.len=array.length;this.rows=rows;this.start=0;this.end=0},next:function(){if(this.start!=this.end){this.start=this.start+this.rows}this.end=this.start+this.rows;return this.array.slice(this.start,this.end)},previous:function(){this.start=this.start-this.rows;this.end=this.end-this.rows;if(this.start<0){this.start=0;this.end=this.rows}return this.array.slice(this.start,this.end)},showPrevious:function(){if(this.start>=this.rows){return true}else{return false}},showForward:function(){if(this.end<this.len-1){return true}else{return false}},drawButtons:function(){var buttons="";var nextlimit=(this.end+this.rows<this.len-1)?this.end+this.rows:this.len-1;if(this.showPrevious()){buttons+="<a class='previous btn_r' onclick='userRegistrations(wm.page.previous())'> Previous "+(this.start-this.rows+1)+"-"+(this.end-this.rows)+" </a>"}if(buttons){buttons+="&nbsp;"}if(this.showForward()){buttons+="<a class='next btn_r' onclick='userRegistrations(wm.page.next())'> Next "+(this.start+this.rows+1)+"-"+(nextlimit)+" </a>"}return buttons}});var Waiter=new Class({initialize:function(){},waitForEvent:function(event,callback,data){if(event){this.event=event;this.callback=callback;this.data=data}if(this.event()){if(this.callback){this.callback(this.data)}}else{setTimeout(this.waiter.bind(this),500)}},waiter:function(){this.waitForEvent()},stop:function(){this.event=true}});function waitForMe(module,callback){if(lib.areAllReceived(module)){callback("done")}else{setTimeout("waitForMe("+module+","+callback+")",500)}}function waitForMeToo(module,callback){if(lib.admin_module.js=="done"){callback("done")}else{setTimeout("waitForMe("+module+","+callback+")",500)}}function formSerializeAdvanced(identifier){var parameters=new Hash();$("content").getElements(identifier+" input[type=text]").each(function(el){parameters.set(el.name,el.value)});$("content").getElements(identifier+" input[type=hidden]").each(function(el){parameters.set(el.name,el.value)});$("content").getElements(identifier+" select").each(function(el){parameters.set(el.name,el.value)});$("content").getElements(identifier+" textarea").each(function(el){parameters.set(el.name,el.value)});$("content").getElements(identifier+" input[type=checkbox]:checked").each(function(el){var temp=parameters.get(el.name);if(temp){temp[temp.length]=el.value}else{temp=[];temp[0]=el.value}parameters.set(el.name,temp)});return parameters}var DB=new Class({initialize:function(){},currentForm:"",setCurrentForm:function(currentForm){this.currentForm=currentForm},setCurrentLocation:function(location){this.currentLocation=location},isLocationSet:function(location){if(historyStorage.storageHash[location]){return true}else{return false}},isStorageCreated:function(location){if(historyStorage.storageHash[location]){return true}else{return false}},getStorage:function(location){return historyStorage.storageHash[location]},getFunction:function(location){return historyStorage.storageHash[location].func},extendData:function(location,data){if(!historyStorage.storageHash[location]){historyStorage.storageHash[location]={}}if(!historyStorage.storageHash[location].dataObj){historyStorage.storageHash[location].dataObj={}}historyStorage.storageHash[location].dataObj=$extend(historyStorage.storageHash[location].dataObj,data)},extendStorage:function(location,obj){if(!historyStorage.storageHash[location]){historyStorage.storageHash[location]={}}historyStorage.storageHash[location]=$extend(historyStorage.storageHash[location],obj)},getData:function(location){if(!location){location=db.currentLocation}if(historyStorage.storageHash[location]){return historyStorage.storageHash[location].dataObj}return{}},setData:function(location,data){historyStorage.storageHash[location].dataObj=data}});var db=new DB();var TabControl=new Class({initialize:function(tabSelector,masterTabObj,el){this.ulElement=el;this.tabSelector=tabSelector;this.addTab(masterTabObj)},tabs:[],tabsObjs:[],drawTab:function(obj,dontShow){var aEl=new Element("a",{href:"javascript:",html:obj.name,title:obj.name});var liEl=new Element("li",{"class":obj.tabClass,title:obj.tabClass,id:"div"+obj.id});aEl.inject(liEl);if(!obj.isMaster){var closer=new Element("a",{href:"javascript:",html:"&nbsp;","class":"closer",title:"Close tab"});closer.inject(liEl)}liEl.inject(this.ulElement);if(!dontShow&&this.tabs.length>0){tm.showTabs()}var hereMenu=tm.menuArea.getElement("li.here");if(hereMenu){if(this.tabsObjs.length>1){hereMenu.addClass("hasTabs")}else{hereMenu.removeClass("hasTabs")}}},cleanupTab:function(location){var pos=0;if(location){pos=this.tabs.indexOf(location)}else{pos=this.tabs.indexOf(this.selectedTab)}var obj=this.tabsObjs[pos];if(obj){if(obj.cleanup){obj.cleanup()}}},storePreviousTabData:function(){},drawTabs:function(){this.ulElement.empty();this.tabsObjs.each(function(obj){this.drawTab(obj,true)},this);if(this.tabsObjs.length>0){tm.showTabs()}else{tm.hideTabs()}this.setSelected(this.selectedTab);var pos=this.tabs.indexOf(this.selectedTab);pos=pos>-1?pos:0;var obj=this.tabsObjs[pos];var func=obj.func;if(func){var tabData;if(obj.data.location){tabData=db.getData(obj.data.location);var tabStorage;if(tabData.currentSubLocation){tabStorage=db.getStorage(tabData.currentSubLocation);func=tabStorage.func;tabData=tabStorage.dataObj}}if(tabData){func(tabData)}else{func(obj.data)}}},addTab:function(obj){var id=obj.id;if(!this.tabs.contains(id)){var tabClass=obj.tabClass;this.tabs.push(id);this.tabsObjs.push(obj);this.selectedTab=obj.id;this.drawTab(obj);if(obj.isMaster){this.setMasterTab(id)}else{this.saveTab(id);if(obj.visible){this.setSelected(id);var funcCall=obj.func;if(funcCall){funcCall(obj.data)}}}}else{this.showTab(id)}},removeTab:function(location,noshowtab){var removeTab=true;var tabData;if(location){tabData=db.getData(location)}else{tabData=db.getData(this.selectedTab)}var dontClose=tabData.dontClose;var subTabData;if(tabData.currentSubLocation!==""){subTabData=db.getData(tabData.currentSubLocation);dontClose=subTabData.dontClose}if(tabData.alertMe&&(dontClose||(tabData.currentSubLocation&&tabData.currentSubLocation!==""&&(subTabData&&tabData.currentSubLocation!=subTabData.dontCloseException)))){if(!confirm(tabData.alertMe)){removeTab=false}}if(removeTab){var pos=0;var obj=null;if(location){this.ulElement.getElement("#div"+location).destroy();pos=this.tabs.indexOf(location);this.tabs.erase(location)}else{this.ulElement.getElement("#div"+this.selectedTab).destroy();pos=this.tabs.indexOf(this.selectedTab);this.tabs.erase(this.selectedTab)}obj=this.tabsObjs[pos];this.tabsObjs.erase(obj);if(!noshowtab){this.showTab(this.tabs[0])}var hereMenu=tm.menuArea.getElement("li.here");if(hereMenu){if(this.tabsObjs.length>1){hereMenu.addClass("hasTabs")}else{hereMenu.removeClass("hasTabs")}}}},setSelected:function(location){this.selectedTab=location;if(this.ulElement.getElement(".selected")){this.ulElement.getElement(".selected").removeClass("selected")}var loc=this.ulElement.getElement("#div"+location);if(loc){loc.addClass("selected")}},getMasterTab:function(){return this.masterTab},setMasterTab:function(location){this.masterTab=location},saveTab:function(location){if(db.getData(this.masterTab).tabs){db.getData(this.masterTab).tabs.push(location)}else{db.getData(this.masterTab).tabs=[location]}},storeTabData:function(data,location){if(db.isLocationSet(location)){db.extendData(location,data)}else{db.setData(location,data)}},showTab:function(location){var obj=db.getStorage(location);if(obj){var func=obj.func;this.setSelected(location);func(obj.dataObj)}},getTabId:function(){return this.selectedTab},getLocation:function(){return this.selectedTab},exist:function(location){return this.tabs.contains(location)}});var TabManager=new Class({initialize:function(){this.masterTabs=new Hash({});this.activeMasterTab=""},newTabDefaults:{visible:true,isMaster:false,id:"NewTab",name:"NewTab",tabClass:"selected NewTab",func:$empty,cleanup:$empty,data:{}},highlightMenu:function(){var oldMenu=null;if(this.menuArea){oldMenu=this.menuArea.getElement("li.here")}if(oldMenu){oldMenu.removeClass("here")}if(this.activeMenu){var newMenu=$("menu_"+tm.activeMenu);if(newMenu){newMenu.addClass("here")}}},setupUL:function(){this.tabDiv=$("tabs");this.tabDiv.innerHTML="<ul></ul>";this.ulElement=this.tabDiv.getElement("ul");if(this.ulElement){this.bOnClick=this.onClick.bind(this);this.ulElement.addEvent("click",this.bOnClick)}this.menuArea=$("left-container")},onClick:function(event){var tag=event.target.tagName;var closeme=event.target.hasClass("closer");this.storePreviousTabData();if(tag=="LI"||tag=="A"){var el=(tag=="LI")?$(event.target):$(event.target).getParent();var location=el.id.replace("div","");var obj=db.getStorage(location);if(closeme){this.removeTab(location)}else{if(obj){if(obj.dataObj.currentSubLocation){obj=db.getStorage(obj.dataObj.currentSubLocation)}}this.setSelected(location);if(obj){var func=obj.func;if(func){func(obj.dataObj,el)}}}}},destroy:function(){this.ulElement.removeEvent("click",this.bOnClick)},newTabControl:function(tabSelector,masterTabObj){masterTabObj=$merge(this.newTabDefaults,masterTabObj);if(!this.ulElement){this.setupUL()}this.storePreviousTabData();if(this.masterTabExists(masterTabObj.id)){if(this.activeMasterTab!=masterTabObj.id){this.activeMasterTab=masterTabObj.id;this.masterTabs[masterTabObj.id].drawTabs()}return this.getMasterTab(masterTabObj.id)}else{this.emptyTabs()}this.activeMasterTab=masterTabObj.id;this.masterTabs[this.activeMasterTab]=new TabControl(tabSelector,masterTabObj,this.ulElement);if(masterTabObj.visible){this.setSelected(masterTabObj.id);var funcCall=masterTabObj.func;funcCall(masterTabObj.data)}return true},masterTabExists:function(masterTabName){if(this.activeMasterTab===""){return false}return this.masterTabs.has(masterTabName)},addTab:function(obj){obj=$merge(this.newTabDefaults,obj);this.storePreviousTabData();this.masterTabs[this.activeMasterTab].addTab(obj)},drawTabs:function(){if(this.activeMasterTab){this.masterTabs[this.activeMasterTab].drawTabs()}else{this.emptyTabs()}},removeTab:function(location,noshowtab){this.storePreviousTabData();this.masterTabs[this.activeMasterTab].removeTab(location,noshowtab)},setSelected:function(location){this.masterTabs[this.activeMasterTab].setSelected(location)},getMasterTab:function(masterTabName){var mtname=masterTabName?masterTabName:this.activeMasterTab;return this.masterTabs[mtname].getMasterTab()},setMasterTab:function(location){this.masterTabs[this.activeMasterTab].setMasterTab(location)},saveTab:function(location){this.masterTabs[this.activeMasterTab].saveTab(location)},getTabId:function(){return this.masterTabs[this.activeMasterTab].getTabId()},getLocation:function(){if(this.masterTabs[this.activeMasterTab]){return this.masterTabs[this.activeMasterTab].getLocation()}else{return""}},exist:function(location){if(this.activeMasterTab===""){return false}if(!this.masterTabs[this.activeMasterTab]){return false}return this.masterTabs[this.activeMasterTab].exist(location)},showTabs:function(){if(this.tabDiv){this.tabDiv.removeClass("hidden");doSize()}},hideTabs:function(){if(this.tabDiv){this.tabDiv.addClass("hidden");doSize()}},emptyTabs:function(){if(this.tabDiv){this.ulElement.empty();doSize()}},storeTabData:function(data,location){this.masterTabs[this.activeMasterTab].storeTabData(data,location)},storePreviousTabData:function(){if(lib.divtable){lib.divtable.destroy();lib.divtable=null}var ckEditor="";if(CKEDITOR.instances.contentHTML){ckEditor=CKEDITOR.instances.contentHTML.getData();CKEDITOR.instances.contentHTML.destroy()}var dt=null;if(lib.divtable){dt={};dt.sortCol=lib.divtable.sortCol;dt.sortDir=lib.divtable.sortdir;dt.startpoint=lib.divtable.startpoint}var fromLocation=db.currentLocation;if(this.masterTabs[this.activeMasterTab]){this.masterTabs[this.activeMasterTab].cleanupTab(fromLocation)}var tabData=db.getData(fromLocation);var subLocation=tabData.currentSubLocation;if(subLocation&&subLocation!==""){fromLocation=subLocation;tabData=db.getData(subLocation)}var storedData=formSerializeAdvanced(tabData.formSelector);storedData.ckEditor=ckEditor;if(dt){storedData.dt=dt}db.extendData(fromLocation,storedData)}});var tm=new TabManager();function createBookmark(url,title){if(window.sidebar){window.sidebar.addPanel(title,url,"")}else{if(window.external){window.external.AddFavorite(url,title)}}}function checkSessionTimeout(response,callback,previouscallback,functionname,data){wm.timeoutsubmit=false;if(response.clean()=="login"){clearMenu();wm.timeoutsubmit=true;wm.submitdata=data;wm.submitfunction=functionname}else{if(response.clean()=="noservice"){alert("This service is not available")}else{if(previouscallback){callback(response,previouscallback)}else{callback(response)}}}}function disableAllInputFields(identifier){$(identifier).getElements("input[type=text],input[type=checkbox],input[type=radio],select,textarea").each(function(el){if(!el.disabled){el.disabled=true}})}function nextPanel(topDiv,content,containerSelector,location,subLocation){var el=new Element("div",{id:topDiv});el.set("html",content);var cont;cont=wm.divs.fixed;cont.innerHTML="";el.inject(cont);if(lib.divtable){wm.divs.dynamic.removeClass("hidden");lib.divtable.draw(true);wm.divs.dynamic.setStyle("overflow","hidden")}else{wm.divs.dynamic.empty();wm.divs.dynamic.addClass("hidden")}doSize();if(location){if(tm.exist(location)){tm.setSelected(location)}else{var data=db.getData(location);var tabName=data.tabName;if(subLocation){data=db.getData(subLocation)}if(!tm.exist(location)){tm.addTab({visible:true,id:location,name:tabName,tabClass:"",func:data.backButFunc,data:data})}}if(subLocation){db.extendData(location,{currentSubLocation:subLocation})}else{if(db.isStorageCreated(location)){db.extendData(location,{currentSubLocation:""})}}}}function setSelectedIndex(el,value){for(var intI=0;intI<el.options.length;intI++){if(el.options[intI].value==value){el.options[intI].selected=true}}}function paint(options){var opts=options||{content:"Please wait, loading"};var el=new Element("div",{id:topDiv});el.set("html",content);var cont;if(containerSelector){cont=$$(containerSelector)[0]}else{cont=$("subContainer")}cont=$defined(cont)?cont:$("subContainer");cont.innerHTML="";el.inject(cont);var scrollsize=cont.getSize().y-el.getSize().y-5;if(scrollsize>0){wm.divs.scrollable.inject(cont);wm.divs.scrollable.setStyle("height",scrollsize);wm.divs.scrollable.setStyle("overflow","hidden");wm.divs.scrollable.empty();if(lib.memaccess){if(lib.memaccess.divtable){lib.memaccess.divtable.draw()}}wm.divs.scrollable.removeClass("hidden")}else{wm.divs.scrollable.inject(cont);wm.divs.scrollable.empty();wm.divs.scrollable.addClass("hidden")}if(location){if(tm.exist(location)){tm.setSelected(location)}else{var data=db.getData(location);var tabName=data.tabName;if(subLocation){data=db.getData(subLocation)}if(!tm.exist(location)){tm.addTab({visible:true,id:location,name:tabName,tabClass:"",func:data.backButFunc,data:data})}}if(subLocation){db.extendData(location,{currentSubLocation:subLocation})}else{if(db.isStorageCreated(location)){db.extendData(location,{currentSubLocation:""})}}}}function formSerialize(identifier){var parameters=new Hash();$$(identifier+" input",identifier+" select",identifier+" textarea").each(function(el){parameters.set(el.name,el.value)});return parameters}function isFormEmpty(formId){if(formId==".attendees"){var el1=$$(".bookcont input[type=text]");var len1=el1.length;for(var i=0;i<len1;i++){if(el1[i].value!==""){return false}}}else{var el2=$$(formId+" input[type=text]");var len2=el2.length;for(var j=0;j<len2;j++){if(el2[j].value!==""){return false}}}return true}function buildCountryDropDown(select,name,onChange){var countries=lib.startup_module.data.Countries;var countryString;var au="AU";if(onChange){countryString='<select onchange="'+onChange+'()" name="'+name+'" class="required" title="country" id="'+name+'">'}else{countryString='<select name="'+name+'" class="required" title="country" id="'+name+'">'}countryString+='<option value="">Choose country</option>';countries.each(function(el){countryString+="<option "+((el.countrycode==au)?'selected="yes"':"")+' value="'+el.countrycode+'">'+el.countryname+"</option>"});countryString+="</select>";return countryString}function buildStateDropDown(select,name,onChange){var stateString;if(onChange){stateString='<select onchange="'+onChange+'()" name="'+name+'" class="required" title="state" id="'+name+'">'}else{stateString='<select name="'+name+'" class="required" title="state" id="'+name+'">'}stateString+='<option value="">Choose state</option>';var states=lib.startup_module.data.States;states.each(function(el){stateString+="<option "+((select==el.statecode)?'selected="yes"':"")+' value="'+el.statecode+'" >'+el.statename+"</option>"});stateString+="</select>";return stateString}function buildCategoriesDropDown(select,name,onChange,className){if(!className){className=""}var sel=(select<1)?'selected="yes"':"";var categories=lib.startup_module.data.Categories;var categoriesRows="";if(onChange){categoriesRows='<select class="'+className+'" id="'+name+'" name="'+name+'" onchange="'+onChange+'();" ><option value="">Choose category</option><option value="all" '+sel+">All topics</option>"}else{categoriesRows='<select class="'+className+'" id="'+name+'" name="'+name+'" ><option value="" >Choose category</option><option value="all" '+sel+">All topics</option>"}$H(categories).each(function(el,key){categoriesRows+="<option "+((select==key)?'selected="yes"':"")+' value="'+key+'">'+el+"</option>"});categoriesRows+="</select>";return categoriesRows}function buildConferenceSearch(htmlBuilder,location,defaultOptions){var content=lib.startup_module.html.conferenceSearchControl;var catagoryRows=buildCategoriesDropDown((defaultOptions)?defaultOptions.category:"","category","");var stateRows=buildStateDropDown((defaultOptions)?defaultOptions.state:"","state","");var yearhtml=lib.startup_module.html.year;var startYear=new Date().getFullYear()-5;var years="";var confidTxt=defaultOptions.confidTxt;var titleTxt=defaultOptions.titleTxt;var select=defaultOptions.year;var options=defaultOptions.options;for(var i=0;i<10;i++){years+="<option "+((select==(startYear+i))?'selected="yes"':"")+" value='"+(startYear+i)+"'>"+(startYear+i)+"</option>"}years=yearhtml.substitute({options:years,filterSearch:"conferenceFilterSearch("+htmlBuilder+",'"+location+"')"});var subObj={topics:catagoryRows,states:stateRows,years:years,manageConferenceSearch:"conferenceSearchDropdown("+htmlBuilder+",'"+location+"')",manageConferenceSearchText:"conferenceSearchText("+htmlBuilder+",'"+location+"')",filterSearch:"conferenceFilterSearch("+htmlBuilder+",'"+location+"')",titleTxt:titleTxt,confidTxt:confidTxt};if(options[0]){subObj[options[0]]="checked"}if(options[0]){subObj[options[1]]="checked"}if(options[0]){subObj[options[2]]="checked"}if(options[0]){subObj[options[3]]="checked"}content=content.substitute(subObj);return content}function getSearchOptions(){var options=[];$$("#searchOptions input").each(function(el){if(el.checked){options.push(el.name)}});return(options)?options:null}function conferenceSearchDropdown(htmlBuilder,location,cloneConference){wm.textSearch=false;var category=$("category").value;var state=$("state").value;var year=($("year"))?$("year").value:null;var options;if(db.isLocationSet(location)){var data=db.getData(location);data.defaultOptions.year=year;data.defaultOptions.category=category;data.defaultOptions.state=state;options=getSearchOptions();data.defaultOptions.options=options}else{options=getSearchOptions()}var result=adminSearch(null,options,category,state,year);var args;if(cloneConference||location=="Tab_NewConference-cloneList"){args=[result,true]}else{args=[result]}htmlBuilder.run(args)}function conferenceSearchTextHelper(htmlBuilder,location,cloneConference,confId){var title=$("title").value;var searchobj={confid:confId,title:title};wm.textSearch=true;var year=($("year"))?$("year").value:null;var options;if(db.isLocationSet(location)){var data=db.getData(location);data.defaultOptions.year=year;data.defaultOptions.confidTxt=confId;data.defaultOptions.titleTxt=title;options=getSearchOptions();data.defaultOptions.options=options}else{options=getSearchOptions()}var result=adminSearch(searchobj,options,null,null,year);var args;if(cloneConference||location=="Tab_NewConference-cloneList"){args=[result,true]}else{args=[result]}htmlBuilder.run(args)}function conferenceSearchText(htmlBuilder,location,cloneConference){var confId=$("confid").value;var req;if($("searchOptions").getElement(".COMPLETED").checked){req={key:confId,type:"archive_conferences"};if(lib.readyData(req,false,"Retrieving archived conference",conferenceSearchTextHelper.pass([htmlBuilder,location,cloneConference,confId]))){conferenceSearchTextHelper(htmlBuilder,location,cloneConference,confId)}}else{if(confId){req={key:confId,type:"archive_conference"};if(lib.readyData(req,false,"Retrieving archived conference",conferenceSearchTextHelper.pass([htmlBuilder,location,cloneConference,confId]))){conferenceSearchTextHelper(htmlBuilder,location,cloneConference,confId)}}else{conferenceSearchTextHelper(htmlBuilder,location,cloneConference,confId)}}}function conferenceFilterSearchHelper(htmlBuilder,location){if(wm.textSearch){conferenceSearchText(htmlBuilder,location)}else{conferenceSearchDropdown(htmlBuilder,location)}}function conferenceFilterSearch(htmlBuilder,location){if($("searchOptions").getElement(".COMPLETED").checked){var req={key:"",type:"archive_conferences"};if(lib.readyData(req,false,"Retrieving archived conferences",conferenceFilterSearch.pass([htmlBuilder,location]))){conferenceFilterSearchHelper(htmlBuilder,location)}}else{conferenceFilterSearchHelper(htmlBuilder,location);delete lib.startup_module.data.Archived_Conferences}}function localeNumberFormat(amount,currencySymbol,delimiter,decimalPlaces){if(!decimalPlaces){decimalPlaces=0}try{amount=parseFloat(amount);amount=amount.toFixed(decimalPlaces)}catch(e){throw ("localeNumberFormat caused INVALID FLOAT with value "+amount)}if(!delimiter){delimiter=","}if(amount.match!="function"){amount=amount.toString()}var regIsNumeric=/[^\d,\.\-]+/igm;var results=amount.match(regIsNumeric);if(results!==null){return null}var minus=amount.indexOf("-")>=0?"-":"";amount=amount.replace("-","");var amtLen=amount.length;var decPoint=amount.indexOf(".");var wholeNumberEnd=decPoint>0?amtLen-(amtLen-decPoint):amtLen;var wholeNumber=amount.substr(0,wholeNumberEnd);var fraction=amount.substr(wholeNumberEnd,amtLen-wholeNumberEnd);var segments=(wholeNumberEnd-(wholeNumberEnd%3))/3;var rvsNumber=wholeNumber.split("").reverse().join("");var output="";for(i=0;i<wholeNumberEnd;i++){if(i%3===0&&i!==0&&i!=wholeNumberEnd){output+=","}output+=rvsNumber.charAt(i)}output=minus+currencySymbol+output.split("").reverse().join("")+fraction;return output}function findObject(array,property,value){if(array){var len=array.length;for(var i=0;i<len;i++){if(array[i][property]==value){return array[i]}}}return null}function validateDetails(formId){$$(formId);var form=$$(formId);var validate=new FormValidator.Inline(form[0],{});return validate.validate()}function isEmpty(v){return(v===null)||(v.length===0)}function isNumeric(sText){if(isEmpty(sText.clean())){return false}else{sText=sText.replace(",","");var ValidChars="0123456789.";var IsNumber=true;var Char;for(var i=0;i<sText.length&&IsNumber===true;i++){Char=sText.charAt(i);if(ValidChars.indexOf(Char)==-1){IsNumber=false}}return IsNumber}}FormValidator.add("date-validation",{errorMsg:"Conference end date must be after start date.",test:function(el){var start=$("conferencestart").value.split("/");var end=$("conferenceend").value.split("/");if(Number(end[2])==Number(start[2])&&Number(end[1])==Number(start[1])&&Number(end[0])>=Number(start[0])){return true}if(Number(end[2])==Number(start[2])&&Number(end[1])>Number(start[1])){return true}if(Number(end[2])>Number(start[2])){return true}return false}});FormValidator.add("time-validation",{errorMsg:"Time hr must be in the interval 00:00 to 23:59.<br>",test:function(el){var hr=$(el).value;var min=$(el).getNext(".timeMinutes").value;if(hr.clean()===""&&min.clean()===""){return true}if(Number(hr)>=0&&Number(hr)<24&&Number(min)>=0&&Number(min)<60){return true}return false}});FormValidator.add("validate-attend",{errorMsg:"You must specify which days you are attending.",test:function(el){var isChecked=false;$$(".bookAttend .attend").each(function(el){if(el.checked){isChecked=true}});return isChecked}});FormValidator.add("validate-one-phone",{errorMsg:"You must supply at least one contact number (mobile or phone).",test:function(el){var mobile=$$(".billcontact .mobile")[0].value;var phone=$$(".billcontact .phone")[0].value;return !isEmpty(mobile)||!isEmpty(phone)}});FormValidator.add("validate-radio-term",{errorMsg:"You must agree to terms and conditions",test:function(el){return $("terms").value=="YES"}});FormValidator.add("validate-radio-maillist",{errorMsg:"Please choose a mail list option.",test:function(el){return($("maillist").checked)||($("maillistn").checked)}});FormValidator.add("validate-money-amount",{errorMsg:'Please enter a numeric value. "." before the decimals and thousands separated by ","',test:function(el){return isNumeric(el.value)}});FormValidator.add("validate-no-use-same-identification",{errorMsg:"Please use a different email and mobile number for each attendee. If you do not know their information then leave those fields empty.",test:function(el){return isDuplicatedIdentify(el.value,el.name)}});FormValidator.add("validate-paymentMethod",{errorMsg:"Please check atleast one payment option",test:function(el){var isChecked=false;if($("payByPayPal").checked){isChecked=true}if($("payByInvoice").checked){isChecked=true}return isChecked}});function termsAndConditions(){var termsString=lib.startup_module.html.terms;nextPanel("terms",termsString);storeForm("terms",null,termsAndConditions)}function termsAndConditionsStep3(){var termsString=lib.startup_module.html.terms;termsString+="<div class='closebutton'><a class='button' href='javascript:setupStep3();'><span>Back To Registration Form</span></a></div>";nextPanel("terms",termsString);storeForm("terms",null,termsAndConditionsStep3)}function makePP(groupid){if($("pinvoiceb")){$("pinvoiceb").hide()}if($("ponlineb")){$("ponlineb").hide()}if(wm.paymentwindow&&!wm.paymentwindow.closed){alert("The payment processing page is already open!")}else{wm.paymentwindow=window.open(wm.serverAddress+"paymentform.php?groupid="+groupid,"paypalwindow","location=1,status=1,scrollbars=1,width=960,height=960");if(!wm.paymentwindow.opener){wm.paymentwindow.opener=self}}}function capitalize(el){var val=el.value;var values=val.split(" ");var len=values.length;if(len==1){el.value=val.capitalize()}else{for(var i=0;i<len;i++){values[i]=values[i].capitalize()}el.value=values.join(" ")}}function buildRegsSummary(data){var optExtras=lib.startup_module.data.optionalExtras;var conference=(data.conference)?data.conference:wm.currentConference;var registrationList=(data.registrations)?data.registrations:wm.regList;var buildObj={};buildObj=$extend(buildObj,data);buildObj.subtitle=conference.subtitle;buildObj.conf_id=conference.conf_id;buildObj.status=conference.status;buildObj.conftype=conference.conftype;buildObj.number=conference.number;buildObj.name=conference.name;buildObj.venue=conference.venue;buildObj.days=conference.days;buildObj.startdate=conference.startdate;buildObj.enddate=conference.enddate;buildObj.cost=conference.cost;buildObj.cost1day=conference.cost1day;buildObj.venuename=conference.venuename;buildObj.url=conference.url;buildObj.startdateFormat=conference.startdateFormat;buildObj.year=conference.year;buildObj.dayCostGST=conference.dayCostGST;buildObj.fullincGST=conference.fullincGST;buildObj.program_link=conference.program_link;buildObj.cne=conference.cne;buildObj.code=conference.code;var bookingSummary="";var totalCost=0;var numofRegs=0;if(registrationList){registrationList.each(function(el,index){if(el.attending==1){numofRegs++;var price=0;var counter=0;var attendence="";var len=0;len=Number(conference.days)+1;for(var i=1;i<len;i++){if(el["daysatt"+i]=="checked"){counter++;if(!isEmpty(attendence)){attendence+=", "}attendence+="DAY "+i}}if(Number(conference.days)==1){counter=1;el.daysatt1="checked"}if(counter==len-1){price=conference.fullincGST}else{price=counter*conference.dayCostGST}totalCost+=parseFloat(price);var optExtraPriceString;var totalRowPrice=0;if(el.optExtraChk&&el.optExtraChk.length){el.sales_item_list=el.optExtraChk}if(el.sales_item_list){var optExtraPrice=0;el.sales_item_list.each(function(opt){optExtraPrice+=Number(optExtras[opt].price)});totalCost+=parseFloat(optExtraPrice);optExtraPriceString=localeNumberFormat(optExtraPrice,"$",",",2);totalRowPrice=Number(optExtraPrice)+Number(price)}else{optExtraPriceString="N/A";totalRowPrice=Number(price)}var bookSummaryTemp="<td>"+el.firstname+" "+el.surname+"</td><td>"+el.dietaryreq+"</td><td>"+el.accessreq+"</td><td>"+attendence+"</td><td>"+localeNumberFormat(price,"$",",",2)+"</td><td>"+optExtraPriceString+"</td><td>"+localeNumberFormat(totalRowPrice,"$",",",2)+"</td>";if(el.reg_id){bookingSummary+="<tr><td>"+el.reg_id+"</td>"+bookSummaryTemp+"</tr>"}else{bookingSummary+="<tr>"+bookSummaryTemp+"</tr>"}}})}var colspan=4;bookingSummary+='<tr><td colspan="'+(colspan+1)+'"><b>Note that online payment attracts '+wm.ppsurcharge+"% surcharge. Offline credit card payment attracts "+wm.ccsurcharge+"% surcharge</b></td></tr>";bookingSummary+='<tr><td colspan="'+colspan+'"><b>TOTAL PRICE:</b></td><td><b>'+localeNumberFormat(totalCost,"$",",",2)+" inc GST</b></td></tr>";if(buildObj.admin_surcharge&&buildObj.admin_surcharge>0){bookingSummary+='<tr><td colspan="'+colspan+'"><b>SURCHARGE:'+buildObj.surchargereason+"</b></td><td><b>"+localeNumberFormat(buildObj.admin_surcharge,"$",",",2)+" </b></td></tr>"}if(buildObj.admin_discount&&buildObj.admin_discount>0){bookingSummary+='<tr><td colspan="'+colspan+'"><b>DISCOUNT:</b></td><td><b>'+localeNumberFormat(buildObj.admin_discount,"$",",",2)+" </b></td></tr>"}if(buildObj.paypal_fee&&buildObj.paypal_fee>0){bookingSummary+='<tr><td colspan="'+colspan+'"><b>ONLINE PAYMENT FEE:</b></td><td><b>'+localeNumberFormat(buildObj.paypal_fee,"$",",",2)+" </b></td></tr>"}if(buildObj.creditcardfee&&buildObj.creditcardfee>0){bookingSummary+='<tr><td colspan="'+colspan+'"><b>OFFLINE CREDIT CARD FEE:</b></td><td><b>'+localeNumberFormat(buildObj.creditcardfee,"$",",",2)+" </b></td></tr>"}if(buildObj.amount_paid){bookingSummary+='<tr><td colspan="'+colspan+'"><b>TOTAL PAID:</b></td><td><b>'+localeNumberFormat(buildObj.amount_paid,"$",",",2)+" </b></td></tr>"}if(buildObj.totalowing!==undefined){bookingSummary+='<tr><td colspan="'+colspan+'"><b>TOTAL OWING:</b></td><td><b>'+localeNumberFormat(buildObj.totalowing,"$",",",2)+" inc GST </b></td></tr>"}buildObj.bookingsummary=bookingSummary;var countryobj=lib.startup_module.data.Countries.filter(function(item){return buildObj.ircountry==item.countrycode});if(countryobj[0]){buildObj.ircountryname=countryobj[0].countryname}return buildObj}function convertToCurrencyValue(num){num=num.replace(",","");if(isNumeric(num)){num=parseFloat(num)}return num}function launchExternal(url){window.open(url,"_blank")}var divTable=new Class({Implements:[Options],options:{rowHeight:20,columns:[],target:null,data:null},initialize:function(options){this.setOptions(options);if(this.options.target.hasClass("hidden")){this.options.target.removeClass("hidden")}this.size=this.options.target.getSize();this.sortdir=$pick(this.options.sortDir,"asc");this.startpoint=0;this.sortCol=$pick(this.options.sortCol,0);this.cellpadding=3;if($type(this.options.data)!="array"){var temp=$H(this.options.data);var newData=[];temp.each(function(obj){newData.push(obj)});this.options.data=newData}if(this.options.columns){this.draw()}},calcRows:function(){this.numrows=this.size.y/this.options.rowHeight},changeData:function(data){this.options.data=data;this.startpoint=0;if($type(this.options.data)!="array"){var temp=$H(this.options.data);var newData=[];temp.each(function(obj){newData.push(obj)});this.options.data=newData}var sortCol=this.options.columns[this.sortCol];if(sortCol.sort){var srt=this.genSort.bind(this);if($type(sortCol.sort)=="function"){srt=sortCol.sort}this.options.data.sort(srt);if(this.sortdir=="dec"){this.options.data.reverse()}}this.drawn=true;this.drawlinks();this.populate()},draw:function(nocontent){if(this.drawn){return}var location=tm.getLocation();if(location){var prevData=db.getData(location).dt;if(prevData){this.sortCol=prevData.sortCol;this.sortfir=prevData.sortdir;this.startpoint=prevData.startpoint}}this.div=new Element("div",{"class":"divtable",height:this.size.y,width:this.size.x}).inject(this.options.target);this.numcols=this.options.columns.length;var freesize=this.size.x;var freecols=this.numcols;this.options.columns.each(function(col){if(col.width){freesize-=(col.width+(this.cellpadding*2));freecols--}},this);this.defaultWidth=Math.floor(freecols>0?((freesize/freecols)-(this.cellpadding*2)):0);var displayHead="";var colWide=0;displayHead+='<div class="divtrh" style="height:'+this.options.rowHeight+'px">';this.options.columns.each(function(col,index){colWide=(col.width?col.width:this.defaultWidth);if(col.sort){colWide-=8}var sortclass="";if(this.sortCol==index){sortclass=(this.sortdir=="dec"?" dec":" asc")}displayHead+='<div id="divth'+index+'" class="divth'+(col.sort?" sortable":"")+sortclass+'" style="width:'+Number(colWide)+"px;height:"+this.options.rowHeight+'px">'+col.title+"</div>"},this);displayHead+="</div>";this.div.set("html",displayHead);this.head=this.div.getElement("div.divtrh");this.bSortClick=this.sortclick.bind(this);this.head.addEvent("click",this.bSortClick);this.numrows=parseInt(this.size.y/this.options.rowHeight,10);this.bodyrownum=this.numrows-2;this.foot=new Element("div",{"class":"divtf"}).inject(this.div);this.bPrev=this.btnPrevCallback.bind(this);this.bNext=this.btnNextCallback.bind(this);this.prevBtn=new Element("div",{"class":"divprev hidden",align:"left",html:'<input type="button" class="btn_r" value="previous" />',style:"float:left;"}).inject(this.foot).addEvent("click",this.bPrev);this.links=new Element("div",{"class":"divtlinks",html:'<a href="#">links go here...</a>',style:"float:left;"}).inject(this.foot);this.blinkClicker=this.linkclick.bind(this);this.links.addEvent("click",this.blinkClicker);this.nextBtn=new Element("div",{"class":"divnext hidden",align:"right",html:'<input type="button" class="btn_r" value="next" />',style:"float:right;"}).inject(this.foot).addEvent("click",this.bNext);this.bClicker=this.clicker.bind(this);this.body=new Element("div",{"class":"divtablebody",height:this.bodyrownum*this.options.rowHeight,width:this.size.x}).inject(this.head,"after");this.body.addEvent("click",this.bClicker);if(nocontent){this.drawn=true;return true}this.bodyrownum.times(function(x){var element;if(x%2){element=new Element("div",{"class":"divtr altn",html:"&nbsp;",style:"visibility:hidden;height:"+this.options.rowHeight+"px"});element.inject(this.body)}else{element=new Element("div",{"class":"divtr",html:"&nbsp;",style:"visibility:hidden;height:"+this.options.rowHeight+"px"});element.inject(this.body)}},this);var sortCol=this.options.columns[this.sortCol];if(sortCol.sort){var srt=this.genSort.bind(this);if($type(sortCol.sort)=="function"){srt=sortCol.sort}this.options.data.sort(srt);if(this.sortdir=="dec"){this.options.data.reverse()}}this.drawn=true;this.drawlinks();this.populate();return true},btnPrevCallback:function(){this.populate(this.previous)},btnNextCallback:function(){this.populate(this.next)},drawlinks:function(){this.links.empty();var numLinks=this.bodyrownum===0?0:parseInt(this.options.data.length/this.bodyrownum,10)+1;if(this.bodyrownum>=this.options.data.length){this.links.addClass("hidden");return true}this.links.removeClass("hidden");var linkdiv=this.links;var sortCol=this.options.columns[this.sortCol];for(var i=0;i<numLinks;i++){var startcheck=i*this.bodyrownum;if(startcheck<=this.options.data.length-1){var obj=this.options.data[startcheck];var startdetail=($type(sortCol.templ)=="function")?sortCol.templ(obj):sortCol.templ.substitute(obj);if(sortCol.linkfmt){startdetail=startdetail.fmtmap(sortCol.linkfmt)}var newLink=new Element("div",{"class":"divtlink divl_"+i,html:(i>0?", ":"")+'<a href="#">'+startdetail+"</a>",style:"float:left;"}).inject(this.links)}}return true},linkclick:function(event){event.stop();var el=$(event.target);var cell=el.hasClass("divtlink")?el:el.getParent("div.divtlink");if(!cell){return true}var ql=parseInt(cell.className.rightOf("divl_"),10);this.populate(ql*this.bodyrownum);return true},sortclick:function(event){event.stop();var el=$(event.target);var cell=el.hasClass("sortable")?el:el.getParent("div.sortable");if(!cell){return true}this.sortCol=parseInt(cell.id.rightOf("divth"),10);var sortCol=this.options.columns[this.sortCol];var srt=this.genSort.bind(this);if(sortCol.sort){if($type(sortCol.sort)=="function"){srt=sortCol.sort}}this.startpoint=0;this.options.data.sort(srt);if(cell.hasClass("asc")){this.options.data.reverse();cell.removeClass("asc");cell.addClass("dec");this.sortdir="dec"}else{if(cell.hasClass("dec")){cell.addClass("asc");cell.removeClass("dec");this.sortdir="asc"}else{cell.addClass("asc");this.sortdir="asc"}}var titles=this.head.getElements("div.sortable");titles.each(function(el){if(el.id!=cell.id){el.removeClass("asc");el.removeClass("dec")}});this.drawlinks();this.populate();return true},genSort:function(a,b){if(!$defined(a)||!$defined(b)){alert("One of the sort elements is undefined.")}var sortCol=this.options.columns[this.sortCol];var val1=($type(sortCol.templ)=="function")?sortCol.templ(a):sortCol.templ.substitute(a);var val2=($type(sortCol.templ)=="function")?sortCol.templ(b):sortCol.templ.substitute(b);val1=val1.toLowerCase();val2=val2.toLowerCase();if(sortCol.type=="number"){val1=parseFloat(val1);val2=parseFloat(val2)}else{if(sortCol.type=="date"){val1=(""+val1).split("/");val1=val1[2]+"/"+val1[1]+"/"+val1[0];val2=(""+val2).split("/");val2=val2[2]+"/"+val2[1]+"/"+val2[0]}}if(val1<val2){return -1}else{if(val1==val2){return 0}}return 1},clicker:function(event){var el=$(event.target);var isButton=(el.tagName.toLowerCase()=="button");var cell=el.hasClass("divtd")?el:el.getParent("div.divtd");if(!cell){event.stop();return true}var row=cell.getParent("div.divtr");var colno=parseInt(cell.className.rightOf("divt_Col"),10);var rowno=parseInt(row.className.rightOf("divt_Row"),10);var col=this.options.columns[colno];if(col.button){if(!isButton){return false}}if(col.callback){var obj=this.options.data[rowno];event.stop();var args=[obj];if(col.callbackArg){args=col.callbackArg.split(",");args.each(function(att,index){args[index]=obj[att]})}col.callback.run(args)}},populate:function(sp){if(!this.drawn){this.draw()}this.startpoint=$pick(sp,this.startpoint,0);this.next=(this.startpoint+this.bodyrownum)>=this.options.data.length?null:this.startpoint+this.bodyrownum;this.previous=(this.startpoint-this.bodyrownum)<0?0:this.startpoint-this.bodyrownum;var ql=this.links.getElement("div.here");if(ql){ql.removeClass("here")}var rows=this.div.getElements(".divtr");rows.length.times(function(x){var rowNo=this.startpoint+x;var obj=this.options.data[rowNo];var oldRowNo=parseInt(rows[x].className.rightOf("divt_Row"),10);if(oldRowNo||oldRowNo===0){rows[x].removeClass("divt_Row"+oldRowNo)}if(obj){var rowCells="";var hover="";this.options.columns.each(function(col,colnum){colWide=col.width?(col.width):this.defaultWidth;var itm=($type(col.templ)=="function")?col.templ(obj):col.templ.substitute(obj);if(col.hover){hover=($type(col.hover)=="function")?col.hover(obj):col.hover.substitute(obj);if(hover!==""){hover='title="'+hover+'"'}else{hover=""}}else{hover='title="'+itm+'"'}if(col.button){itm='<button type="button">'+itm+"</button>"}else{if(col.callback){itm='<a href="#" >'+itm+"</a>"}}rowCells+="<div "+hover+' class="divtd ';rowCells+=col["class"]?(" "+col["class"]+" "):"";rowCells+="divt_Col"+colnum+'" style="width:'+colWide+"px;height:"+this.options.rowHeight+'px">'+itm+"</div>"},this);rows[x].set("html",rowCells);rows[x].setStyle("visibility","visible");rows[x].addClass("divt_Row"+rowNo)}else{rows[x].setStyle("visibility","hidden")}},this);if(this.startpoint>0){this.prevBtn.removeClass("hidden")}else{this.prevBtn.addClass("hidden")}if(this.next){this.nextBtn.removeClass("hidden")}else{this.nextBtn.addClass("hidden")}if(!this.next&&this.startpoint===0){this.links.addClass("hidden")}else{this.links.removeClass("hidden")}var qlPlace=parseInt(this.startpoint/this.bodyrownum,10);ql=this.links.getElement("div.divl_"+qlPlace);if(ql){ql.addClass("here")}},redraw:function(target){this.options.target=$(target);this.populate(this.startpoint)},destroy:function(){this.prevBtn.removeEvent("click",this.bPrev);this.nextBtn.removeEvent("click",this.bNext);this.links.removeEvent("click",this.blinkClicker);this.body.removeEvent("click",this.bClicker);this.prevBtn.dispose();this.nextBtn.dispose();this.div.dispose();this.prevBtn=null;this.nextBtn=null;this.div=null},doResize:function(){this.size=this.options.target.getSize();this.div.setStyle("height",this.size.y);var oldrows=this.numrows;this.numrows=parseInt(this.size.y/this.options.rowHeight,10);if(oldrows==this.numrows){return true}this.bodyrownum=this.numrows-2;this.body.empty();this.body.setStyle("height",this.bodyrownum*this.options.rowHeight);this.bodyrownum.times(function(x){var element;if(x%2){element=new Element("div",{"class":"divtr altn",html:"&nbsp;",style:"visibility:hidden;"}).inject(this.body)}else{element=new Element("div",{"class":"divtr",html:"&nbsp;",style:"visibility:hidden;"}).inject(this.body)}},this);this.populate();this.drawlinks()}});function htmlSnipper(response,module){var jsonObj=JSON.decode(response);if(module=="registration_module"||module=="userProfile_module"){var regexp=/\\?\*\*([^(\*\*)]+)\*\*/g;response=response.replace(regexp||(/\\?\{([^{}]+)\}/g),function(match,name){if(match.charAt(0)=="\\"){return match.slice(1)}return(lib.languagePublic[name]!==undefined)?lib.languagePublic[name]:""})}else{response=response.replace(/\\?\*\*([^(\*\*)]+)\*\*/g,function(match,name){if(match.charAt(0)=="\\"){return match.slice(1)}if(lib.languageAdmin){return(lib.languageAdmin[name])?lib.languageAdmin[name]+"<img src='img/application_edit.png' class='customizer' type='admin' textId='"+name+"' style='display:none' />":lib.languagePublic[name]+"<img src='img/application_edit.png' class='customizer' type='public' textId='"+name+"' style='display:none' />"}else{return(lib.languagePublic[name])?lib.languagePublic[name]+"<img src='img/application_edit.png' class='customizer' type='admin' textId='"+name+"' style='display:none' />":""}})}lib[module].html=JSON.decode(response);lib[module].html.status="done"}function getModule(callback,module){var params={};var service=module;if(module=="registration_module"){params.service="makeregs"}else{params.service=service;params.type="html";params.securityname="parent"}var requestObj={method:"get",url:wm.serverAddress+"controller.php",data:params,evalScripts:true,onFailure:function(){destroyPopup()},onSuccess:function(response){var waiter;destroyPopup();checkSessionTimeout(response,function(response){if(response.clean()=="noservice"){alert("This service is not available")}else{htmlSnipper(response,module);lib.injectJS(lib.startup_module.data.serverSiteAddress+lib[module].jsFile);waiter=new Waiter();waiter.waitForEvent(function(){if(lib.areAllReceived(module)){return true}else{return false}},function(){callback("done")})}})}};showWatingPopup();var req=new Request(requestObj);req.send()}function getStartupModule(){var requestObj={method:"get",url:wm.serverAddress+"controller.php",data:{service:"getstartdata"},evalScripts:true,onFailure:function(){destroyPopup()},onSuccess:function(response){$extend(lib.startup_module.html,JSON.decode(response))}};var req=new Request(requestObj);req.send();lib.startup_module.html.status="done";lib.storeHTML("startup_module","login",$("login-form").innerHTML);lib.storeHTML("startup_module","search",$("fixed").innerHTML);lib.storeHTML("startup_module","news",$("news-form").innerHTML);lib.storeHTML("startup_module","conferenceSearchControl")}function getPopupModule(){var requestObj={method:"get",url:wm.serverAddress+"controller.php",data:{service:"dialogs"},evalScripts:true,onFailure:function(){destroyPopup()},onSuccess:function(response){destroyPopup();if(response.clean()=="noservice"){alert("This service is not available")}else{htmlSnipper(response,"popups_module")}}};var req=new Request(requestObj);showWatingPopup("Loading...");req.send()}function getUserProfileModule(callback,module){showWatingPopup("Loading module...");var req=new Request({method:"get",data:{service:"userProfile_module",type:"html",securityname:"parent"},url:wm.serverAddress+"controller.php",evalScripts:true,onFailure:function(){destroyPopup()},onSuccess:function(responseText){var waiter;checkSessionTimeout(responseText,function(responseText,callback){lib.injectJS(lib.startup_module.data.serverSiteAddress+lib.userProfile_module.jsFile);htmlSnipper(responseText,"userProfile_module");waiter=new Waiter();waiter.waitForEvent(function(){if(lib.areAllReceived("userProfile_module")){return true}else{return false}},function(){if(callback){callback("done")}})},callback);destroyPopup()}}).send()}function getAdminModule(callback){lib.injectJS(lib.startup_module.data.serverSiteAddress+lib.admin_module.jsFile);var waiter=new Waiter();waiter.waitForEvent(function(){if(lib.admin_module.js=="done"){return true}else{return false}},function(){if(callback){callback("done")}})}function getSiteConfig_module(callback){var requestObj={method:"get",url:wm.serverAddress+"controller.php",data:{service:"siteconfig",type:"html",securityname:"parent"},evalScripts:true,onFailure:function(){destroyPopup()},onSuccess:function(response){destroyPopup();alert("finished")}};showWatingPopup();var req=new Request(requestObj);req.send()}var lib=new Library();lib.setModule("startup_module",{html:true,data:false,js:false});lib.setModule("popups_module",{html:true,data:false,js:false});lib.setModule("siteConfig_module",{html:true,data:false,js:false},getSiteConfig_module);lib.setModule("registration_module",{html:true,data:false,js:true,jsf:"scr/registration/registration.js?v="+js_version},getModule);lib.setModule("userProfile_module",{html:true,data:false,js:true,jsf:"scr/userprofile/userprofile.js?v="+js_version},getUserProfileModule);lib.setModule("admin_module",{html:false,data:false,js:true,jsf:"scr/admin/adminCalendarAndGeneralJsFunctions.js?v="+js_version},getAdminModule);lib.setModule("adminRegistration_module",{html:true,data:false,js:true,jsf:"scr/admin/registrations/manageRegistrations.js?v="+js_version},getModule);lib.setModule("eventAdministrations_module",{html:true,data:false,js:true,jsf:"scr/admin/event_administration/event_administration.js?v="+js_version},getModule);lib.setModule("module_configuration",{html:true,data:false,js:true,jsf:"scr/admin/configuration/configuration.js?v="+js_version},getModule);lib.setModule("managePayments_module",{html:true,data:false,js:true,jsf:"scr/admin/manage_payment/managePayment.js?v="+js_version},getModule);lib.setModule("customerAdministration_module",{html:true,data:false,js:true,jsf:"scr/admin/customer_administration/customer_administration.js?v="+js_version},getModule);function showModalPopup(content,id,action,callFocus){wm.currentPopup=new StickyWin.Modal({content:content,id:id,position:"center",destroyOnClose:true,modalOptions:{modalStyle:{"background-color":"#d6e1b9",opacity:0.6}},onDisplay:function(){if(callFocus){callFocus()}catchEnter.pass([id,action])}})}function showWatingPopup(title){if(!title){title="Please wait, loading..."}var waitBar='<div class="waitbar-popup"><img src="'+wm.serverAddress+'img/WaitBar.gif" alt="Please wait, loading..." title="Please wait, loading..." style="clear: left;" />'+title+"</div>";showModalPopup(waitBar,"waitingPopupId",null)}function destroyPopup(){if(wm.currentPopup){if(Browser.Engine.trident&&Browser.Engine.version==4){wm.currentPopup.modalHide()}else{wm.currentPopup.modalHide().destroy()}}}function forgetPassword(el,userId){var params={service:"forgotpassword",email:userId,submitted:1};var fileurl=wm.serverAddress+"controller.php";el.destroy();showWatingPopup("Waiting for sending email");var req=new Request({method:"get",url:fileurl,data:params,evalScripts:false,onRequest:function(){},onSuccess:function(response){destroyPopup();var resp=JSON.decode(response);if(resp.result=="success"){var content="<div id='returnMessage' class=\"popup\"><p class='error'>"+resp.mess+"</p><input type='button' class='btn_r close' onclick='javascript:destroyPopup();' value='Close'</div>";var tmpsel=new Element("div",{html:content});showModalPopup(tmpsel.innerHTML,"claimPasswordTool",destroyPopup,function(){$("claimPasswordTool").getElement(".close").focus()})}else{var popupContent=lib.popups_module.html.claimPasswordTool;var tmpel=new Element("div",{html:popupContent});tmpel.getChildren()[0].appendTopHTML("<p class='error'>"+resp.mess+"</p>");showModalPopup(tmpel.innerHTML,"claimPasswordTool",forgetPasswordCatchEnter)}},onComplete:function(){},onFailure:function(){destroyPopup()}}).send()}function forgetPasswordCatchEnter(){forgetPassword($("claimPasswordTool"),$("claimPasswordTool").getElement(".claimemail").value)}function checkContainAdminMenu(input){var contain=false;var adminmenu=["header_payment","header_customer","header_event","header_configuration","header_registation","header_siteconfig"];for(i=0;i<adminmenu.length;i++){if(input.contains(adminmenu[i])){contain=true;break}}return contain}function requestService(module,service,menuItemName){if(checkContainAdminMenu(wm.parentArr)){Cookie.dispose("selectedMenu");Cookie.write("selectedMenu",module+"+"+service+"+"+menuItemName,{duration:31})}tm.activeMenu=menuItemName;tm.highlightMenu();lib.use(module,function(statement){if(statement=="done"){eval(service+"('"+menuItemName+"')")}})}function buildMenu(resp){var memberArea="<blockquote>";var parentarr=[];$A(resp.services).each(function(srv){if(srv.parentname){parentarr.include(srv.parentid);memberArea+='<div id="ttl_'+srv.parentname.trim()+'" class="catttl"><h5>'+srv.parentname+"</h5>";memberArea+="<div class='catcont'><ul>";$A(srv.children).each(function(kid){memberArea+="<li id='menu_"+kid.menuitemname+"'><a href='javascript:requestService(\""+srv.parentservice+'","'+kid.service+'","'+kid.menuitemname+"\");'>"+kid.name+"</a></li>"});memberArea+="</ul></div></div>"}});memberArea+="</blockquote>";var menu=new Element("div",{id:"userMenu-form",html:memberArea});$("left-container").adopt(menu);wm.parentArr=parentarr;if(parentarr[0]=="header_member"){if(!tm.ulElement){tm.setupUL()}lib.loadModule("userProfile_module")}else{if(checkContainAdminMenu(parentarr)){$("headsearch").style.display="none";var cookie=Cookie.read("selectedMenu");if(cookie){var cookieItems=cookie.split("+");$("menu_"+cookieItems[2]).addClass("here");requestService(cookieItems[0],cookieItems[1],cookieItems[2])}else{$("menu_new_regs").addClass("here");requestService("adminRegistration_module","setupNewRegistration","new_regs");Cookie.write("selectedMenu","adminRegistration_module+setupNewRegistration+new_regs",{duration:31})}lib.loadModule("admin_module");lib.injectJS(lib.startup_module.data.serverSiteAddress+"scr/userprofile/userprofile.js?v="+js_version)}}}function showClaimPasswdTool(error,email){var popupContent=lib.popups_module.html.claimPasswordTool;var el=new Element("div",{html:popupContent});if(error){el.getChildren()[0].appendTopHTML("<p>Sorry, we could not log you on with these details.<br/>Please try again.<br/>Alternatively, use this password retrieval tool<br/>if you have forgotten your password.</p>")}showModalPopup(el.innerHTML,"claimPasswordTool",forgetPasswordCatchEnter,function(){$("claimPasswordTool").getElement(".claimemail").focus()});if(email){$("claimPasswordTool").getElement(".claimemail").value=email}}function getLanguageAdmin(){var req=new Request({method:"post",url:wm.serverAddress+"controller.php",data:{service:"getLanguageAdmin"},evalScripts:false,onRequest:function(){},onSuccess:function(response){lib.languageAdmin=JSON.decode(response)},onComplete:function(){},onFailure:function(){destroyPopup()}}).send()}function doLogin(params,method,step){if(params.token){Cookie.write("selectedMenu","eventAdministrations_module+setupNewConference+create_conf",{duration:31})}var req=new Request({method:method,url:wm.serverAddress+"controller.php",data:params,evalScripts:false,onRequest:function(){},onSuccess:function(response){response=response.replace(/\\?%%([^(%%)]+)%%/g,function(match,name){if(match.charAt(0)=="\\"){return match.slice(1)}return(lib.languageMenu[name]!==undefined)?lib.languageMenu[name]:""});var resp=JSON.decode(response);if(resp.result=="success"){if(wm.registrationStep!=4){destroyPopup()}if(resp.hasAvailableUsers=="yes"){var availableUserList=[];resp.availableUsers.each(function(item){var newObject=new RegUser();$extend(newObject,item);availableUserList.push(newObject)});lib.data.availableUserList=availableUserList;wm.accessLevel=resp.access;if(step==2){setupStep2()}if(step==3){setupStep3()}}if(!wm.isLoggedIn){wm.leftmenuhtml=$("left-container").innerHTML;$("login-form").destroy();$("news-form").destroy();$("who_name").innerHTML="Welcome <span>"+resp.firstname+" "+resp.lastname+" ("+resp.email+")</span>";$("who_role").innerHTML=resp.access;$("hd2").set("html","<a href='"+wm.serverAddress+"controller.php?service=logout'>Logout</a>");if($$(".customerReturn a")[0]){$$(".customerReturn a")[0].hide()}wm.accessLevel=resp.access;if(wm.accessLevel!="member"){getLanguageAdmin();clearAllHistory()}wm.isLoggedIn=true;buildMenu(resp)}if(wm.timeoutsubmit){if(wm.previousaccid==resp.identify){if(wm.submitfunction&&wm.submitdata){wm.submitfunction(wm.submitdata)}else{if(wm.submitfunction){wm.submitfunction()}}}else{goToHome()}}wm.previousaccid=resp.identify}else{if(step){if(wm.currentPopup){wm.currentPopup.element.getElement(".message").innerHTML="Login failed"}}else{if(params.f_username){showClaimPasswdTool(true,params.f_username)}else{showClaimPasswdTool(true,null)}}}},onComplete:function(){},onFailure:function(){}});req.send()}function popupLogin(userId,password,el){var step="";if(wm.registrationStep){step=wm.registrationStep}doLogin({f_username:userId,f_password:password,service:"login",submitted:"1"},"post",step)}function updateHiddenMobile(acc){$("password-form").getElement(".userId").value=acc}function showMobilePasswordPopup(result){var popupContent=lib.popups_module.html.passwordPopupMobile;var el=new Element("div",{html:popupContent});var parentAcc=result.parentacc;var childAcc=result.childacc;if(result.hasparent=="yes"){el.getElement(".userId").value=parentAcc;var emailAcc='<input name="radio1" type="radio" checked="checked" onclick="updateHiddenMobile(\''+parentAcc+"')\"> I am&nbsp;"+parentAcc+'<br><input name="radio1" type="radio" onclick="updateHiddenMobile(\''+childAcc+"')\"> I am&nbsp;"+childAcc;el.getElement(".pwdEmail").innerHTML=emailAcc}else{var userId=result.account;el.getElement(".pwdEmail").innerHTML="mobile: "+userId;el.getElement(".userId").value=userId}showModalPopup(el.innerHTML,"mobilePasswordPopupId",popupLogin);$("password-form").getElement(".password").addEvent("focus",function(event){$("passwordPopupMobile").getElement(".message").set("html","")})}function catchEnterPasswordPopup(obj){var el=obj.element;var userId=$(el).getParent(".password-form").getElement(".userId").value;var password=$(el).getParent(".password-form").getElement(".password").value;popupLogin(userId,password,el)}function showUserIdUsedPopup(){var popupContent=lib.popups_module.html.userIdUsedPopup;showModalPopup(popupContent,"userIdUsedPopup")}function showEmailPasswordPopup(result){var popupContent=lib.popups_module.html.passwordPopup;var el=new Element("div",{html:popupContent});if(result.hasparent=="yes"){var parentAcc=result.parentacc;var childAcc=result.childacc;el.getElement(".userId").value=parentAcc;var funcString="$(this).getParent('.password-form').getElement('.userId').value =";var emailAcc='<input name="radio1" type="radio" checked="checked" onclick="'+funcString+"'"+parentAcc+"'\"> I am&nbsp;"+parentAcc+'<br><input name="radio1" type="radio" onclick="'+funcString+"'"+childAcc+"';\"> I am&nbsp;"+childAcc;el.getElement(".pwdEmail").innerHTML=emailAcc}else{var email=result.account;el.getElement(".pwdEmail").innerHTML=email;el.getElement(".userId").value=email}showModalPopup(el.innerHTML,"emailPasswordPopupId",popupLogin,function(){$$(".password")[0].focus()});$("password-form").getElement(".password").addEvent("focus",function(event){$("passwordPopup").getElement(".message").set("html","")});catchEnter("passwordPopup",catchEnterPasswordPopup)}function showReturningCustomerPopup(){var popupContent=lib.popups_module.html.returnCustomerPopup;showModalPopup(popupContent,"returningCustomerId",popupLogin)}function newAccountPopupFocus(){$("newAccountPopupId").getElement("input[type=button]").focus()}function destroyUserIdPopup(){var el=$$("input[name=email]")[0];el.value="";el.focus();destroyPopup();if($$("input[name=email]")[0]){$$("input[name=email]")[0].focus()}}function showNewAccountPopup(){var popupContent=lib.popups_module.html.newAccountPopup;showModalPopup(popupContent,"newAccountPopupId",destroyPopup,newAccountPopupFocus)}function authenticateUserID(type,userId){showWatingPopup("Checking for your "+userId+" in our database.","Checking database...",true);var parameters={userid:userId,service:"checkaccexist"};if(wm.currentConference){parameters.confNumber=wm.currentConference.number}var req=new Request.JSON({method:"get",url:wm.serverAddress+"controller.php",evalScripts:false,data:parameters,onRequest:function(){},onSuccess:function(responseJSON,responseText){destroyPopup();var resp=JSON.decode(responseText);if(resp.result=="exist"){if(type=="email"){showEmailPasswordPopup(resp)}else{showMobilePasswordPopup(resp)}}else{if(resp.isUsed){showUserIdUsedPopup()}else{showNewAccountPopup()}}},onComplete:function(){},onFailure:function(){}});req.send()}function menuEffect(){}function loginCatchEnter(){doLogin(formSerialize("#logform"),"post")}function clearMenu(){wm.isLoggedIn=false;$("left-container").innerHTML=wm.leftmenuhtml;$("who_name").innerHTML="";$("who_role").innerHTML="";$("who_name").hide();$("who_role").hide();$("hd2").set("html","<a onclick='$(\"username\").focus();'>Login</a>");$("timoutmsg").show();$("username").focus();catchEnter("logform",loginCatchEnter)}function NumberFormat(num,inputDecimal){this.COMMA=",";this.PERIOD=".";this.DASH="-";this.LEFT_PAREN="(";this.RIGHT_PAREN=")";this.LEFT_OUTSIDE=0;this.LEFT_INSIDE=1;this.RIGHT_INSIDE=2;this.RIGHT_OUTSIDE=3;this.LEFT_DASH=0;this.RIGHT_DASH=1;this.PARENTHESIS=2;this.NO_ROUNDING=-1;this.num;this.numOriginal;this.hasSeparators=false;this.separatorValue;this.inputDecimalValue;this.decimalValue;this.negativeFormat;this.negativeRed;this.hasCurrency;this.currencyPosition;this.currencyValue;this.places;this.tail="";this.roundToPlaces;this.setNumber=setNumberNF;this.toUnformatted=toUnformattedNF;this.setInputDecimal=setInputDecimalNF;this.setSeparators=setSeparatorsNF;this.setCommas=setCommasNF;this.setNegativeFormat=setNegativeFormatNF;this.setNegativeRed=setNegativeRedNF;this.setCurrency=setCurrencyNF;this.setTail=setTailNF;this.setCurrencyPrefix=setCurrencyPrefixNF;this.setCurrencyValue=setCurrencyValueNF;this.setCurrencyPosition=setCurrencyPositionNF;this.setPlaces=setPlacesNF;this.toFormatted=toFormattedNF;this.toPercentage=toPercentageNF;this.getOriginal=getOriginalNF;this.moveDecimalRight=moveDecimalRightNF;this.moveDecimalLeft=moveDecimalLeftNF;this.getRounded=getRoundedNF;this.preserveZeros=preserveZerosNF;this.justNumber=justNumberNF;this.expandExponential=expandExponentialNF;this.getZeros=getZerosNF;this.moveDecimalAsString=moveDecimalAsStringNF;this.moveDecimal=moveDecimalNF;this.isNumber=isNumberNF;if(inputDecimal==null){this.setNumber(num,this.PERIOD)}else{this.setNumber(num,inputDecimal)}this.setCommas(true);this.setNegativeFormat(this.LEFT_DASH);this.setNegativeRed(false);this.setCurrency(false);this.setCurrencyPrefix("$");this.setPlaces(2)}function setInputDecimalNF(val){this.inputDecimalValue=val}function setNumberNF(num,inputDecimal){if(inputDecimal!=null){this.setInputDecimal(inputDecimal)}if(""+num==""){this.numOriginal="";this.num="";return true}if(this.isNumber(""+num)){num=parseFloat(""+num)}else{this.numOriginal=num;this.num=num;return true}this.numOriginal=num;this.num=this.justNumber(num)}function toUnformattedNF(){return(this.num)}function getOriginalNF(){return(this.numOriginal)}function setNegativeFormatNF(format){this.negativeFormat=format}function setNegativeRedNF(isRed){this.negativeRed=isRed}function setSeparatorsNF(isC,separator,decimal){this.hasSeparators=isC;if(separator==null){separator=this.COMMA}if(decimal==null){decimal=this.PERIOD}if(separator==decimal){this.decimalValue=(decimal==this.PERIOD)?this.COMMA:this.PERIOD}else{this.decimalValue=decimal}this.separatorValue=separator}function setCommasNF(isC){this.setSeparators(isC,this.COMMA,this.PERIOD)}function setCurrencyNF(isC){this.hasCurrency=isC}function setTailNF(cp){this.tail=cp}function setCurrencyValueNF(val){this.currencyValue=val}function setCurrencyPrefixNF(cp){this.setCurrencyValue(cp);this.setCurrencyPosition(this.LEFT_OUTSIDE)}function setCurrencyPositionNF(cp){this.currencyPosition=cp}function setPlacesNF(p){this.roundToPlaces=!(p==this.NO_ROUNDING);this.places=(p<0)?0:p}function toFormattedNF(){if(!this.isNumber(""+this.num)){return""+this.num}var pos;var nNum=this.num;var nStr;var splitString=new Array(2);if(this.roundToPlaces){nNum=this.getRounded(nNum);nStr=this.preserveZeros(Math.abs(nNum))}else{nStr=this.expandExponential(Math.abs(nNum))}if(nStr.indexOf(this.PERIOD)==-1){splitString[0]=nStr;splitString[1]=""}else{splitString=nStr.split(this.PERIOD,2)}if(this.hasSeparators){pos=splitString[0].length;while(pos>0){pos-=3;if(pos<=0){break}splitString[0]=splitString[0].substring(0,pos)+this.separatorValue+splitString[0].substring(pos,splitString[0].length)}}if(splitString[1].length>0){nStr=splitString[0]+this.decimalValue+splitString[1]}else{nStr=splitString[0]}var c0="";var n0="";var c1="";var n1="";var n2="";var c2="";var n3="";var c3="";var negSignL=(this.negativeFormat==this.PARENTHESIS)?this.LEFT_PAREN:this.DASH;var negSignR=(this.negativeFormat==this.PARENTHESIS)?this.RIGHT_PAREN:this.DASH;if(this.currencyPosition==this.LEFT_OUTSIDE){if(nNum<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){n1=negSignL}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){n2=negSignR}}if(this.hasCurrency){c0=this.currencyValue}}else{if(this.currencyPosition==this.LEFT_INSIDE){if(nNum<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){n0=negSignL}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){n3=negSignR}}if(this.hasCurrency){c1=this.currencyValue}}else{if(this.currencyPosition==this.RIGHT_INSIDE){if(nNum<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){n0=negSignL}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){n3=negSignR}}if(this.hasCurrency){c2=this.currencyValue}}else{if(this.currencyPosition==this.RIGHT_OUTSIDE){if(nNum<0){if(this.negativeFormat==this.LEFT_DASH||this.negativeFormat==this.PARENTHESIS){n1=negSignL}if(this.negativeFormat==this.RIGHT_DASH||this.negativeFormat==this.PARENTHESIS){n2=negSignR}}if(this.hasCurrency){c3=this.currencyValue}}}}}nStr=c0+n0+c1+n1+nStr+n2+c2+n3+c3;if(this.negativeRed&&nNum<0){nStr='<font color="red">'+nStr+this.tail+"</font>"}return(nStr+this.tail)}function toPercentageNF(){nNum=this.num*100;nNum=this.getRounded(nNum);return nNum+"%"}function getZerosNF(places){var extraZ="";var i;for(i=0;i<places;i++){extraZ+="0"}return extraZ}function expandExponentialNF(origVal){if(isNaN(origVal)){return origVal}var newVal=parseFloat(origVal)+"";var eLoc=newVal.toLowerCase().indexOf("e");if(eLoc!=-1){var plusLoc=newVal.toLowerCase().indexOf("+");var negLoc=newVal.toLowerCase().indexOf("-",eLoc);var justNumber=newVal.substring(0,eLoc);if(negLoc!=-1){var places=newVal.substring(negLoc+1,newVal.length);justNumber=this.moveDecimalAsString(justNumber,true,parseInt(places))}else{if(plusLoc==-1){plusLoc=eLoc}var places=newVal.substring(plusLoc+1,newVal.length);justNumber=this.moveDecimalAsString(justNumber,false,parseInt(places))}newVal=justNumber}return newVal}function moveDecimalRightNF(val,places){var newVal="";if(places==null){newVal=this.moveDecimal(val,false)}else{newVal=this.moveDecimal(val,false,places)}return newVal}function moveDecimalLeftNF(val,places){var newVal="";if(places==null){newVal=this.moveDecimal(val,true)}else{newVal=this.moveDecimal(val,true,places)}return newVal}function moveDecimalAsStringNF(val,left,places){var spaces=(arguments.length<3)?this.places:places;if(spaces<=0){return val}var newVal=val+"";var extraZ=this.getZeros(spaces);var re1=new RegExp("([0-9.]+)");if(left){newVal=newVal.replace(re1,extraZ+"$1");var re2=new RegExp("(-?)([0-9]*)([0-9]{"+spaces+"})(\\.?)");newVal=newVal.replace(re2,"$1$2.$3")}else{if(re1.test(newVal)){newVal=RegExp.leftContext+RegExp.$1+extraZ+RegExp.rightContext}var re2=new RegExp("(-?)([0-9]*)(\\.?)([0-9]{"+spaces+"})");newVal=newVal.replace(re2,"$1$2$4.")}newVal=newVal.replace(/\.$/,"");return newVal}function moveDecimalNF(val,left,places){var newVal="";if(places==null){newVal=this.moveDecimalAsString(val,left)}else{newVal=this.moveDecimalAsString(val,left,places)}return parseFloat(newVal)}function getRoundedNF(val){val=this.moveDecimalRight(val);val=Math.round(val);val=this.moveDecimalLeft(val);return val}function preserveZerosNF(val){var i;val=this.expandExponential(val);if(this.places<=0){return val}var decimalPos=val.indexOf(".");if(decimalPos==-1){val+=".";for(i=0;i<this.places;i++){val+="0"}}else{var actualDecimals=(val.length-1)-decimalPos;var difference=this.places-actualDecimals;for(i=0;i<difference;i++){val+="0"}}return val}function justNumberNF(val){newVal=val+"";var isPercentage=false;if(newVal.indexOf("%")!=-1){newVal=newVal.replace(/\%/g,"");isPercentage=true}var re=new RegExp("[^\\"+this.inputDecimalValue+"\\d\\-\\+\\(\\)e]","g");newVal=newVal.replace(re,"");var tempRe=new RegExp("["+this.inputDecimalValue+"]","g");if(tempRe.test(newVal)){newVal=RegExp.leftContext+this.PERIOD+RegExp.rightContext.replace(tempRe,"")}if(newVal.charAt(newVal.length-1)==this.DASH){newVal=newVal.substring(0,newVal.length-1);newVal="-"+newVal}else{if(newVal.charAt(0)==this.LEFT_PAREN&&newVal.charAt(newVal.length-1)==this.RIGHT_PAREN){newVal=newVal.substring(1,newVal.length-1);newVal="-"+newVal}}newVal=parseFloat(newVal);if(!isFinite(newVal)){newVal=0}if(isPercentage){newVal=this.moveDecimalLeft(newVal,2)}return newVal}function isNumberNF(sText){if(sText==""){return false}var ValidChars="0123456789.";var IsNumber=true;var Char;var dotCnt=0;for(i=0;i<sText.length&&IsNumber==true;i++){Char=sText.charAt(i);if(Char=="."){dotCnt=dotCnt+1}if(ValidChars.indexOf(Char)==-1||dotCnt>1){IsNumber=false}}return IsNumber}function storeForm(locationName,data,func,formSelector){var parameters=new Hash();var back=false;if(data&&data.back){back=data.back;data.back=false}if(data){parameters=data}parameters.formSelector=formSelector;db.setCurrentLocation(locationName);if(formSelector){db.setCurrentForm(formSelector)}else{db.setCurrentForm(data)}if(data){parameters.backButFunc=func}if(!tm.activeMenu){tm.activeMenu=locationName}var obj={};obj.dataObj=(!data)?{}:parameters;obj.func=func;obj.activeMenu=tm.activeMenu;obj.activeMasterTab=tm.activeMasterTab;if(back){return}else{dhtmlHistory.add(locationName,obj)}}function clearAllHistory(){window.historyStorage.reset()}function getPanel(location){var storage=db.getStorage(location);var func=storage.func;var data=storage.dataObj;func(data)}function updateUI(newLocation,historyData){if(db.currentForm){db.extendData(db.currentLocation,formSerialize(db.currentForm))}if(historyData){var data=historyData.dataObj;var func=historyData.func;tm.activeMenu=historyData.activeMenu;var oldActiveMasterTab=tm.activeMasterTab;tm.activeMasterTab=historyData.activeMasterTab;tm.highlightMenu();if(oldActiveMasterTab!==historyData.activeMasterTab){tm.drawTabs()}if(func){if(lib.divtable){lib.divtable.destroy();lib.divtable=null}data.back=true;func(data);doSize()}}}var historyChange=function(newLocation,historyData){updateUI(newLocation,historyData)};window.onload=function(){dhtmlHistory.initialize();dhtmlHistory.addListener(historyChange);storeForm("search",{status:["OPEN"]},goToHome)};window.dhtmlHistory.create({toJSON:function(o){return JSON.encode(o)},fromJSON:function(s){return JSON.decode(s)}});function adminSearch(searchStr,status,topic,state,year){var catid=searchStr?null:topic;if(catid=="all"){catid=""}var stateid=searchStr?null:state;var confarr=lib.startup_module.data.Conferences;var archived=lib.startup_module.data.Archived_Conferences;if(!archived){archived={}}var results=$H(confarr).combine(archived).filter(function(s){var matchString=true;var matchConfId=true;var matchCategories=true;var matchState=true;var matchStatus=true;var matchYear=true;if(catid){matchCategories=(s.category1==catid||s.category2==catid||s.category3==catid)}if(stateid){matchState=(s.state==stateid)}if(!status){status=[];status[0]="OPEN";status[1]="CANCELLED";status[2]="COMPLETED";status[3]="CLOSED"}if(status){var daterr=s.startdate.split("/");matchYear=(daterr[2]===year||year==="");matchStatus=s.status===status[0]||s.status==status[1]||s.status==status[2]||s.status==status[3]}if(searchStr){if(searchStr.confid){matchConfId=(s.number==searchStr.confid)||(s.conf_id==searchStr.confid);matchStatus=true;matchYear=true}else{if(searchStr.title){var searchfor=searchStr.title;var searchin=s.name+"~"+s.title+"~"+s.venuename+"~"+s.venue+"~"+s.state;var strarr=searchfor.split("000");var matcheachitem=false;strarr.each(function(item){if(lib.listofNormalText.indexOf(item.toLowerCase())===-1&&!item.test("( )")&&item.trim()!==""){matcheachitem=matcheachitem||searchin.toLowerCase().indexOf(item.toLowerCase())>=0}});if(lib.listofNormalText.indexOf(searchfor.toLowerCase())===-1){matchString=searchin.toLowerCase().indexOf(searchfor.toLowerCase())>=0||matcheachitem}else{matchString=false}}}}return matchString&&matchCategories&&matchState&&matchStatus&&matchConfId&&matchYear});return results}function venueCallBack(item){window.open(item.url)}function pdfCallBack(item){var clientId=lib.startup_module.data.clientId;window.open(wm.serverAddress+"downloads/"+clientId+"/programs/"+item.startdate.split("/")[2]+"/"+item.program_link)}function pdfDivTable(item){return"<img height='16' src='"+wm.serverAddress+"img/pdf.gif'/>&nbsp;"}function dateDivTable(item){return $A(item.startdate.split("-")).reverse().join("/")}function cleanupRegistrationSearhDivTable(){if(lib.divtable){lib.divtable.destroy();lib.divtable=null}}function doRegistration(data){lib.use("registration_module",function(statement){if(statement=="done"){setupStep1(data)}else{alert("problem loading module:registration_module please contact support")}})}function registerCallBack(item){doRegistration({conferenceNumber:item.number,title:escape(item.title)});if(item.status=="OPEN"){cleanupRegistrationSearhDivTable()}}function registerDivTable(item){var registerfield="";switch(item.status){case"OPEN":registerfield="Register Now";break;case"CLOSED":registerfield="Closed";break;case"COMPLETED":registerfield="Completed";break;case"CANCELLED":registerfield="Cancelled";break;default:registerfield="Closed"}return registerfield}function costDivTable(item){return localeNumberFormat(Number(item.dayCostGST),"$",",",2)+" / "+localeNumberFormat(Number(item.fullincGST),"$",",",2)}function fullCostDivTable(item){return localeNumberFormat(Number(item.fullincGST),"$",",",2)}function publicSearch(data){var srcString;var status;if(data){srcString=data.searchString?data.searchString:"";status=data.status?data.status:["OPEN"]}else{srcString="";status=["OPEN"]}var catid=srcString?null:data.conftopic?data.conftopic:$("conf_topic").value;var stateid=srcString?null:data.confstate?data.confstate:$("msconfstate").value;data.conftopic=catid;data.confstate=stateid;var conferences=adminSearch((srcString?{confid:null,title:srcString}:null),status,catid,stateid,"");tm.hideTabs();if(lib.divtable){return lib.divtable.changeData(conferences)}wm.divs.dynamic.innerHTML="";lib.divtable=new divTable({columns:[{title:"PDF",templ:pdfDivTable,callback:pdfCallBack,width:40,linkfmt:"Aaa",hover:"Open the conference PDF for: {title}"},{title:"Conference details",templ:"{name}",width:200,linkfmt:"Aaa",sort:true},{title:"",templ:registerDivTable,callback:registerCallBack,width:70,linkfmt:"Aaa",sort:true},{title:"State",templ:"{state}",width:50,linkfmt:"Aaa",sort:true,"class":"center-align"},{title:"Venue",templ:"{venuename}",callback:venueCallBack,linkfmt:"Aaa",sort:true},{title:"Start date",templ:dateDivTable,width:60,sort:true,type:"date",linkfmt:"x"},{title:"Days",templ:"{days}",width:50,sort:true,linkfmt:"aaaaa","class":"center-align"},{title:"Cost/1day (inc GST)",templ:costDivTable,sort:true,linkfmt:"aaaaa","class":"right-align"}],data:conferences,rowHeight:20,target:wm.divs.dynamic,sortCol:5});return lib.divtable}function goToHome(data){var search=lib.startup_module.html.search;nextPanel("fixed",search);if(data&&data!="member_search"){publicSearch(data);if(data.status){for(var i=0;i<data.status.length;i++){if($("searchOptions").getElement("."+data.status[i])){$("searchOptions").getElement("."+data.status[i]).checked=true}}}if(data.conftopic){$("conf_topic").value=data.conftopic}if(data.confstate){$("msconfstate").value=data.confstate}storeForm("search",data,goToHome)}else{$("searchOptions").getElement(".OPEN").checked=true;publicSearch({status:["OPEN"]});doSize();storeForm("search",{status:["OPEN"]},goToHome)}if($("menu_member_search")){$("menu_member_changepass").removeClass("here");$("menu_member_viewregs").removeClass("here");$("menu_member_editprofile").removeClass("here");$("menu_member_search").addClass("here")}}function publicFilterSearch(searchid,isAdmin){var options=[];$$("#"+searchid+" input").each(function(el){if(el.checked===true){options.push(el.name)}});if(lib.enableTextSearch){publicSearch({searchString:$("txtSearch").value,status:options},isAdmin)}else{publicSearch({searchString:null,status:options},isAdmin)}}function submitSearch(srcString){lib.enableTextSearch=false;var options=$$("#searchOptions input");if(!options.some(function(el){return el.checked})){options[0].checked=true}publicFilterSearch("searchOptions")};
