function getGridData(b,g){var f="";if(g!=""){f=g}if(document.getElementById("divPageLoadMessage").innerHTML!=""){grayOut(true)}new Ajax.Request(b,{asynchronous:false,onSuccess:stateChanged,onFailure:function(h){alert("Oops, there's been an error."+h.responseText)},parameters:f})}function getTabbarObj(){tabbar=new dhtmlXTabBar("a_tabbar","top");tabbar.setImagePath("/images/dhtmlxtabbar/");tabbar.setOnSelectHandler(getGridTab)}function getrecordCount(){document.getElementById("recdiv").style.display="block";var b=document.getElementById("recfound");b.style.color="";if(mygrid.getRowsNum()){b.innerHTML=mygrid.getRowsNum()+" ";if(document.getElementById("exceltd")){document.getElementById("exceltd").style.display="block"}}else{b.innerHTML=" No ";if(document.getElementById("exceltd")){document.getElementById("exceltd").style.display="none"}}}var response;var counti=0;var imgfunc="";var imagechange="";var extrarg=0;var earg1="a_tabbar";var earg2="grayout_div";function getImgClick(m,k,f,b){if(arguments.length>4){extrarg=1;earg1=arguments[4];earg2=arguments[5]}if(!document.getElementById(earg1)){earg1="a_tabbar"}if(!document.getElementById(earg2)){earg2="grayout_div"}grayOut(true,earg1,earg2);var h=m;imagechange=b;var l;if(parseInt(f)){l=0}else{l=1}imgfunc='^^getImgClick("'+m+'","'+k+'","'+l+'","'+imagechange;if(extrarg){imgfunc+='","'+earg1+'","'+earg2}imgfunc+='");';requestParams="status="+f;var g=confirm("Are you sure you want to change the "+k);if(g){counti=1;new Ajax.Request(m,{asynchronous:false,onSuccess:stateImageChange,onFailure:function(n){alert("Oops, there's been an error."+n.responseText)},parameters:requestParams})}else{counti=0;imgfunc="";response=0;grayOut(false,earg1,earg2);return false}}function stateImageChange(b){response=b.responseText;grayOut(false,earg1,earg2)}var actionlightUrl;var lightWidth;var lightHeight;var lightPagetitle;var lightStatus;var toggle=0;function openlightwindow(g,k,l,f,b,h){imagechange=b;counti=0;actionlightUrl=k;lightWidth=l;lightHeight=f;lightPagetitle=g;lightStatus=h;if(arguments.length>6){toggle=arguments[6]}else{toggle=0}startLyteWindowFrame(g,k,l,f)}function findindex(g,h){var b=0;for(var f=0;f<h.length;f++){if(h[f]==g){b=1;break}else{b=0}}return b}function paramsArray(){var b=0;if(document.getElementById("isSuper")!=null){b=document.getElementById("isSuper").value}var g=["type","XML"];if(b){var f=0;if(document.getElementById("lstLicensee")){f=document.getElementById("lstLicensee").value}else{if(document.getElementById("lstLicenseeId")){f=document.getElementById("lstLicenseeId").value}}if(f){g=g.concat(["licenseeid",f])}}return g}function dataSearchLoad(g,f){var m=trim(document.getElementById("txtSearch").value);if(m!=""){var h=document.getElementById("lstTypeOfSearch").value;var l=3;if(arguments.length>2){if((arguments[2]=="instructor"||arguments[2]=="order"||arguments[2]=="instructorstatus"||arguments[2]=="zinmembershipdetails")&&h=="instructorStatusID"){l=1;if(!parseInt(m)){alert("Zero will not allowed");return false}}}getData();mygrid.init();if(m.length>=l){document.getElementById("gridbox").style.display="block";var b=document.getElementById("lstTypeOfComp").value;var k=new Array("status",g,"lstTypeOfSearch",h,"lstTypeOfComp",b);grayOut(true,"a_tabbar","grayout_div");k=k.concat(paramsArray());if(document.getElementById("txtSearch")!=null){k=k.concat("txtSearch",m)}if(document.getElementById("lstMemTypeId")!=null){if(document.getElementById("lstMemTypeId").value){k=k.concat("memTypeId",document.getElementById("lstMemTypeId").value)}}if(document.getElementById("instructorIsGuestMember")!=null){var n=0;if(document.getElementById("instructorIsGuestMember").checked){n=1}k=k.concat("chkGuest",n)}var o=urlParams(k);f=f+o;attachFilters();mygrid.loadXML(f,function(){grayOut(false,"a_tabbar","grayout_div")})}else{document.getElementById("recdiv").style.display="none";document.getElementById("gridbox").style.display="none";alert("Search value should be mimmum "+l+" characters");document.getElementById("txtSearch").value="";document.getElementById("txtSearch").focus();return false}}else{document.getElementById("recdiv").style.display="none";document.getElementById("gridbox").style.display="none";alert("Please Enter the search value");document.getElementById("txtSearch").value="";document.getElementById("txtSearch").focus();return false}}function getDhtmlGridTab(h,g){var b=document.getElementById("action").value;if(document.getElementById("txtSearch")!=null){var f=trim(document.getElementById("txtSearch").value);if(document.getElementById("searchonload")!=null&&f==""){dataLoad(h,b)}else{if(f!=""){if(typeof moduleName!="undefined"){dataSearchLoad(h,b,moduleName)}else{dataSearchLoad(h,b)}}}}else{dataLoad(h,b)}tabbar.setContent(h,"gridbox");return true}function rowSelectEvent(arrCellIds,row_id,column_index){if(counti){var find=findindex(column_index,arrCellIds);var gridobj;if(arguments.length>3){gridobj=eval(arguments[3])}else{gridobj=mygrid}var cellcontent=gridobj.cells(row_id,column_index).getValue();if(find&&cellcontent.toLowerCase().indexOf("hold")==-1){grayOut(true,earg1,earg2);images=imagechange.split("|");if(response==1||response==0){if(parseInt(response)){gridobj.cells(row_id,column_index).setValue(IMAGES_PATH+images[0]+imgfunc);if(typeof tabbar!="undefined"){if(tabbar.getActiveTab()!="All"){mygrid.deleteRow(row_id);getrecordCount()}}}else{if(parseInt(response)==0){gridobj.cells(row_id,column_index).setValue(IMAGES_PATH+images[1]+imgfunc);if(typeof tabbar!="undefined"){if(tabbar.getActiveTab()!="All"){mygrid.deleteRow(row_id);getrecordCount()}}}}response=""}else{alert(response)}grayOut(false,earg1,earg2)}else{imgfunc=""}}else{rowid=row_id;columnindex=column_index}}function dataLoad(b,f){getData();document.getElementById("gridbox").style.display="block";if(typeof tabbar!="undefined"){grayOut(true,"a_tabbar","grayout_div")}else{grayOut(true,"gridbox","grayout_div")}var h=paramsArray();h=h.concat(["status",b]);var g=f+urlParams(h);mygrid.init();attachFilters();mygrid.loadXML(g,function(){if(typeof tabbar!="undefined"){grayOut(false,"a_tabbar","grayout_div")}else{grayOut(false,"gridbox","grayout_div")}})}function callFunction(b,f){var g=trim(document.getElementById("txtSearch").value);if(g!=""){dataSearchLoad(b,f)}else{dataLoad(b,f)}}function doUpdateOrder(g,k,f,h,b){if(g==2){if(trim(h)!=""){if(h.length<=3){if(isNaN(h)){mygrid.cells(k,f).setValue(b);alert("Order must be integer value")}}else{alert("Order should be equal or lessthan 3 charcters");mygrid.cells(k,f).setValue(b)}}else{alert("Order should not be empty");mygrid.cells(k,f).setValue(b)}}return true}function changeGridCell(){images=window.parent.imagechange.split("|");if(parseInt(lightwindowresponse)){var b;if(!window.parent.toggle){if(window.parent.lightStatus){b=0}else{b=1}imgst=b;imgplaced=images[0]}else{b=1;if(lightwindowresponse==2){imgplaced=images[2];imgst=2}else{imgplaced=images[0];imgst=b}}imgfunc='^^openlightwindow("'+window.parent.lightPagetitle+'","'+window.parent.actionlightUrl+'",'+window.parent.lightWidth+","+window.parent.lightHeight+',"'+window.parent.imagechange+'",'+imgst;imgfunc+=","+window.parent.toggle;imgfunc+=");";if(b){window.parent.mygrid.cells(window.parent.rowid,window.parent.columnindex).setValue(window.parent.IMAGES_PATH+imgplaced+imgfunc)}else{window.parent.mygrid.cells(window.parent.rowid,window.parent.columnindex).setValue(window.parent.IMAGES_PATH+images[1]+imgfunc)}}else{if(window.parent.toggle){images=window.parent.imagechange.split("|");imgfunc='^^openlightwindow("'+window.parent.lightPagetitle+'","'+window.parent.actionlightUrl+'",'+window.parent.lightWidth+","+window.parent.lightHeight+',"'+window.parent.imagechange+'",0,1);';window.parent.mygrid.cells(window.parent.rowid,window.parent.columnindex).setValue(window.parent.IMAGES_PATH+images[1]+imgfunc)}}lytebox_close()}function getSubTopics(f,b){if(f!=""){new Ajax.Request(b,{parameters:"topicName="+f,asynchronous:false,onSuccess:function(g){document.getElementById("trSubtopics").style.display="";document.getElementById("tdSubtopics").innerHTML=g.responseText},onFailure:function(g){alert("Oops, there's been an error."+g.responseText)}})}else{document.getElementById("trSubtopics").style.display="none";document.getElementById("contact-helper").style.display="none";alert("Select the Topic")}}function getSubTopicHelp(b,g,f){if(b!=""){new Ajax.Request(f,{parameters:"topicName="+g+"&subtopicName="+b,asynchronous:false,onSuccess:function(h){if(b=="Cancel My ZIN Membership"){document.getElementById("txaComments").style.display="none";document.getElementById("txaCommentsLabel").style.display="none"}else{document.getElementById("txaComments").style.display="block";document.getElementById("txaCommentsLabel").style.display="block"}if(h.responseText){document.getElementById("contact-helper").style.display="block";document.getElementById("contact-helper").innerHTML="<p>"+h.responseText+"</p>"}else{document.getElementById("contact-helper").style.display="none"}},onFailure:function(h){alert("Oops, there's been an error."+h.responseText)}})}else{document.getElementById("contact-helper").style.display="none";alert("Select the Sub Topic")}}function checkValidity(b){if(trim(document.frmmail.txaComments.value)==""){alert("Please Enter Comments");return false}event_sendmail(b);return true}function lytebox_close(){window.parent.location.reload(true)}function event_sendmail(b){var f="";new Ajax.Request(b,{onSuccess:getmail,onFailure:function(g){alert("Oops, there's been an error."+g.responseText)},parameters:f,method:"post",asynchronous:false})}function getmail(f){var b=parseInt(f.responseText);if(b){alert("Successfully Mail is Sent")}else{alert("Failure while sending mail!!Try again!!")}lytebox_close()}function getEndHrs(l,h,m){if(trim(h)!=""){if(m){var f='<select  name="lstEndHrs"  style="width:80px;"><option value=\'\'>Select Hour </option>';document.getElementById("endHrsId").innerHTML="";var b=["12am","1am","2am","3am","4am","5am","6am","7am","8am","9am","10am","11am","12pm","1pm","2pm","3pm","4pm","5pm","6pm","7pm","8pm","9pm","10pm","11pm"];finalval=0;for(var g=0;g<l;g++){var k=parseInt(h)+g;k=(k%24);if(k>12){if(!g){finalval=parseInt(b[k])}else{finalval=finalval+1}strval=finalval+"pm"}else{if(k==12){strval=k+"pm"}else{if(!k){intval=12}else{intval=k}strval=intval+"am"}}if(g==1){selected="selected"}else{selected=""}f+="<option value='"+k+"'"+selected+">"+strval+"</option>"}f+="</select";document.getElementById("endHrsId").innerHTML=f}else{document.getElementById("lstEndMins").value=h}}}function toggle_div(b){if(document.getElementById("lstWorkshopId").value!=""){if(b==1){document.getElementById("wsPrice").value=document.getElementById("price").value;document.getElementById("optUserSel1").checked=true;document.getElementById("optUserSel2").checked=false;document.getElementById("newuser").style.display="block";document.getElementById("ccDetails").style.display="block";document.getElementById("exuser").style.display="none";document.getElementById("pcode").style.display="none";document.getElementById("instructor").value="";document.getElementById("txtwsPromotion").value="";return false}else{if(b==2){document.getElementById("wsPrice").value="";document.getElementById("instructor").value="";document.getElementById("txtexFirstName").value="";document.getElementById("txtexLastName").value="";document.getElementById("txtexUsername").value="";document.getElementById("txtwsPromotion").value="";document.getElementById("txtexEmail").value="";document.getElementById("optUserSel1").checked=false;document.getElementById("optUserSel2").checked=true;document.getElementById("exuser").style.display="block";document.getElementById("newuser").style.display="none";document.getElementById("ccDetails").style.display="block";document.getElementById("pcode").style.display="none";document.getElementById("txtwsPromotion").value="";return false}}}else{alert("Please select Workshop");document.getElementById("optUserSel1").checked=false;document.getElementById("optUserSel2").checked=false;return false}}function submitZesWsForm(objForm,arrFormValidationnew,arrFormValidationex,urluser,urlemail){if(document.frmaddregister.lstWorkshopId.value==""){alert("Please select Workshop");return false}if(document.getElementById("optUserSel1").checked==false&&document.getElementById("optUserSel2").checked==false){alert("Please make User Selection");return false}if(document.getElementById("optUserSel1").checked==true){return checkvalid(objForm,arrFormValidationnew,urlemail)}else{if(validateForm(objForm,arrFormValidationex)){if(eval("document."+objForm.name+".instructor")){var licenseeId=eval("document."+objForm.name+".lstLicensee.value");var workshopId=eval("document."+objForm.name+".lstWorkshopId.value");workshopId+="&lstWorkshopId="+workshopId;var user=isExists(urluser,objForm.name,"instructor","workshopRegistrationId",licenseeId,workshopId);if(user){alert("User already Registered for this Workshop!!!");return false}}}else{return false}}}function checkvalid(objForm,arrFormValidationnew,urlemail){var res=checkValidform(objForm,arrFormValidationnew,"txtUserName","workshopRegistrationId","User Name");if(res){if(eval("document."+objForm.name+".txtEmail")){var licenseeId=eval("document."+objForm.name+".lstLicensee.value");var useremail=isExists(urlemail,objForm.name,"txtEmail","workshopRegistrationId",licenseeId);if(useremail){alert("User with this Email already exists!!!");return false}}}else{return false}}function populatebillinfo(){frm=document.frmaddregister;if(frm.chksame.checked){copyGeodropdowns(frm.chksame.checked,"home","bill");frm.txtbFirstName.value=frm.txtFirstName.value;frm.txtbLastName.value=frm.txtLastName.value;frm.txtBillAdd.value=frm.txtHomeAdd.value;frm.lstBillCountryId.value=frm.lstHomeCountryId.value;frm.txtBillZip.value=frm.txtHomeZip.value}else{frm.txtbFirstName.value="";frm.txtbLastName.value="";frm.txtBillAdd.value="";frm.lstBillCountryId.value="";frm.lstBillStateId.value="";frm.lstBillCityId.value="";frm.txtBillZip.value="";document.getElementById("billStates").style.display="block";document.getElementById("billcity").style.display="block"}}function functionclear(){document.getElementById("txtInstructor").value="";document.getElementById("instructor").value="";document.getElementById("txtexFirstName").value="";document.getElementById("txtexLastName").value="";document.getElementById("txtexUsername").value="";document.getElementById("txtwsPromotion").value="";document.getElementById("txtexEmail").value="";document.getElementById("wsPrice").value="";document.getElementById("pcode").style.display="none"}function validateComments(h,f,b){if(validateForm(h,f)){var g;new Ajax.Request(b,{asynchronous:false,method:"post",postBody:Form.serialize(h),onSuccess:function(m){var l=m.responseText;var k=l.split("|");alert(k[0]);if(k.length>1){if(parseInt(k[1])){lightwindowresponse=k[1];changeGridCell()}}},onFailure:function(k){alert("Oops, there's been an error."+k.responseText)}});return false}else{return false}}function getDataByWorkshopId(g,f){var b=g.split("|");workshopSelectedId=b[0];if(workshopSelectedId==""){document.getElementById("gridbox").style.display="none";document.getElementById("recdiv").style.display="none";document.getElementById("comments").style.display="none";document.getElementById("postedComments").style.display="none";document.getElementById("pcId").style.display="none";document.getElementById("vcId").style.display="none";document.getElementById("excel").style.display="none";document.getElementById("printall").style.display="none";document.getElementById("prereconcil").style.display="none";document.getElementById("finalreconcil").style.display="none";alert("please select workshop")}else{document.getElementById("pcId").style.display="block";document.getElementById("vcId").style.display="block";document.getElementById("excel").style.display="block";document.getElementById("printall").style.display="block";document.getElementById("excel").innerHTML=ReplaceUrl(document.getElementById("excel").innerHTML,workshopSelectedId);document.getElementById("printall").innerHTML=ReplaceUrl(document.getElementById("printall").innerHTML,workshopSelectedId);document.getElementById("pstcommt").innerHTML=ReplaceUrl(document.getElementById("pstcommt").innerHTML,workshopSelectedId);if(b[1]==prereconciled){document.getElementById("finalreconcil").style.display="block";document.getElementById("finalreconcil").innerHTML=ReplaceUrl(document.getElementById("finalreconcil").innerHTML,workshopSelectedId);document.getElementById("prereconcil").innerHTML=ReplaceUrl(document.getElementById("prereconcil").innerHTML,workshopSelectedId);document.getElementById("prereconcil").style.display="none"}else{document.getElementById("prereconcil").style.display="block";document.getElementById("prereconcil").innerHTML=ReplaceUrl(document.getElementById("prereconcil").innerHTML,workshopSelectedId);document.getElementById("finalreconcil").innerHTML=ReplaceUrl(document.getElementById("finalreconcil").innerHTML,workshopSelectedId);document.getElementById("finalreconcil").style.display="none"}getGrid(workshopSelectedId,f);document.getElementById("comments").style.display="none";document.getElementById("postedComments").style.display="none"}}function getGrid(b,f){var h=["workshopId",b];var g=f+urlParams(h)+"/";dataLoad("All",g)}function finalreconcil(b){var f=confirm("Please click OK to confirm you have Pre-reconciled your Workshop.Zumba Office will be notified to revise and process any eventual comments.If you are not sure, click CANCEL.For any questions, contact us at recon@zumba.com");if(f){new Ajax.Request(b,{onSuccess:function(g){if(parseInt(g.responseText)){alert("Workshop Finalized Successfuly.")}else{alert("Error while Workshop Finalizing.")}window.location.reload(true)},onFailure:function(g){alert("Oops, there's been an error."+g.responseText)},method:"post",asynchronous:false})}else{return false}}function prereconcil(b){var f=confirm("Please click OK to confirm you have finished your Workshop Pre-Reconciliation. You will NOT be able to perform ANY modifications (other than processing new ZIN members) once you click OK.  If you are not sure , click CANCEL. For any questions, contact us at recon@zumba.com");if(f){new Ajax.Request(b,{onSuccess:function(l){if(parseInt(l.responseText)){alert("Workshop pre-reconcilized.");var h=document.getElementById("lstWorkshopId").selectedIndex;var k=document.getElementById("lstWorkshopId").value;var g=k.split("|");document.getElementById("lstWorkshopId").options[h].value=g[0]+"|"+prereconciled;document.getElementById("finalreconcil").style.display="block";document.getElementById("prereconcil").style.display="none"}else{alert("Error while Workshop pre-reconcilizing.")}},onFailure:function(g){alert("Oops, there's been an error."+g.responseText)},method:"post",asynchronous:false})}else{return false}}function Comments(g,b,f){if(document.frmAdminPostCmt.txaComments.value!=""){SubmitPostedComments(g,b,f)}else{alert("please enter comments")}}function SubmitPostedComments(f,b,h){var g;new Ajax.Request(b,{asynchronous:false,method:"post",postBody:Form.serialize(f),onSuccess:function(k){if(parseInt(k.responseText)){alert("comments posted successfully");window.parent.PostComments(h);window.parent.myLightWindow.deactivate()}else{alert("Error while posting comments")}},onFailure:function(k){alert("Oops, there's been an error."+k.responseText)}})}function validateBusinessContact(h,f,b){if(validateForm(h,f)){var g;new Ajax.Request(b,{asynchronous:false,method:"post",postBody:Form.serialize(h),onSuccess:function(k){if(k.responseText==1){document.getElementById("frmContactInstructor").style.display="none";document.getElementById("profile").style.display="block"}else{alert("Oops, there was an error while sending your message.");document.getElementById("frmContactInstructor").style.display="block";document.getElementById("profile").style.display="none"}},onFailure:function(k){alert("Oops, there's been an error."+k.responseText);document.getElementById("frmContactInstructor").style.display="block";document.getElementById("profile").style.display="none"}});return false}else{return false}}function validateContactForm(g,f){if(validateForm(g,f)){var b=document.getElementById("lstSubTopicId").value;if(b!="Cancel My ZIN Membership"){if(trim(document.getElementById("txaComments").value)==""){alert("Please Enter Comments");return false}}return true}}function validateForm(l,f){for(var k in f){for(var g=0;g<f[k].length;g++){objValue=document.getElementById(k);if(objValue==null){objValue=l[k]}if(objValue==null||objValue.disabled){continue}var h=f[k][g][0];var b=h.substr(h.search("=")+1);if((pos=b.search("ifchecked:"))==0){if(!document.getElementById(b.substr(10)).checked){continue}}if(validateData(l,objValue,h,f[k][g][1])==false){if(arguments.length>2&&arguments[3]=="tabbar"){tabbar.setTabActive(arguments[2])}if(objValue.type!="hidden"&&objValue.focus){objValue.focus()}return false}}}return true}function validateData(objForm,objValue,strValidateStr,strError){var epos=strValidateStr.search("=");var command="";var cmdvalue="";if(objValue==null||objValue.disabled){return true}if(epos>=0){command=strValidateStr.substring(0,epos);cmdvalue=val=strValidateStr.substr(epos+1);if((pos=cmdvalue.search("value:"))==0){cpos=cmdvalue.search(",");if(cpos==-1){val=document.getElementById(cmdvalue.substr(6)).value;if(val==null){val=eval("document."+objForm.name+"."+cmdvalue.substr(6)+".value")}}else{fld=cmdvalue.substr(6,cpos-6);fldval=cmdvalue.substr(cpos+1);val=document.getElementById(fld).value;if(val==null){val=eval("document."+objForm.name+"."+fld+".value")}if(fldval!=val){command=""}}cmdvalue=val}if((pos=cmdvalue.search("expr:"))==0){val=getExpr(cmdvalue.substr(5))}if((pos=cmdvalue.search("ifchecked:"))==0){if(!document.getElementById(cmdvalue.substr(10)).checked){command=""}}if((pos=cmdvalue.search("valueOf:"))==0){val=document.getElementById(cmdvalue.substr(8)).value;if(val==null){val=eval("document."+objForm.name+"."+cmdvalue.substr(8)+".value")}cmdvalue=val}}else{command=strValidateStr}cmdvalue=trim(cmdvalue);switch(command){case"url":if(objValue.value=="www"){alert(strError);return false}break;case"req":case"required":err=false;if(isRadio(objValue)){if(!isRadioChecked(objValue)){err=true}}else{if(eval(trim(objValue.value).length)==0){err=true}}if(err){if(!strError||strError.length==0){strError=objValue.name+" : Required Field"}alert(strError);return false}break;case"maxlength":case"maxlen":if(eval(trim(objValue.value).length)>eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : "+cmdvalue+" characters maximum "}alert(strError);return false}break;case"minlength":case"minlen":if(eval(trim(objValue.value).length)<eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : "+cmdvalue+" characters minimum  "}alert(strError);return false}break;case"alnum":case"alphanums":case"alphanumeric":var charpos=objValue.value.search("[^A-Za-z0-9]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alpha-numeric characters allowed "}alert(strError);return false}break;case"int":case"integer":var charpos=objValue.value.search("[^0-9]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only digits allowed "}alert(strError);return false}break;case"num":case"numeric":case"numericdot":if(isNaN(trim(objValue.value))){if(!strError||strError.length==0){strError=objValue.name+": Only a valid number is allowed "}alert(strError);return false}break;case"phone":var charpos=objValue.value.search("[^()0-9- ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only numeric,(,),- and space characters allowed "}alert(strError);return false}break;case"alphanumsphyphenPunctuations":var charpos=objValue.value.search("[^A-Za-z()0-9-,&:.!?';\" ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only numeric,(,),- and space characters allowed "}alert(strError);return false}break;case"alphabetic":case"alpha":var charpos=objValue.value.search("[^A-Za-z]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphabetic characters allowed "}alert(strError);return false}break;case"alphaspace":case"alphasp":var charpos=objValue.value.search("[^A-Za-z ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphabetic characters allowed "}alert(strError);return false}break;case"alphasphyphen":var charpos=objValue.value.search("[^A-Za-z-' ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphabetic,space and single quote characters allowed "}alert(strError);return false}break;case"alphanumsphyphen":var charpos=objValue.value.search("[^A-Za-z0-9-' ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphanumeric,space characters allowed "}alert(strError);return false}break;case"numsphyphen":var charpos=objValue.value.search("[^0-9-' ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only numeric,space and hyphen characters allowed "}alert(strError);return false}break;case"alphanumeric":var charpos=objValue.value.search("[^A-Za-z0-9]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alpha-numeric characters allowed "}alert(strError);return false}break;case"alphanumsp":var charpos=objValue.value.search("[^A-Za-z0-9 ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphanumeric,space characters allowed "}alert(strError);return false}break;case"alphanumhyphen":var charpos=objValue.value.search("[^A-Za-z0-9-]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphanumeric,hyphen characters allowed "}alert(strError);return false}break;case"alphanumspacehyphen":var charpos=objValue.value.search("[^A-Za-z0-9- ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphanumeric,hyphen characters allowed "}alert(strError);return false}break;case"email":if(!validateEmail(objValue.value)&&objValue.type!="hidden"){if(!strError||strError.length==0){strError=objValue.name+": Enter a valid Email address "}alert(strError);return false}break;case"lt":case"lessthan":if(isNaN(objValue.value)){alert(objValue.name+": Should be a number ");return false}if(eval(trim(objValue.value))>=eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : value should be less than "+cmdvalue}alert(strError);return false}break;case"gt":case"greaterthan":if(isNaN(objValue.value)){alert(objValue.name+": Should be a number ");return false}if(eval(trim(objValue.value))<=eval(cmdvalue)){if(!strError||strError.length==0){strError=objValue.name+" : value should be greater than "+cmdvalue}alert(strError);return false}break;case"dontselect":if(objValue.value*1==eval(cmdvalue)||(objValue.value=="")){if(!strError||strError.length==0){strError=objValue.name+": Please Select one option "}alert(strError);return false}break;case"eq":if(trim(objValue.value)!=cmdvalue){alert(strError);return false}break;case"checked":if(!document.getElementById(objValue.id).checked){alert(strError);return false}break;case"validusername":var charpos=objValue.value.search("[^A-Za-z0-9-@.]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphanumeric,hyphen,@ and dot(.) characters allowed "}alert(strError);return false}break;case"alphanumspquote":var charpos=objValue.value.search("[^A-Za-z0-9' ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphanumeric,space and single quote characters expected "}alert(strError);return false}break;case"alphanumsphyphenbracket":var charpos=objValue.value.search("[^A-Za-z()0-9- ]");if(trim(objValue.value).length>0&&charpos>=0){if(!strError||strError.length==0){strError=objValue.name+": Only alphanumerics,spaces,(, ) and hyphen characters allowed "}alert(strError);return false}break}return true}function getExpr(f){var b=null;switch(f){case"today":b=new Date()}return b}function validateEmail(f){var k=f.match("^(.+)@(.+)$");if(k==null){return false}if(k[1]!=null){var h=/^\"?[\w-_\.]*\"?$/;if(k[1].match(h)==null){return false}}if(k[2]!=null){var g=/^[\w-\.]*\.[A-Za-z]{2,4}$/;if(k[2].match(g)==null){var b=/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;if(k[2].match(b)==null){return false}}return true}return false}function onlyDigits(f){var b=f.keyCode?f.keyCode:f.charCode;if((b>=48&&b<=57)||b==8||b==9||b==13||b==39||b==37){return true}else{return false}}function GetXmlHttpObject(g){var b=null;if(navigator.userAgent.indexOf("MSIE")>=0){var f="Msxml2.XMLHTTP";if(navigator.appVersion.indexOf("MSIE 5.5")>=0){f="Microsoft.XMLHTTP"}try{b=new ActiveXObject(f);b.onreadystatechange=g;return b}catch(h){alert("Error. Scripting for ActiveX might be disabled");return}}else{b=new XMLHttpRequest();b.onload=g;b.onerror=g;return b}}function isExists(url,frmName,filedName,fileId){var requestParams;requestParams=filedName+"="+eval("document."+frmName+"."+filedName+".value")+"&"+fileId+"="+eval("document."+frmName+"."+fileId+".value");new Ajax.Request(url,{onSuccess:getResponse,onFailure:function(resp){alert("Oops, there's been an error."+resp.responseText)},parameters:requestParams,method:"post",asynchronous:false});return invalidUser}function getResponse(b){invalidUser=parseInt(b.responseText)}function checkValidform(l,h,m,g,k){if(!validateForm(l,h)){return false}var f=confirm("Are you sure you want to save changes");if(f){var b=isExists(url,l.name,m,g);if(b){alert(k+" is already exists!!!");return false}}else{return false}}function isRadio(b){return(b.type=="radio"||(b.length>0&&b[0].type=="radio"))}function isRadioChecked(b){if(!b){return""}var f=b.length;if(f==undefined){if(b.checked){return b.value}else{return""}}for(i=0;i<f;i++){if(b[i].checked){return b[i].value}}return false}function populateDropdown(b,g){objEle=document.getElementById(b);if(arguments.length>2&&arguments[2]=="multiple"){objEle.options.length=0}else{objEle.options.length=1}for(var f=0;f<g.length;f++){objEle.options[objEle.options.length]=new Option(g[f][1],g[f][0])}}function WindowPopup(f,b,g,h){new_window=window.open(f,b,"toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,top=50,left=100,scrollbars=yes,width="+g+",height="+h);new_window.focus()}function onlyDigits(f){if(typeof f=="undefined"){f=window.event}var b=f.keyCode?f.keyCode:f.charCode;if((b>=48&&b<=57)||b==8||b==9||b==13||b==39||b==37){return true}else{return false}}function allowFloatDigits(f){var b=f.keyCode?f.keyCode:f.charCode;if((b>=48&&b<=57)||b==8||b==9||b==13||b==39||b==37||b==46){return true}else{return false}}function checkboxValid(frmname,chkboxname){var frName=eval(frmname);var tot=frName.length;var chkflag=0;for(i=0;i<tot;i++){if(frName.elements[i].type=="checkbox"){if(frName.elements[i].name==chkboxname){if(frName.elements[i].checked){chkflag=1;break}}}}return chkflag}function disableReadonly(b,f){if(document.getElementById(b).checked){document.getElementById(f).disabled=false}else{document.getElementById(f).disabled=true}}function isExists(url,frmName,fieldName,fileId,licenseeId){var paramsExtra="";if(arguments.length>5){for(var k=5;k<arguments.length;k++){if(arguments[k]!=""){paramsExtra=arguments[k]}}}var requestParams="";var validFieldName="";if(trim(fieldName)!=""){requestParams=fieldName+"="+eval("document."+frmName+"."+fieldName+".value")+"&"}if(fileId!=""){requestParams+=fileId+"="+eval("document."+frmName+"."+fileId+".value")}if(licenseeId!=""){requestParams+="&licenseeId="+licenseeId}requestParams+=paramsExtra;new Ajax.Request(url,{onSuccess:getResponse,onFailure:function(resp){alert("Oops, there's been an error."+resp.responseText)},parameters:requestParams,method:"post",asynchronous:false});return invalidUser}function getResponse(g){var f=g.responseText;var b=f.split("|");if(b.length>1){invalidUser=f}else{invalidUser=parseInt(b[0])}}function checkValidform(frmObj,arrFormValidation,fieldName,fieldId,fieldMsg){var strExtra="";if(arguments.length>5){for(var k=5;k<arguments.length;k++){if(eval("document."+frmObj.name+"."+arguments[k])){strExtra+="&"+arguments[k]+"="+(eval("document."+frmObj.name+"."+arguments[k]+".value"))}}}var licenseeId="";if(eval("document."+frmObj.name+".lstLicenseeId")){licenseeId=eval("document."+frmObj.name+".lstLicenseeId.value")}if(!validateForm(frmObj,arrFormValidation)){return false}var ans=confirm("Are you sure you want to save changes");if(ans){if(eval("document."+frmObj.name+".txtAdminEmail")){var useremail=isExists(urlemail,frmObj.name,"txtAdminEmail",fieldId,licenseeId);if(useremail){alert(" Email already exists!!!");return false}}if(eval("document."+frmObj.name+".txtZESEmail")){var useremail=isExists(urlemail,frmObj.name,"txtZESEmail",fieldId,licenseeId);if(useremail){alert(" Email already exists!!!");return false}}if(eval("document."+frmObj.name+".txtHomeEmail")){var useremail=isExists(urlemail,frmObj.name,"txtHomeEmail",fieldId,licenseeId);if(useremail){alert(" Email already exists!!!");return false}}var user=isExists(url,frmObj.name,fieldName,fieldId,licenseeId,strExtra);if(user){alert(fieldMsg+" already exists!!!");return false}if(eval("document."+frmObj.name+".txtinstProfileEmail")){var useremail=isExists(urlemail,frmObj.name,"txtinstProfileEmail",fieldId,licenseeId);if(useremail){alert(" Email already exists!!!");return false}}return true}else{return false}}function restrictSpace(f){var b=f.keyCode?f.keyCode:f.charCode;if(b!=32){return true}else{return false}}function confirmSubmit(){var b=confirm("Are you sure you want to submit");if(b){return true}else{return false}}function confirmDelete(f){var b=confirm("Are you sure you want to Delete?");if(b){redirect(f)}else{return false}}function redirect(b){window.location.href=b;return true}function checkValid(){if(trim(document.frmstatus.txaComments.value)==""){alert("Please Enter Your Comments");return false}Changestatus();return true}function Changestatus(){var b;b="status="+document.frmstatus.optStatus.value+"&workshoprequestid="+document.frmstatus.workshoprequestid.value+"&comments="+document.frmstatus.txaComments.value+"&licenseeId="+document.frmstatus.licenseeId.value;new Ajax.Request(url,{onSuccess:newstateChanged,onFailure:function(f){alert("Oops, there's been an error."+f.responseText)},parameters:b})}function newstateChanged(f){var b=parseInt(f.responseText);if(b){alert("State was changed successfully")}else{alert("Oops, there was an error changing the state. Please try again!")}lytebox_close()}function getWorkshopCaption(l,f,g){functionclear();if(document.getElementById("newuser")){document.getElementById("newuser").style.display="none"}if(document.getElementById("exuser")){document.getElementById("exuser").style.display="none"}if(document.getElementById("ccDetails")){document.getElementById("ccDetails").style.display="none"}document.getElementById("optUserSel1").checked=false;document.getElementById("optUserSel2").checked=false;if(trim(l)==""){document.getElementById("caption").style.display="none";alert("Please Select Workshop");document.getElementById("optUserSel1").disabled=false;document.getElementById("optUserSel2").disabled=false}else{var p="workshopId="+l+"&memId="+g;new Ajax.Request(f,{onSuccess:funCaption,onFailure:function(q){alert("Oops, there's been an error."+q.responseText)},parameters:p})}var m=options.script.search("workshopId_");var b=options.script.substring(m);var n=b.search("/");var o=options.script.substring(0,m);var k="workshopId_"+l;var h=options.script.substring(m+n);options.script=o.concat(k,h)}function funCaption(g){if(g.responseText){var f=g.responseText.split("++");if(f[2]==1){document.getElementById("promotion").style.display="block"}else{if(f[2]==0){document.getElementById("promotion").style.display="none"}}if(f[1]!=0){var b="<label>"+f[0]+':</label><input type="text" name="txtwsCaption" value=\'\'>';if(document.getElementById("caption")!=null){document.getElementById("caption").style.display="block";document.getElementById("caption").innerHTML=b}if(document.getElementById("captionIs")!=null){document.getElementById("captionIs").value=f[1]}if(document.getElementById("lableIs")!=null){document.getElementById("lableIs").value=f[0]}}else{if(f[1]==0){if(document.getElementById("caption")!=null){document.getElementById("caption").style.display="none";document.getElementById("caption").innerHTML=""}if(document.getElementById("captionIs")!=null){document.getElementById("captionIs").value=""}if(document.getElementById("lableIs")!=null){document.getElementById("lableIs").value=""}}}document.getElementById("wsPrice").value=f[3];document.getElementById("price").value=f[3];document.getElementById("optUserSel1").disabled=false;if(f[3]==""){document.getElementById("optUserSel1").disabled=true}}else{document.getElementById("caption").style.display="none";document.getElementById("caption").innerHTML="";document.getElementById("captionIs").value="";document.getElementById("promotion").style.display="none";document.getElementById("lableIs").value="";document.getElementById("wsPrice").value="";document.getElementById("optUserSel1").disabled=true}}function isPromoCode(url,frmName,fieldName,fileId,fielIdInstructor,fielIdLicensee){var paramsExtra="";var requestParams="";var pcodeVal="";var instructorId="";var licenseeId="";var validFieldName="";pcodeVal=eval("document."+frmName+"."+fieldName+".value");if(fielIdInstructor!=""){instructorId=eval("document."+frmName+"."+fielIdInstructor+".value")}if(fielIdLicensee!=""){licenseeId=eval("document."+frmName+"."+fielIdLicensee+".value")}if(pcodeVal==""){document.getElementById("pcode").style.display="none";if(document.getElementById("Nextsubmit")){document.getElementById("Nextsubmit").style.display="none"}}else{if(trim(fieldName)!=""){requestParams=fieldName+"="+eval("document."+frmName+"."+fieldName+".value")+"&"}requestParams+=fileId+"="+eval("document."+frmName+"."+fileId+".value");if(instructorId!=""){requestParams+="&instructorId="+instructorId}if(licenseeId!=""){requestParams+="&licensee="+licenseeId}requestParams+=paramsExtra;new Ajax.Request(url,{onSuccess:getPromoCode,onFailure:function(resp){alert("Oops, there's been an error."+resp.responseText)},parameters:requestParams,method:"post",asynchronous:false})}}function getPromoCode(b){document.getElementById("pcode").innerHTML="";arrResponse=JSON.parse(b.responseText);document.getElementById("pcode").style.display="block";if(arrResponse.discount>0){if(document.getElementById("Nextsubmit")!=null){document.getElementById("Nextsubmit").style.display="none"}document.getElementById("discountamt").value=arrResponse.discount;document.getElementById("totalprice").value=arrResponse.total;document.getElementById("pcode").innerHTML="<strong>Discount Amount</strong>: "+arrResponse.discountFormatted;document.getElementById("pcode").innerHTML+="<br /><strong>Total Amount</strong>: "+arrResponse.totalFormatted}else{if(document.getElementById("Nextsubmit")!=null){document.getElementById("Nextsubmit").style.display="none"}document.getElementById("discountamt").value="";document.getElementById("totalprice").value="";if(document.getElementById("txtPromoDiscountCode")!=null){document.getElementById("txtPromoDiscountCode").value=""}if(document.getElementById("txtwsPromotion")!=null){document.getElementById("txtwsPromotion").value=""}document.getElementById("pcode").innerHTML="Invalid Promotional Code"}}function startLyteWindowFrame(f,g,h,b){myLightWindow.activateWindow({href:g,height:b,width:h,title:f,type:"external"})}function startLyteWindow(b,f){myLightWindow.activateWindow({href:f,caption:b})}function startLightWindow(b,h,g){var f="/viewimage.php?img="+h+"&path="+g;myLightWindow.activateWindow({href:f,caption:b,type:"image"})}function startLyteFrame(b,g){var f=this.document.createElement("a");f.setAttribute("title",b);f.setAttribute("href",g);f.setAttribute("rel","lytebox");myLytebox.start(f,false,false)}function startLyteboxFrame(f,g,h,b){myLightWindow.activateWindow({href:g,height:b,width:h,title:f})}function configureFrame(g,f,b){var h="";if(arguments.length>3){h="&module="+arguments[3]}var k="/components/imagecropper/cropimage.php?filFieldName="+g+"&width="+f+"&height="+b+h;startLyteWindowFrame("",k,920,900);return false}function deleteImage(l,h,g,k,b){var f=confirm("Are you sure you want to delete your photo?");if(f){if(trim(document.getElementById(b).value)!=""){document.getElementById(b).value="";alert("current uploaded image/material is Deleted")}else{new Ajax.Request(h,{parameters:"id="+l+"&fieldname="+g,asynchronous:false,onSuccess:function(p){var n=p.responseText;var m=n.split("|");var o=parseInt(m[0]);if(o){alert(m[1]+" Deleted Successfully");if(document.getElementById(k)){document.getElementById(k).style.display="none"}if(document.getElementById(k+"image")){document.getElementById(k+"image").style.display="none"}if(document.getElementById("showImage")){document.getElementById("showImage").style.display="none"}if(document.getElementById("txt"+b)){document.getElementById("txt"+b).value=""}if(document.getElementById("uploaded")){document.getElementById("uploaded").value=""}}else{alert("Error In "+m[1]+" Deletion");document.getElementById(k).style.display="block"}},onFailure:function(m){alert("Oops, there's been an error."+m.responseText)}})}}else{return false}}function urlParams(f){var b="";for(i=0;i<f.length;i+=2){if(i>1){b+="/"}b+=f[i]+"_"+f[i+1]}if(trim(b)!=""){b+="/"}return b}function getTabbarObj(){tabbar=new dhtmlXTabBar("a_tabbar","top");tabbar.setImagePath("/images/dhtmlxtabbar/");tabbar.setOnSelectHandler(getGridTab)}function limitLen(f,b){if(f.value.length>=b){f.value=f.value.substr(0,b);return false}return true}function subForm(k,b,g){var f=document.frmSearch.lstTypeOfSearch.value;if(typeof k=="undefined"){k=window.event}var h=k.keyCode?k.keyCode:k.charCode;if(f=="instructorStatusID"||f=="PaymentRequestId"||f=="instructorStatusID"){if((h>=48&&h<=57)||h==8||h==9||h==39||h==37){return true}else{if(h==13){if(arguments.length>3){dataSearchLoad(b,g,arguments[3])}else{dataSearchLoad(b,g)}return false}else{return false}}}else{if((h>=64&&h<=122)||h==8||h==32||(h>=48&&h<=57)||h==46){return true}else{if(h==13){if(arguments.length>3){dataSearchLoad(b,g,arguments[3])}else{dataSearchLoad(b,g)}return false}else{return false}}}}function SubmitComments(b){var f;new Ajax.Request(url,{asynchronous:false,method:"post",postBody:Form.serialize(b),onSuccess:getcomments,onFailure:function(g){alert("Oops, there's been an error."+g.responseText)}})}function getcomments(b){lightwindowresponse=(b.responseText);changeGridCell()}function tinymce_properties(b){tinyMCE.init({mode:"exact",theme:"advanced",plugins:"safari,table",theme_advanced_toolbar_align:"justify",submit_patch:false,theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,fontselect,fontsizeselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|link,unlink,anchor,cleanup,code",theme_advanced_buttons3_add:"tablecontrols",elements:b,theme_advanced_resizing:true,theme_advanced_toolbar_location:"top"})}function displayProcessButton(f,b){document.getElementById(f).style.display="none";document.getElementById(b).style.display="block"}function trim(b){if(!b||typeof b!="string"){return""}return b.replace(/^[\s]+/,"").replace(/[\s]+$/,"").replace(/[\s]{2,}/," ")}function funChkSame(b){if(b){document.frm.txtbFirstName.value=trim(document.getElementById("fstName").innerHTML);document.frm.txtbLastName.value=trim(document.getElementById("lstName").innerHTML);document.frm.txtbAddress.value=trim(document.frm.txtAddress.value);document.frm.txtbZip.value=trim(document.frm.txtZip.value);copyGeodropdowns(b,"ship","bill")}else{document.frm.txtbFirstName.value="";document.frm.txtbLastName.value="";document.frm.txtbAddress.value="";document.frm.lstBillCountryId.value="";document.frm.lstBillStateId.value="";document.getElementById("billstates").style.display="none";document.frm.lstBillCityId.value="";document.getElementById("billcity").style.display="none";document.frm.txtbZip.value=""}}function validate(h,f,m,b){if(validateForm(h,f)){if(document.frm.txtinstructorEmail){var k=document.frm.licensee.value;var l=isExists(m,h.name,"txtinstructorEmail","instructorId",k);if(l){alert(" Email already exists!!!");return false}}var g;new Ajax.Request(b,{asynchronous:false,method:"post",postBody:Form.serialize(document.frm),onSuccess:getWorkshopStatusResponse,onFailure:function(n){alert("Oops, there's been an error."+n.responseText)}})}else{return false}}function getWorkshopStatusResponse(f){var b=parseInt(f.responseText);if(b){alert("Successfully updated.");window.parent.myLightWindow.deactivate();return false}else{alert("Error while updating details.")}}function ReplaceUrl(l,b){var n=l.search(/workshopId_/i);var k=l.substring(n);var g=k.search("/");var m=l.substring(0,n);var h="workshopId_"+b;var f=l.substring(n+g);l=m.concat(h,f);return l}function SubmitPostComments(b){if(trim(document.getElementById("txtWrkInstComments").value)!=""){SubmitComments(b)}else{alert("Please enter comments");document.getElementById("txtWrkInstComments").focus();return false}}function dtmlXMLLoaderObject(f,h,g,b){this.xmlDoc="";if(typeof(g)!="undefined"){this.async=g}else{this.async=true}this.onloadAction=f||null;this.mainObject=h||null;this.waitCall=null;this.rSeed=b||false;return this}dtmlXMLLoaderObject.prototype.waitLoadFunction=function(f){var b=true;this.check=function(){if((f)&&(f.onloadAction!=null)){if((!f.xmlDoc.readyState)||(f.xmlDoc.readyState==4)){if(!b){return}b=false;f.onloadAction(f.mainObject,null,null,null,f);if(f.waitCall){f.waitCall();f.waitCall=null}}}};return this.check};dtmlXMLLoaderObject.prototype.getXMLTopNode=function(g,b){if(this.xmlDoc.responseXML){var f=this.xmlDoc.responseXML.getElementsByTagName(g);var k=f[0]}else{var k=this.xmlDoc.documentElement}if(k){this._retry=false;return k}if((_isIE)&&(!this._retry)){var h=this.xmlDoc.responseText;var b=this.xmlDoc;this._retry=true;this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=false;this.xmlDoc.loadXML(h);return this.getXMLTopNode(g,b)}dhtmlxError.throwError("LoadXML","Incorrect XML",[(b||this.xmlDoc),this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(f){try{var g=new DOMParser();this.xmlDoc=g.parseFromString(f,"text/xml")}catch(b){this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=this.async;this.xmlDoc.loadXML(f)}this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall){this.waitCall();this.waitCall=null}};dtmlXMLLoaderObject.prototype.loadXML=function(g,f,b,h){if(this.rSeed){g+=((g.indexOf("?")!=-1)?"&":"?")+"a_dhx_rSeed="+(new Date()).valueOf()}this.filePath=g;if((!_isIE)&&(window.XMLHttpRequest)){this.xmlDoc=new XMLHttpRequest()}else{if(document.implementation&&document.implementation.createDocument){this.xmlDoc=document.implementation.createDocument("","",null);this.xmlDoc.onload=new this.waitLoadFunction(this);this.xmlDoc.load(g);return}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP")}}if(this.async){this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this)}this.xmlDoc.open(f?"POST":"GET",g,this.async);if(h){this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")");this.xmlDoc.setRequestHeader("Content-type","text/xml")}else{if(f){this.xmlDoc.setRequestHeader("Content-type","application/x-www-form-urlencoded")}}this.xmlDoc.send(null||b);if(!this.async){(new this.waitLoadFunction(this))()}};dtmlXMLLoaderObject.prototype.destructor=function(){this.onloadAction=null;this.mainObject=null;this.xmlDoc=null;return null};function callerFunction(b,f){this.handler=function(g){if(!g){g=window.event}b(g,f);return true};return this.handler}function getAbsoluteLeft(f){var g=f.offsetLeft;var b=f.offsetParent;while(b!=null){g+=b.offsetLeft;b=b.offsetParent}return g}function getAbsoluteTop(g){var f=g.offsetTop;var b=g.offsetParent;while(b!=null){f+=b.offsetTop;b=b.offsetParent}return f}function convertStringToBoolean(b){if(typeof(b)=="string"){b=b.toLowerCase()}switch(b){case"1":case"true":case"yes":case"y":case 1:case true:return true;break;default:return false}}function getUrlSymbol(b){if(b.indexOf("?")!=-1){return"&"}else{return"?"}}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop){return window.dhtmlDragAndDrop}this.lastLanding=0;this.dragNode=0;this.dragStartNode=0;this.dragStartObject=0;this.tempDOMU=null;this.tempDOMM=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}dhtmlDragAndDropObject.prototype.removeDraggableItem=function(b){b.onmousedown=null;b.dragStarter=null;b.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(b,f){b.onmousedown=this.preCreateDragCopy;b.dragStarter=f;this.addDragLanding(b,f)};dhtmlDragAndDropObject.prototype.addDragLanding=function(b,f){b.dragLanding=f};dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(b){if(b&&(b||event).button==2){return}if(window.dhtmlDragAndDrop.waitDrag){window.dhtmlDragAndDrop.waitDrag=0;document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;return false}window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;if((b)&&(b.preventDefault)){b.preventDefault();return false}return false};dhtmlDragAndDropObject.prototype.callDrag=function(g){if(!g){g=window.event}dragger=window.dhtmlDragAndDrop;if((g.button==0)&&(_isIE)){return dragger.stopDrag()}if(!dragger.dragNode&&dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,g);if(!dragger.dragNode){return dragger.stopDrag()}dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}if(dragger.dragNode.parentNode!=window.document.body){var b=dragger.gldragNode;if(dragger.gldragNode.old){b=dragger.gldragNode.old}b.parentNode.removeChild(b);var f=dragger.dragNode.pWindow;if(_isIE){var k=document.createElement("Div");k.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=k.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);f.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=g.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=g.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!g.srcElement){var h=g.target}else{h=g.srcElement}dragger.checkLanding(h,g)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(k){if(window.name){var g=parent.frames[window.name].frameElement.offsetParent;var h=0;var f=0;while(g){h+=g.offsetLeft;f+=g.offsetTop;g=g.offsetParent}if((parent.dhtmlDragAndDrop)){var b=parent.dhtmlDragAndDrop.calculateFramePosition(1);h+=b.split("_")[0]*1;f+=b.split("_")[1]*1}if(k){return h+"_"+f}else{this.fx=h}this.fy=f}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(f,b){if((f)&&(f.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=f;this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,b.clientX,b.clientY,b);this.lastLanding_scr=(_isIE?b.srcElement:b.target)}else{if((f)&&(f.tagName!="BODY")){this.checkLanding(f.parentNode,b)}else{if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding,b.clientX,b.clientY,b)}this.lastLanding=0;if(this._onNotFound){this._onNotFound()}}}};dhtmlDragAndDropObject.prototype.stopDrag=function(f,g){dragger=window.dhtmlDragAndDrop;if(!g){dragger.stopFrameRoute();var b=dragger.lastLanding;dragger.lastLanding=null;if(b){b.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,b,(_isIE?event.srcElement:f.target))}}dragger.lastLanding=null;if((dragger.dragNode)&&(dragger.dragNode.parentNode==document.body)){dragger.dragNode.parentNode.removeChild(dragger.dragNode)}dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(f){if(f){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var b=0;b<window.frames.length;b++){if((window.frames[b]!=f)&&(window.frames[b].dhtmlDragAndDrop)){window.frames[b].dhtmlDragAndDrop.stopFrameRoute(window)}}if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=f)){parent.dhtmlDragAndDrop.stopFrameRoute(window)}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(f,g){if(f){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=f.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=f.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=f.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=f.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if(((!_isIE)&&(g))&&((!_isFF)||(_FFrv<1.8))){window.dhtmlDragAndDrop.calculateFramePosition()}}if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=f)){parent.dhtmlDragAndDrop.initFrameRoute(window)}for(var b=0;b<window.frames.length;b++){if((window.frames[b]!=f)&&(window.frames[b].dhtmlDragAndDrop)){window.frames[b].dhtmlDragAndDrop.initFrameRoute(window,((!f||g)?1:0))}}};var _isFF=false;var _isIE=false;var _isOpera=false;var _isKHTML=false;var _isMacOS=false;if(navigator.userAgent.indexOf("Macintosh")!=-1){_isMacOS=true}if((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("Konqueror")!=-1)){var _KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(_KHTMLrv>525){_isFF=true;var _FFrv=1.9}else{_isKHTML=true}}else{if(navigator.userAgent.indexOf("Opera")!=-1){_isOpera=true;_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))}else{if(navigator.appName.indexOf("Microsoft")!=-1){_isIE=true;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat"){_isIE=8}}else{_isFF=true;var _FFrv=parseFloat(navigator.userAgent.split("rv:")[1])}}}function isIE(){if(navigator.appName.indexOf("Microsoft")!=-1){if(navigator.userAgent.indexOf("Opera")==-1){return true}}return false}dtmlXMLLoaderObject.prototype.doXPath=function(g,k,h,o){if((_isKHTML)){return this.doXPathOpera(g,k)}if(_isIE){if(!k){if(!this.xmlDoc.nodeName){k=this.xmlDoc.responseXML}else{k=this.xmlDoc}}if(!k){dhtmlxError.throwError("LoadXML","Incorrect XML",[(k||this.xmlDoc),this.mainObject])}if(h!=null){k.setProperty("SelectionNamespaces","xmlns:xsl='"+h+"'")}if(o=="single"){return k.selectSingleNode(g)}else{return k.selectNodes(g)||new Array(0)}}else{var b=k;if(!k){if(!this.xmlDoc.nodeName){k=this.xmlDoc.responseXML}else{k=this.xmlDoc}}if(!k){dhtmlxError.throwError("LoadXML","Incorrect XML",[(k||this.xmlDoc),this.mainObject])}if(k.nodeName.indexOf("document")!=-1){b=k}else{b=k;k=k.ownerDocument}var m=XPathResult.ANY_TYPE;if(o=="single"){m=XPathResult.FIRST_ORDERED_NODE_TYPE}var l=new Array();var f=k.evaluate(g,b,function(p){return h},m,null);if(m==XPathResult.FIRST_ORDERED_NODE_TYPE){return f.singleNodeValue}var n=f.iterateNext();while(n){l[l.length]=n;n=f.iterateNext()}return l}};function _dhtmlxError(f,b,g){if(!this.catches){this.catches=new Array()}return this}_dhtmlxError.prototype.catchError=function(f,b){this.catches[f]=b};_dhtmlxError.prototype.throwError=function(f,b,g){if(this.catches[f]){return this.catches[f](f,b,g)}if(this.catches.ALL){return this.catches.ALL(f,b,g)}alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);return null};window.dhtmlxError=new _dhtmlxError();dtmlXMLLoaderObject.prototype.doXPathOpera=function(g,b){var k=g.replace(/[\/]+/gi,"/").split("/");var h=null;var f=1;if(!k.length){return[]}if(k[0]=="."){h=[b]}else{if(k[0]==""){h=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(k[f].replace(/\[[^\]]*\]/g,""));f++}else{return[]}}for(f;f<k.length;f++){h=this._getAllNamedChilds(h,k[f])}if(k[f-1].indexOf("[")!=-1){h=this._filterXPath(h,k[f-1])}return h};dtmlXMLLoaderObject.prototype._filterXPath=function(g,f){var k=new Array();var f=f.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,"");for(var h=0;h<g.length;h++){if(g[h].getAttribute(f)){k[k.length]=g[h]}}return k};dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(g,f){var l=new Array();if(_isKHTML){f=f.toUpperCase()}for(var k=0;k<g.length;k++){for(var h=0;h<g[k].childNodes.length;h++){if(_isKHTML){if(g[k].childNodes[h].tagName&&g[k].childNodes[h].tagName.toUpperCase()==f){l[l.length]=g[k].childNodes[h]}}else{if(g[k].childNodes[h].tagName==f){l[l.length]=g[k].childNodes[h]}}}}return l};function dhtmlXHeir(g,f){for(var h in f){if(typeof(f[h])=="function"){g[h]=f[h]}}return g}function dhtmlxEvent(f,g,b){if(f.addEventListener){f.addEventListener(g,b,false)}else{if(f.attachEvent){f.attachEvent("on"+g,b)}}}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(f,g,h){if(!h){h=this.xslDoc}if(h.responseXML){h=h.responseXML}var b=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+f+"']",h,"http://www.w3.org/1999/XSL/Transform","single");if(b!=null){b.firstChild.nodeValue=g}};dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(g,f){if(!g){g=this.xslDoc}if(g.responseXML){g=g.responseXML}if(!f){f=this.xmlDoc}if(f.responseXML){f=f.responseXML}if(!isIE()){if(!this.XSLProcessor){this.XSLProcessor=new XSLTProcessor();this.XSLProcessor.importStylesheet(g)}var b=this.XSLProcessor.transformToDocument(f)}else{var b=new ActiveXObject("Msxml2.DOMDocument.3.0");f.transformNodeToObject(g,b)}return b};dtmlXMLLoaderObject.prototype.doXSLTransToString=function(f,b){return this.doSerialization(this.doXSLTransToObject(f,b))};dtmlXMLLoaderObject.prototype.doSerialization=function(f){if(!isIE()){var b=new XMLSerializer();return b.serializeToString(f)}else{return f.xml}};function getWeekdayIndex(g){var b=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(var f=0;f<b.length;f++){if(g.toLowerCase()==b[f]){return f}}return b.length}var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/&nbsp;/g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(b){return dhtmlXHeir((b||new Array()),dhtmlxArray._master)}dhtmlxArray._master={_dhx_find:function(f){for(var b=0;b<this.length;b++){if(f==this[b]){return b}}return -1},_dhx_insertAt:function(g,f){this[this.length]=null;for(var b=this.length-1;b>=g;b--){this[b]=this[b-1]}this[g]=f},_dhx_removeAt:function(b){this.splice(b,1)},_dhx_swapItems:function(b,g){var f=this[b];this[b]=this[g];this[g]=f}};function dhtmlXGridObject(id){if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(id){if(typeof(id)=="object"){this.entBox=id;this.entBox.id="cgrid2_"+this.uid()}else{this.entBox=document.getElementById(id)}}else{this.entBox=document.createElement("DIV");this.entBox.id="cgrid2_"+this.uid()}this.dhx_Event();var self=this;this._wcorr=0;this.cell=null;this.row=null;this.editor=null;this._f2kE=true;this._dclE=true;this.combos=new Array(0);this.defVal=new Array(0);this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=true;this.xmlLoader=new dtmlXMLLoaderObject(this.doLoadDetails,this,true,this.no_cashe);this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?(this.entBox.style.width||window.getComputedStyle(this.entBox,null)["width"]):(this.entBox.currentStyle?this.entBox.currentStyle.width:0))||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?(this.entBox.style.height||window.getComputedStyle(this.entBox,null)["height"]):(this.entBox.currentStyle?this.entBox.currentStyle.height:0))||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return false};this.obj=document.createElement("TABLE");this.obj.cellSpacing=0;this.obj.cellPadding=0;this.obj.style.width="100%";this.obj.style.tableLayout="fixed";this.obj.className="c_obj".substr(2);this.hdr=document.createElement("TABLE");this.hdr.style.border="1px solid gray";this.hdr.cellSpacing=0;this.hdr.cellPadding=0;if((!_isOpera)||(_OperaRv>=8.5)){this.hdr.style.tableLayout="fixed"}this.hdr.className="c_hdr".substr(2);this.hdr.width="100%";this.xHdr=document.createElement("TABLE");this.xHdr.className="xhdr";this.xHdr.cellPadding=0;this.xHdr.cellSpacing=0;this.xHdr.style.width="100%";var r=this.xHdr.insertRow(0);var c=r.insertCell(0);r.insertCell(1).innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";r.childNodes[1].style.width="100%";c.appendChild(this.hdr);this.objBuf=document.createElement("DIV");this.objBuf.appendChild(this.obj);this.entCnt=document.createElement("TABLE");this.entCnt.insertRow(0).insertCell(0);this.entCnt.insertRow(1).insertCell(0);this.entCnt.cellPadding=0;this.entCnt.cellSpacing=0;this.entCnt.width="100%";this.entCnt.height="100%";this.entCnt.style.tableLayout="fixed";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.height=this.entBox.style.height;this.objBox.style.overflow="auto";this.objBox.style.position="relative";this.objBox.appendChild(this.objBuf);this.objBox.className="objbox";this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%";if(((_isOpera)&&(_OperaRv<9))){this.hdrSizeA=25}else{this.hdrSizeA=200}this.hdrBox.style.height=this.hdrSizeA+"px";if(_isIE){this.hdrBox.style.overflowX="hidden"}else{this.hdrBox.style.overflow="hidden"}this.hdrBox.style.position="relative";this.hdrBox.appendChild(this.xHdr);this.preloadImagesAr=new Array(0);this.sortImg=document.createElement("IMG");this.sortImg.style.display="none";this.hdrBox.insertBefore(this.sortImg,this.xHdr);this.entCnt.rows[0].cells[0].vAlign="top";this.entCnt.rows[0].cells[0].appendChild(this.hdrBox);this.entCnt.rows[1].cells[0].appendChild(this.objBox);this.entBox.appendChild(this.entCnt);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=new Array(0);this.cellWidthPC=new Array(0);this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this.imgURL="./";this.isActive=false;this.isEditable=true;this.useImagesInHeader=false;this.pagingOn=false;this.rowsBufferOutSize=0;dhtmlxEvent(window,"unload",function(){try{self.destructor()}catch(e){}});this.setSkin=function(name){this.entBox.className="gridbox gridbox_"+name;this.enableAlterCss("ev_"+name,"odd_"+name,this.isTreeGrid());this._fixAlterCss();this._sizeFix=this._borderFix=0;switch(name){case"clear":this._topMb=document.createElement("DIV");this._topMb.className="topMumba";this._topMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinC_top_left.gif'><img style='right:0px' src='"+this.imgURL+"skinC_top_right.gif'>";this.entBox.appendChild(this._topMb);this._botMb=document.createElement("DIV");this._botMb.className="bottomMumba";this._botMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinD_bottom_left.gif'><img style='right:0px' src='"+this.imgURL+"skinD_bottom_right.gif'>";this.entBox.appendChild(this._botMb);this.entBox.style.position="relative";this._gcCorr=20;break;case"modern":case"light":this.forceDivInHeader=true;this._sizeFix=1;break;case"xp":this.forceDivInHeader=true;this._srdh=22;this._sizeFix=1;break;case"mt":this._srdh=22;this._sizeFix=1;this._borderFix=(_isIE?1:0);break;case"gray":if((_isIE)&&(document.compatMode!="BackCompat")){this._srdh=22}this._sizeFix=1;this._borderFix=(_isIE?1:0);break;case"sbdark":if(_isFF){this._gcCorr=1}break}if(_isIE&&this.hdr){var d=this.hdr.parentNode;d.removeChild(this.hdr);d.appendChild(this.hdr)}this.setSizes()};if(_isIE){this.preventIECaching(true)}this.dragger=new dhtmlDragAndDropObject();this._doOnScroll=function(e,mode){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,mode)};this.doOnScroll=function(e,mode){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr){this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft}if(mode){return}if(this._srnd){if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}this._dLoadTimer=window.setTimeout(function(){self._update_srnd_view()},100)}};this.attachToObject=function(obj){obj.appendChild(this.entBox);this.objBox.style.height=this.entBox.style.height};this.init=function(fl){if((this.isTreeGrid())&&(!this._h2)){this._h2=new dhtmlxHierarchy();if((this._fake)&&(!this._realfake)){this._fake._h2=this._h2}this._tgc={imgURL:null}}if(!this._hstyles){return}this.editStop();this.lastClicked=null;this.resized=null;this.fldSorted=this.r_fldSorted=null;this.gridWidth=0;this.gridHeight=0;this.cellWidthPX=new Array(0);this.cellWidthPC=new Array(0);if(this.hdr.rows.length>0){this.clearAll(true)}var hdrRow=this.hdr.insertRow(0);for(var i=0;i<this.hdrLabels.length;i++){hdrRow.appendChild(document.createElement("TH"));hdrRow.childNodes[i]._cellIndex=i;hdrRow.childNodes[i].style.height="0px"}if(_isIE&&_isIE<8){hdrRow.style.position="absolute"}else{hdrRow.style.height="auto"}var hdrRow=this.hdr.insertRow(_isKHTML?2:1);hdrRow._childIndexes=new Array();var col_ex=0;for(var i=0;i<this.hdrLabels.length;i++){hdrRow._childIndexes[i]=i-col_ex;if((this.hdrLabels[i]==this.splitSign)&&(i!=0)){if(_isKHTML){hdrRow.insertCell(i-col_ex)}hdrRow.cells[i-col_ex-1].colSpan=(hdrRow.cells[i-col_ex-1].colSpan||1)+1;hdrRow.childNodes[i-col_ex-1]._cellIndex++;col_ex++;hdrRow._childIndexes[i]=i-col_ex;continue}hdrRow.insertCell(i-col_ex);hdrRow.childNodes[i-col_ex]._cellIndex=i;hdrRow.childNodes[i-col_ex]._cellIndexS=i;this.setColumnLabel(i,this.hdrLabels[i])}if(col_ex==0){hdrRow._childIndexes=null}this._cCount=this.hdrLabels.length;if(_isIE){window.setTimeout(function(){self.setSizes()},1)}if(!this.obj.firstChild){this.obj.appendChild(document.createElement("TBODY"))}var tar=this.obj.firstChild;if(!tar.firstChild){tar.appendChild(document.createElement("TR"));tar=tar.firstChild;if(_isIE&&_isIE<8){tar.style.position="absolute"}else{tar.style.height="auto"}for(var i=0;i<this.hdrLabels.length;i++){tar.appendChild(document.createElement("TH"));tar.childNodes[i].style.height="0px"}}this._c_order=null;if(this.multiLine!=true){this.obj.className+=" row20px"}this.sortImg.style.position="absolute";this.sortImg.style.display="none";this.sortImg.src=this.imgURL+"sort_desc.gif";this.sortImg.defLeft=0;this.entCnt.rows[0].style.display="";if(this.noHeader){this.entCnt.rows[0].style.display="none"}else{this.noHeader=false}if(this._ivizcol){this.setColHidden()}this.attachHeader();this.attachHeader(0,0,"_aFoot");this.setSizes();if(fl){this.parseXML()}this.obj.scrollTop=0;if(this.dragAndDropOff){this.dragger.addDragLanding(this.entBox,this)}if(this._initDrF){this._initD()}if(this._init_point){this._init_point()}};this.setSizes=function(fl){if((!this.hdr.rows[0])){return}if(!this.entBox.offsetWidth){if(this._sizeTime){window.clearTimeout(this._sizeTime)}this._sizeTime=window.setTimeout(function(){self.setSizes()},250);return}if(((_isFF)&&(this.entBox.style.height=="100%"))||(this._fixLater)){this.entBox.style.height=this.entBox.parentNode.clientHeight;this._fixLater=true}if(fl&&this.gridWidth==this.entBox.offsetWidth&&this.gridHeight==this.entBox.offsetHeight){return false}else{if(fl){this.gridWidth=this.entBox.offsetWidth;this.gridHeight=this.entBox.offsetHeight}}if((!this.hdrBox.offsetHeight)&&(this.hdrBox.offsetHeight>0)){this.entCnt.rows[0].cells[0].height=this.hdrBox.offsetHeight+"px"}var gridWidth=parseInt(this.entBox.offsetWidth)-(this._gcCorr||0);var gridHeight=parseInt(this.entBox.offsetHeight)-(this._sizeFix||0);var _isVSroll=(this.objBox.scrollHeight>this.objBox.offsetHeight);if(((!this._ahgr)&&(_isVSroll))||((this._ahgrM)&&(this._ahgrM<this.objBox.scrollHeight))){gridWidth-=(this._scrFix||(_isFF?17:17))}var len=this.hdr.rows[0].cells.length;for(var i=0;i<this._cCount;i++){if(this.cellWidthType=="px"&&this.cellWidthPX.length<len){this.cellWidthPX[i]=this.initCellWidth[i]-this._wcorr}else{if(this.cellWidthType=="%"&&this.cellWidthPC.length<len){this.cellWidthPC[i]=this.initCellWidth[i]}}if(this.cellWidthType=="%"&&this.cellWidthPC.length!=0&&this.cellWidthPC[i]){this.cellWidthPX[i]=parseInt(gridWidth*this.cellWidthPC[i]/100)}}var wcor=this.entBox.offsetWidth-this.entBox.clientWidth;var summ=0;var fcols=new Array();for(var i=0;i<this._cCount;i++){if((this.initCellWidth[i]=="*")&&((!this._hrrar)||(!this._hrrar[i]))){fcols[fcols.length]=i}else{summ+=parseInt(this.cellWidthPX[i])}}if(fcols.length){var ms=Math.floor((gridWidth-summ-wcor)/fcols.length);if(ms<0){ms=1}for(var i=0;i<fcols.length;i++){var min=(this._drsclmW?this._drsclmW[fcols[i]]:0);this.cellWidthPX[fcols[i]]=(min?(min>ms?min:ms):ms)-this._wcorr;summ+=ms}}var summ=0;for(var i=0;i<this._cCount;i++){summ+=parseInt(this.cellWidthPX[i])}if(_isOpera){summ-=1}this.chngCellWidth();if((this._awdth)&&(this._awdth[0])){if(this.cellWidthType=="%"){this.cellWidthType="px";this.cellWidthPC=[]}var gs=(summ>this._awdth[1]?this._awdth[1]:(summ<this._awdth[2]?this._awdth[2]:summ))+this._borderFix*2;if(this._fake){for(var i=0;i<this._fake._cCount;i++){gs+=parseInt(this._fake.cellWidthPX[i])}}this.entBox.style.width=gs+((_isVSroll&&!this._ahgr)?(_isFF?20:18):0)+"px";if(this._fake&&!this._realfake){this._fake._correctSplit()}}this.objBuf.style.width=summ+"px";if((this.ftr)&&(!this._realfake)){this.ftr.style.width=summ+"px"}this.objBuf.childNodes[0].style.width=summ+"px";this.doOnScroll(0,1);this.hdr.style.border="0px solid gray";var zheight=this.hdr.offsetHeight+(this._borderFix?this._borderFix:0);if(this.ftr){zheight+=this.ftr.offsetHeight}if(this._ahgr){if(this.objBox.scrollHeight){if(_isIE){var z2=this.objBox.scrollHeight}else{var z2=this.objBox.childNodes[0].scrollHeight}var scrfix=this.parentGrid?1:((this.objBox.offsetWidth<this.objBox.scrollWidth)?(_isFF?20:18):1);if(this._ahgrMA){z2=this.entBox.parentNode.offsetHeight-zheight-scrfix-(this._sizeFix?this._sizeFix:0)*2}if(((this._ahgrM)&&((this._ahgrF?(z2+zheight+scrfix):z2)>this._ahgrM))){gridHeight=this._ahgrM*1+(this._ahgrF?0:(zheight+scrfix))}else{gridHeight=z2+zheight+scrfix}this.entBox.style.height=gridHeight+"px"}}if(this.ftr){zheight-=this.ftr.offsetHeight}var aRow=this.entCnt.rows[1].cells[0].childNodes[0];if(!this.noHeader){aRow.style.top=(zheight-this.hdrBox.offsetHeight+((_isIE&&!window.XMLHttpRequest)?(-wcor):0))+"px"}if(this._topMb){this._topMb.style.top=(zheight||0)+"px";this._topMb.style.width=(gridWidth+20)+"px"}if(this._botMb){this._botMb.style.top=(gridHeight-3)+"px";this._botMb.style.width=(gridWidth+20)+"px"}aRow.style.height=(((gridHeight-zheight-1)<0&&_isIE)?20:(gridHeight-zheight-1))-(this.ftr?this.ftr.offsetHeight:0)+"px";if(this.ftr&&this.entBox.offsetHeight>this.ftr.offsetHeight){this.entCnt.style.height=this.entBox.offsetHeight-this.ftr.offsetHeight+"px"}if(this._srdh){this.doOnScroll()}};this.chngCellWidth=function(){if((_isOpera)&&(this.ftr)){this.ftr.width=this.objBox.scrollWidth+"px"}var l=this._cCount;for(var i=0;i<l;i++){this.hdr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px";this.obj.rows[0].childNodes[i].style.width=this.cellWidthPX[i]+"px";if(this.ftr){this.ftr.rows[0].cells[i].style.width=this.cellWidthPX[i]+"px"}}};this.setDelimiter=function(delim){this.delim=delim};this.setInitWidthsP=function(wp){this.cellWidthType="%";this.initCellWidth=wp.split(this.delim.replace(/px/gi,""));this._setAutoResize()};this._setAutoResize=function(){var el=window;var self=this;if(el.addEventListener){if((_isFF)&&(_FFrv<1.8)){el.addEventListener("resize",function(){if(!self.entBox){return}var z=self.entBox.style.width;self.entBox.style.width="1px";window.setTimeout(function(){self.entBox.style.width=z;self.setSizes();if(self._fake){self._fake._correctSplit()}},10)},false)}else{el.addEventListener("resize",function(){if(self.setSizes){self.setSizes()}if(self._fake){self._fake._correctSplit()}},false)}}else{if(el.attachEvent){el.attachEvent("onresize",function(){if(self._resize_timer){window.clearTimeout(self._resize_timer)}if(self.setSizes){self._resize_timer=window.setTimeout(function(){self.setSizes();if(self._fake){self._fake._correctSplit()}},500)}})}}this._setAutoResize=function(){}};this.setInitWidths=function(wp){this.cellWidthType="px";this.initCellWidth=wp.split(this.delim);if(_isFF){for(var i=0;i<this.initCellWidth.length;i++){if(this.initCellWidth[i]!="*"){this.initCellWidth[i]=parseInt(this.initCellWidth[i])-2}}}};this.enableMultiline=function(state){this.multiLine=convertStringToBoolean(state)};this.enableMultiselect=function(state){this.selMultiRows=convertStringToBoolean(state)};this.setImagePath=function(path){this.imgURL=path};this.changeCursorState=function(ev){var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}if((el.tagName=="TD")&&(this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return el.style.cursor="default"}var check=ev.layerX+(((!_isIE)&&(ev.target.tagName=="DIV"))?el.offsetLeft:0);if((el.offsetWidth-(ev.offsetX||(parseInt(this.getPosition(el,this.hdrBox))-check)*-1))<10){el.style.cursor="col-resize"}else{el.style.cursor="default"}if(_isOpera){this.hdrBox.scrollLeft=this.objBox.scrollLeft}};this.startColResize=function(ev){this.resized=null;var el=ev.target||ev.srcElement;if(el.tagName!="TD"){el=this.getFirstParentOfType(el,"TD")}var x=ev.clientX;var tabW=this.hdr.offsetWidth;var startW=parseInt(el.offsetWidth);if(el.tagName=="TD"&&el.style.cursor!="default"){if((this._drsclmn)&&(!this._drsclmn[el._cellIndex])){return}this.entBox.onmousemove=function(e){this.grid.doColResize(e||window.event,el,startW,x,tabW)};document.body.onmouseup=new Function("","document.getElementById('"+this.entBox.id+"').grid.stopColResize()")}};this.stopColResize=function(){this.entBox.onmousemove="";document.body.onmouseup="";this.setSizes();this.doOnScroll(0,1);this.callEvent("onResizeEnd",[this])};this.doColResize=function(ev,el,startW,x,tabW){el.style.cursor="col-resize";this.resized=el;var fcolW=startW+(ev.clientX-x);var wtabW=tabW+(ev.clientX-x);if(!(this.callEvent("onResize",[el._cellIndex,fcolW,this]))){return}if(_isIE){this.objBox.scrollLeft=this.hdrBox.scrollLeft}if(el.colSpan>1){var a_sizes=new Array();for(var i=0;i<el.colSpan;i++){a_sizes[i]=Math.round(fcolW*this.hdr.rows[0].childNodes[el._cellIndexS+i].offsetWidth/el.offsetWidth)}for(var i=0;i<el.colSpan;i++){this._setColumnSizeR(el._cellIndexS+i*1,a_sizes[i])}}else{this._setColumnSizeR(el._cellIndex,fcolW)}this.doOnScroll(0,1);if(_isOpera){this.setSizes()}this.objBuf.childNodes[0].style.width=""};this._setColumnSizeR=function(ind,fcolW){if(fcolW>((this._drsclmW&&!this._notresize)?(this._drsclmW[ind]||10):10)){this.obj.firstChild.firstChild.childNodes[ind].style.width=fcolW+"px";this.hdr.rows[0].childNodes[ind].style.width=fcolW+"px";if(this.ftr){this.ftr.rows[0].childNodes[ind].style.width=fcolW+"px"}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=fcolW}else{var gridWidth=parseInt(this.entBox.offsetWidth);if(this.objBox.scrollHeight>this.objBox.offsetHeight){gridWidth-=(this._scrFix||(_isFF?17:17))}var pcWidth=Math.round(fcolW/gridWidth*100);this.cellWidthPC[ind]=pcWidth}}};this.setSortImgState=function(state,ind,order,row){order=(order||"asc").toLowerCase();if(!convertStringToBoolean(state)){this.sortImg.style.display="none";this.fldSorted=null;return}if(order=="asc"){this.sortImg.src=this.imgURL+"sort_asc.gif"}else{this.sortImg.src=this.imgURL+"sort_desc.gif"}this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[ind];var r=this.hdr.rows[row||1];for(var i=0;i<r.childNodes.length;i++){if(r.childNodes[i]._cellIndex==ind){this.r_fldSorted=r.childNodes[i]}}this.setSortImgPos()};this.setSortImgPos=function(ind,mode,hRowInd,el){if(!el){if(!ind){var el=this.r_fldSorted}else{var el=this.hdr.rows[hRowInd||0].cells[ind]}}if(el!=null){var pos=this.getPosition(el,this.hdrBox);var wdth=el.offsetWidth;this.sortImg.style.left=Number(pos[0]+wdth-13)+"px";this.sortImg.defLeft=parseInt(this.sortImg.style.left);this.sortImg.style.top=Number(pos[1]+5)+"px";if((!this.useImagesInHeader)&&(!mode)){this.sortImg.style.display="inline"}this.sortImg.style.left=this.sortImg.defLeft+"px"}};this.setActive=function(fl){if(arguments.length==0){var fl=true}if(fl==true){if(globalActiveDHTMLGridObject&&(globalActiveDHTMLGridObject!=this)){globalActiveDHTMLGridObject.editStop()}globalActiveDHTMLGridObject=this;this.isActive=true}else{this.isActive=false}};this._doClick=function(ev){var selMethod=0;var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");var fl=true;if(this.markedCells){var markMethod=0;if(ev.shiftKey||ev.metaKey){markMethod=1}if(ev.ctrlKey){markMethod=2}this.doMark(el,markMethod);return true}if(this.selMultiRows!=false){if(ev.shiftKey&&this.row!=null){selMethod=1}if(ev.ctrlKey||ev.metaKey){selMethod=2}}this.doClick(el,fl,selMethod)};this._doContClick=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if((!el)||(typeof(el.parentNode.idd)=="undefined")){return true}if(ev.button==2||(_isMacOS&&ev.ctrlKey)){if(!this.callEvent("onRightClick",[el.parentNode.idd,el._cellIndex,ev])){var z=function(e){document.body.oncontextmenu=Function("return true;");(e||event).cancelBubble=true;return false};if(_isIE){ev.srcElement.oncontextmenu=z}else{if(!_isMacOS){document.body.oncontextmenu=z}}return false}if(this._ctmndx){if(!(this.callEvent("onBeforeContextMenu",[el.parentNode.idd,el._cellIndex,this]))){return true}el.contextMenuId=el.parentNode.idd+"_"+el._cellIndex;el.contextMenu=this._ctmndx;el.a=this._ctmndx._contextStart;if(_isIE){ev.srcElement.oncontextmenu=function(){event.cancelBubble=true;return false}}el.a(el,ev);el.a=null}}else{if(this._ctmndx){this._ctmndx._contextEnd()}}return true};this.doClick=function(el,fl,selMethod,show){var psid=this.row?this.row.idd:0;this.setActive(true);if(!selMethod){selMethod=0}if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"")}if(el!=null&&el.tagName=="TD"){if(this.checkEvent("onSelectStateChanged")){var initial=this.getSelectedId()}var prow=this.row;if(selMethod==1){var elRowIndex=this.rowsCol._dhx_find(el.parentNode);var lcRowIndex=this.rowsCol._dhx_find(this.lastClicked);if(elRowIndex>lcRowIndex){var strt=lcRowIndex;var end=elRowIndex}else{var strt=elRowIndex;var end=lcRowIndex}for(var i=0;i<this.rowsCol.length;i++){if((i>=strt&&i<=end)){if(this.rowsCol[i]&&(!this.rowsCol[i]._sRow)){if(this.rowsCol[i].className.indexOf("rowselected")==-1&&this.callEvent("onBeforeSelect",[this.rowsCol[i].idd,psid])){this.rowsCol[i].className+=" rowselected";this.selectedRows[this.selectedRows.length]=this.rowsCol[i]}}else{this.clearSelection();return this.doClick(el,fl,0,show)}}}}else{if(selMethod==2){if(el.parentNode.className.indexOf("rowselected")!=-1){el.parentNode.className=el.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode));var skipRowSelection=true}}}this.editStop();if(typeof(el.parentNode.idd)=="undefined"){return true}if((!skipRowSelection)&&(!el.parentNode._sRow)){if(this.callEvent("onBeforeSelect",[el.parentNode.idd,psid])){if(selMethod==0){this.clearSelection()}this.cell=el;if((prow==el.parentNode)&&(this._chRRS)){fl=false}this.row=el.parentNode;this.row.className+=" rowselected";if(this.selectedRows._dhx_find(this.row)==-1){this.selectedRows[this.selectedRows.length]=this.row}}}if(this.cell.parentNode.className.indexOf("rowselected")!=-1){this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected"}if(selMethod!=1){if(!this.row){return}}this.lastClicked=el.parentNode;var rid=this.row.idd;var cid=this.cell._cellIndex;if(fl&&typeof(rid)!="undefined"){self.onRowSelectTime=setTimeout(function(){self.callEvent("onRowSelect",[rid,cid])},100)}if(this.checkEvent("onSelectStateChanged")){var afinal=this.getSelectedId();if(initial!=afinal){this.callEvent("onSelectStateChanged",[afinal])}}}this.isActive=true;if(show!==false){this.moveToVisible(this.cell)}};this.selectAll=function(){this.clearSelection();this.selectedRows=dhtmlxArray([].concat(this.rowsCol));for(var i=this.rowsCol.length-1;i>=0;i--){if(this.rowsCol[i]._cntr){this.selectedRows.splice(i,1)}else{this.rowsCol[i].className+=" rowselected"}}if(this.selectedRows.length){this.row=this.selectedRows[0];this.cell=this.row.cells[0]}if((this._fake)&&(!this._realfake)){this._fake.selectAll()}};this.selectCell=function(r,cInd,fl,preserve,edit,show){if(!fl){fl=false}if(typeof(r)!="object"){r=this.rowsCol[r]}if(!r){return null}if(r._childIndexes){var c=r.childNodes[r._childIndexes[cInd]]}else{var c=r.childNodes[cInd]}if(!c){c=r.childNodes[0]}if(preserve){this.doClick(c,fl,3,show)}else{this.doClick(c,fl,0,show)}if(edit){this.editCell()}};this.moveToVisible=function(cell_obj,onlyVScroll){if(cell_obj!=null){if(!cell_obj.offsetHeight){var h=this.rowsBuffer._dhx_find(cell_obj.parentNode)*this._srdh;return this.objBox.scrollTop=h}try{var distance=cell_obj.offsetLeft+cell_obj.offsetWidth+20;var scrollLeft=0;if(distance>(this.objBox.offsetWidth+this.objBox.scrollLeft)){if(cell_obj.offsetLeft>this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-5}}else{if(cell_obj.offsetLeft<this.objBox.scrollLeft){distance-=cell_obj.offsetWidth*2/3;if(distance<this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-5}}}if((scrollLeft)&&(!onlyVScroll)){this.objBox.scrollLeft=scrollLeft}var distance=cell_obj.offsetTop+cell_obj.offsetHeight+20;if(distance>(this.objBox.offsetHeight+this.objBox.scrollTop)){var scrollTop=distance-this.objBox.offsetHeight}else{if(cell_obj.offsetTop<this.objBox.scrollTop){var scrollTop=cell_obj.offsetTop-5}}if(scrollTop){this.objBox.scrollTop=scrollTop}}catch(er){}}};this.editCell=function(){if(this.editor&&this.cell==this.editor.cell){return}this.editStop();if((this.isEditable!=true)||(!this.cell)){return false}var c=this.cell;if(c.parentNode._locked){return false}this.editor=this.cells4(c);if(this.editor!=null){if(this.editor.isDisabled()){this.editor=null;return false}if(this.callEvent("onEditCell",[0,this.row.idd,this.cell._cellIndex])!=false&&this.editor.edit){this._Opera_stop=(new Date).valueOf();c.className+=" editable";this.editor.edit();this.callEvent("onEditCell",[1,this.row.idd,this.cell._cellIndex])}else{this.editor=null}}};this.editStop=function(mode){if(_isOpera){if(this._Opera_stop){if((this._Opera_stop*1+50)>(new Date).valueOf()){return}this._Opera_stop=null}}if(this.editor&&this.editor!=null){this.editor.cell.className=this.editor.cell.className.replace("editable","");if(mode){var t=this.editor.val;this.editor.detach();this.editor.setValue(t);this.editor=null;return}if(this.editor.detach()){this.cell.wasChanged=true}var g=this.editor;this.editor=null;var z=this.callEvent("onEditCell",[2,this.row.idd,this.cell._cellIndex,g.getValue(),g.val]);if((typeof(z)=="string")||(typeof(z)=="number")){g[g.setImage?"setLabel":"setValue"](z)}else{if(!z){g[g.setImage?"setLabel":"setValue"](g.val)}}}};this._nextRowCell=function(row,dir,pos){row=this._nextRow(this.rowsCol._dhx_find(row),dir);if(!row){return null}return row.childNodes[row._childIndexes?row._childIndexes[pos]:pos]};this._getNextCell=function(acell,dir,i){acell=acell||this.cell;var arow=acell.parentNode;if(this._tabOrder){i=this._tabOrder[acell._cellIndex];if(typeof i!="undefined"){if(i<0){acell=this._nextRowCell(arow,dir,Math.abs(i)-1)}else{acell=arow.childNodes[i]}}}else{var i=acell._cellIndex+dir;if(i>=0&&i<this._cCount){if(arow._childIndexes){i=arow._childIndexes[acell._cellIndex]+dir}acell=arow.childNodes[i]}else{acell=this._nextRowCell(arow,dir,(dir==1?0:(this._cCount-1)))}}if(!acell){if((dir==1)&&this.tabEnd){this.tabEnd.focus();this.tabEnd.focus()}if((dir==-1)&&this.tabStart){this.tabStart.focus();this.tabStart.focus()}return null}if(acell.style.display!="none"&&(!this.smartTabOrder||!this.cells(acell.parentNode.idd,acell._cellIndex).isDisabled())){return acell}return this._getNextCell(acell,dir)};this._nextRow=function(ind,dir){var r=this.rowsCol[ind+dir];if(r&&r.style.display=="none"){return this._nextRow(ind+dir,dir)}return r};this.scrollPage=function(dir){var new_ind=Math.floor((this.getRowIndex(this.row.idd)||0)+(dir)*this.objBox.offsetHeight/(this._srdh||20));if(new_ind<0){new_ind=0}if(this._dload&&(!this.rowsCol[new_ind])){this._askRealRows(new_ind,function(){try{self.selectCell(new_ind,(this.cell?this.cell._cellIndex:0),true)}catch(e){}})}else{if(new_ind>=this.rowsCol.length){new_ind=this.rowsCol.length-1}this.selectCell(new_ind,this.cell._cellIndex,true)}};this.doKey=function(ev){if(!ev){return true}if((ev.target||ev.srcElement).value!==window.undefined){var zx=(ev.target||ev.srcElement);if((!zx.parentNode)||(zx.parentNode.className.indexOf("editable")==-1)){return true}}if((globalActiveDHTMLGridObject)&&(this!=globalActiveDHTMLGridObject)){return globalActiveDHTMLGridObject.doKey(ev)}if(this.isActive==false){return true}if(this._htkebl){return true}if(!this.callEvent("onKeyPress",[ev.keyCode,ev.ctrlKey,ev.shiftKey,ev])){return false}var code="k"+ev.keyCode+"_"+(ev.ctrlKey?1:0)+"_"+(ev.shiftKey?1:0);if(this.cell){if(this._key_events[code]){if(false===this._key_events[code].call(this)){return true}if(ev.preventDefault){ev.preventDefault()}ev.cancelBubble=true;return false}if(this._key_events.k_other){this._key_events.k_other.call(this,ev)}}return true};this.getRow=function(cell){if(!cell){cell=window.event.srcElement}if(cell.tagName!="TD"){cell=cell.parentElement}r=cell.parentElement;if(this.cellType[cell._cellIndex]=="lk"){eval(this.onLink+"('"+this.getRowId(r.rowIndex)+"',"+cell._cellIndex+")")}this.selectCell(r,cell._cellIndex,true)};this.selectRow=function(r,fl,preserve,show){if(typeof(r)!="object"){r=this.rowsCol[r]}this.selectCell(r,0,fl,preserve,false,show)};this.wasDblClicked=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(el){var rowId=el.parentNode.idd;return this.callEvent("onRowDblClicked",[rowId,el._cellIndex])}};this._onHeaderClick=function(e,el){var that=this.grid;el=el||that.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");if(this.grid.resized==null){if(!(this.grid.callEvent("onHeaderClick",[el._cellIndexS,(e||window.event)]))){return false}that.sortField(el._cellIndexS,false,el)}};this.deleteSelectedRows=function(){var num=this.selectedRows.length;if(num==0){return}var tmpAr=this.selectedRows;this.selectedRows=dhtmlxArray();for(var i=num-1;i>=0;i--){var node=tmpAr[i];if(!this.deleteRow(node.idd,node)){this.selectedRows[this.selectedRows.length]=node}else{if(node==this.row){var ind=i}}}if(ind){try{if(ind+1>this.rowsCol.length){ind--}this.selectCell(ind,0,true)}catch(er){this.row=null;this.cell=null}}};this.getSelectedRowId=function(){var selAr=new Array(0);var uni={};for(var i=0;i<this.selectedRows.length;i++){var id=this.selectedRows[i].idd;if(uni[id]){continue}selAr[selAr.length]=id;uni[id]=true}if(selAr.length==0){return null}else{return selAr.join(this.delim)}};this.getSelectedCellIndex=function(){if(this.cell!=null){return this.cell._cellIndex}else{return -1}};this.getColWidth=function(ind){return parseInt(this.cellWidthPX[ind])+((_isFF)?2:0)};this.setColWidth=function(ind,value){if(this.cellWidthType=="px"){this.cellWidthPX[ind]=parseInt(value)}else{this.cellWidthPC[ind]=parseInt(value)}this.setSizes()};this.getRowIndex=function(row_id){for(var i=0;i<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]&&this.rowsBuffer[i].idd==row_id){return i}}};this.getRowId=function(ind){return this.rowsBuffer[ind]?this.rowsBuffer[ind].idd:this.undefined};this.setRowId=function(ind,row_id){var r=this.rowsCol[ind];this.changeRowId(r.idd,row_id)};this.changeRowId=function(oldRowId,newRowId){if(oldRowId==newRowId){return}var row=this.rowsAr[oldRowId];row.idd=newRowId;if(this.UserData[oldRowId]){this.UserData[newRowId]=this.UserData[oldRowId];this.UserData[oldRowId]=null}if(this._h2&&this._h2.get[oldRowId]){this._h2.get[newRowId]=this._h2.get[oldRowId];this._h2.get[newRowId].id=newRowId;delete this._h2.get[oldRowId]}this.rowsAr[oldRowId]=null;this.rowsAr[newRowId]=row;for(var i=0;i<row.childNodes.length;i++){if(row.childNodes[i]._code){row.childNodes[i]._code=this._compileSCL(row.childNodes[i]._val,row.childNodes[i])}}};this.setColumnIds=function(ids){this.columnIds=ids.split(this.delim)};this.setColumnId=function(ind,id){this.columnIds[ind]=id};this.getColIndexById=function(id){for(var i=0;i<this.columnIds.length;i++){if(this.columnIds[i]==id){return i}}};this.getColumnId=function(cin){return this.columnIds[cin]};this.getColumnLabel=function(cin,ind){var z=this.hdr.rows[(ind||0)+1];var n=z.cells[z._childIndexes?z._childIndexes[parseInt(cin)]:cin];return(_isIE?n.innerText:n.textContent)};this.setRowTextBold=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="bold"}};this.setRowTextStyle=function(row_id,styleString){var r=this.getRowById(row_id);if(!r){return}for(var i=0;i<r.childNodes.length;i++){var pfix="";if((this._hrrar)&&(this._hrrar[i])){pfix="display:none;"}if(_isIE){r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}else{r.childNodes[i].style.cssText=pfix+"width:"+r.childNodes[i].style.width+";"+styleString}}};this.setRowColor=function(row_id,color){var r=this.getRowById(row_id);for(var i=0;i<r.childNodes.length;i++){r.childNodes[i].bgColor=color}};this.setCellTextStyle=function(row_id,ind,styleString){var r=this.getRowById(row_id);if(!r){return}var cell=r.childNodes[r._childIndexes?r._childIndexes[ind]:ind];if(!cell){return}var pfix="";if((this._hrrar)&&(this._hrrar[ind])){pfix="display:none;"}if(_isIE){cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}else{cell.style.cssText=pfix+"width:"+cell.style.width+";"+styleString}};this.setRowTextNormal=function(row_id){var r=this.getRowById(row_id);if(r){r.style.fontWeight="normal"}};this.doesRowExist=function(row_id){if(this.getRowById(row_id)!=null){return true}else{return false}};this.getColumnsNum=function(){return this._cCount};this.moveRowUp=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,-1)}var rInd=this.rowsCol._dhx_find(r);if((r.previousSibling)&&(rInd!=0)){r.parentNode.insertBefore(r,r.previousSibling);this.rowsCol._dhx_swapItems(rInd,rInd-1);this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd-1);if(this._cssEven){this._fixAlterCss(rInd-1)}}};this.moveRowDown=function(row_id){var r=this.getRowById(row_id);if(this.isTreeGrid()){return this.moveRowUDTG(row_id,1)}var rInd=this.rowsCol._dhx_find(r);if(r.nextSibling){this.rowsCol._dhx_swapItems(rInd,rInd+1);if(r.nextSibling.nextSibling){r.parentNode.insertBefore(r,r.nextSibling.nextSibling)}else{r.parentNode.appendChild(r)}this.setSizes();var bInd=this.rowsBuffer._dhx_find(r);this.rowsBuffer._dhx_swapItems(bInd,bInd+1);if(this._cssEven){this._fixAlterCss(rInd)}}};this.getCombo=function(col_ind){if(!this.combos[col_ind]){this.combos[col_ind]=new dhtmlXGridComboObject()}return this.combos[col_ind]};this.setUserData=function(row_id,name,value){try{if(row_id==""){row_id="gridglobaluserdata"}if(!this.UserData[row_id]){this.UserData[row_id]=new Hashtable()}this.UserData[row_id].put(name,value)}catch(er){alert("UserData Error:"+er.description)}};this.getUserData=function(row_id,name){this.getRowById(row_id);if(row_id==""){row_id="gridglobaluserdata"}var z=this.UserData[row_id];return(z?z.get(name):"")};this.setEditable=function(fl){this.isEditable=convertStringToBoolean(fl)};this.selectRowById=function(row_id,multiFL,show,call){if(!call){call=false}this.selectCell(this.getRowById(row_id),0,call,multiFL,false,show)};this.clearSelection=function(){this.editStop();for(var i=0;i<this.selectedRows.length;i++){var r=this.rowsAr[this.selectedRows[i].idd];if(r){r.className=r.className.replace(/rowselected/g,"")}}this.selectedRows=dhtmlxArray();this.row=null;if(this.cell!=null){this.cell.className=this.cell.className.replace(/cellselected/g,"");this.cell=null}};this.copyRowContent=function(from_row_id,to_row_id){var frRow=this.getRowById(from_row_id);if(!this.isTreeGrid()){for(var i=0;i<frRow.cells.length;i++){this.cells(to_row_id,i).setValue(this.cells(from_row_id,i).getValue())}}else{this._copyTreeGridRowContent(frRow,from_row_id,to_row_id)}if(!isIE()){this.getRowById(from_row_id).cells[0].height=frRow.cells[0].offsetHeight}};this.setColumnLabel=function(c,label,ind){var z=this.hdr.rows[ind||1];var col=(z._childIndexes?z._childIndexes[c]:c);if(!this.useImagesInHeader){var hdrHTML="<div class='hdrcell'>";if(label.indexOf("img:[")!=-1){var imUrl=label.replace(/.*\[([^>]+)\].*/,"$1");label=label.substr(label.indexOf("]")+1,label.length);hdrHTML+="<img width='18px' height='18px' align='absmiddle' src='"+imUrl+"' hspace='2'>"}hdrHTML+=label;hdrHTML+="</div>";z.cells[col].innerHTML=hdrHTML;if(this._hstyles[col]){z.cells[col].style.cssText=this._hstyles[col]}}else{z.cells[col].style.textAlign="left";z.cells[col].innerHTML="<img src='"+this.imgURL+""+label+"' onerror='this.src = \""+this.imgURL+"imageloaderror.gif\"'>";var a=new Image();a.src=this.imgURL+""+label.replace(/(\.[a-z]+)/,".desc$1");this.preloadImagesAr[this.preloadImagesAr.length]=a;var b=new Image();b.src=this.imgURL+""+label.replace(/(\.[a-z]+)/,".asc$1");this.preloadImagesAr[this.preloadImagesAr.length]=b}if((label||"").indexOf("#")!=-1){var t=label.match(/(^|{)#([^}]+)(}|$)/);if(t){var tn="_in_header_"+t[2];if(this[tn]){this[tn]((this.forceDivInHeader?z.cells[col].firstChild:z.cells[col]),col,label.split(t[0]))}}}};this.clearAll=function(header){if(this._h2){this._h2=new dhtmlxHierarchy();if(this._fake){if(this._realfake){this._h2=this._fake._h2}else{this._fake._h2=this._h2}}}this.limit=this._limitC=0;this.editStop(true);if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}if(this._dload){this.objBox.scrollTop=0;this.limit=this._limitC||0;this._initDrF=true}var len=this.rowsCol.length;len=this.obj.rows.length;for(var i=len-1;i>0;i--){var t_r=this.obj.rows[i];t_r.parentNode.removeChild(t_r)}if(header&&this.obj.rows[0]){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(var i=this.hdr.rows.length-1;i>=0;i--){var t_r=this.hdr.rows[i];t_r.parentNode.removeChild(t_r)}if(this.ftr){this.ftr.parentNode.removeChild(this.ftr);this.ftr=null}this._aHead=this.ftr=this._aFoot=null;this._hrrar=[];this.columnIds=[]}this.row=null;this.cell=null;this.rowsCol=dhtmlxArray();this.rowsAr=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn){this.xmlFileUrl="";this.changePage(1)}if(this._contextCallTimer){window.clearTimeout(this._contextCallTimer)}if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;this.setSortImgState(false);this.setSizes();this.callEvent("onClearAll",[])};this.sortField=function(ind,repeatFl,r_el){if(this.getRowsNum()==0){return false}var el=this.hdr.rows[0].cells[ind];if(!el){return}if(el.tagName=="TH"&&(this.fldSort.length-1)>=el._cellIndex&&this.fldSort[el._cellIndex]!="na"){if((((this.sortImg.src.indexOf("_desc.gif")==-1)&&(!repeatFl))||((this.sortImg.style.filter!="")&&(repeatFl)))&&(this.fldSorted==el)){var sortType="des"}else{var sortType="asc"}if(!this.callEvent("onBeforeSorting",[ind,this.fldSort[ind],sortType])){return}this.sortImg.src=this.imgURL+"sort_"+(sortType=="asc"?"asc":"desc")+".gif";if(this.useImagesInHeader){var cel=this.hdr.rows[1].cells[el._cellIndex].firstChild;if(this.fldSorted!=null){var celT=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;celT.src=celT.src.replace(/\.[ascde]+\./,".")}cel.src=cel.src.replace(/(\.[a-z]+)/,"."+sortType+"$1")}this.sortRows(el._cellIndex,this.fldSort[el._cellIndex],sortType);this.fldSorted=el;this.r_fldSorted=r_el;var c=this.hdr.rows[1];var c=r_el.parentNode;var real_el=c._childIndexes?c._childIndexes[el._cellIndex]:el._cellIndex;this.setSortImgPos(false,false,false,r_el);this.callEvent("onAfterSorting",[ind,this.fldSort[ind],sortType])}};this.setCustomSorting=function(func,col){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[col]=(typeof(func)=="string")?eval(func):func;this.fldSort[col]="cus"};this.enableHeaderImages=function(fl){this.useImagesInHeader=fl};this.setHeader=function(hdrStr,splitSign,styles){if(typeof(hdrStr)!="object"){var arLab=this._eSplit(hdrStr)}else{arLab=[].concat(hdrStr)}var arWdth=new Array(0);var arTyp=new dhtmlxArray(0);var arAlg=new Array(0);var arVAlg=new Array(0);var arSrt=new Array(0);for(var i=0;i<arLab.length;i++){arWdth[arWdth.length]=Math.round(100/arLab.length);arTyp[arTyp.length]="ed";arAlg[arAlg.length]="left";arVAlg[arVAlg.length]="";arSrt[arSrt.length]="na"}this.splitSign=splitSign||"#cspan";this.hdrLabels=arLab;this.cellWidth=arWdth;this.cellType=arTyp;this.cellAlign=arAlg;this.cellVAlign=arVAlg;this.fldSort=arSrt;this._hstyles=styles||[]};this._eSplit=function(str){if(![].push){return str.split(this.delim)}var a="r"+(new Date()).valueOf();var z=this.delim.replace(/([\|\+\*\^])/g,"\\$1");return(str||"").replace(RegExp(z,"g"),a).replace(RegExp("\\\\"+a,"g"),this.delim).split(a)};this.getColType=function(cInd){return this.cellType[cInd]};this.getColTypeById=function(cID){return this.cellType[this.getColIndexById(cID)]};this.setColTypes=function(typeStr){this.cellType=dhtmlxArray(typeStr.split(this.delim));this._strangeParams=new Array();for(var i=0;i<this.cellType.length;i++){if((this.cellType[i].indexOf("[")!=-1)){var z=this.cellType[i].split(/[\[\]]+/g);this.cellType[i]=z[0];this.defVal[i]=z[1];if(z[1].indexOf("=")==0){this.cellType[i]="math";this._strangeParams[i]=z[0]}}}};this.setColSorting=function(sortStr){this.fldSort=sortStr.split(this.delim);for(var i=0;i<this.fldSort.length;i++){if(((this.fldSort[i]).length>4)&&(typeof(window[this.fldSort[i]])=="function")){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[i]=window[this.fldSort[i]];this.fldSort[i]="cus"}}};this.setColAlign=function(alStr){this.cellAlign=alStr.split(this.delim)};this.setColVAlign=function(valStr){this.cellVAlign=valStr.split(this.delim)};this.setNoHeader=function(fl){this.noHeader=convertStringToBoolean(fl)};this.showRow=function(rowID){this.getRowById(rowID);if(this.pagingOn){this.changePage(Math.floor(this.getRowIndex(rowID)/this.rowsBufferOutSize)+1)}if(this._h2){this.openItem(this._h2.get[rowID].parent.id)}var c=this.getRowById(rowID).cells[0];while(c&&c.style.display=="none"){c=c.nextSibling}if(c){this.moveToVisible(c,true)}};this.setStyle=function(ss_header,ss_grid,ss_selCell,ss_selRow){this.ssModifier=[ss_header,ss_grid,ss_selCell,ss_selCell,ss_selRow];var prefs=["#"+this.entBox.id+" table.hdr td","#"+this.entBox.id+" table.obj td","#"+this.entBox.id+" table.obj tr.rowselected td.cellselected","#"+this.entBox.id+" table.obj td.cellselected","#"+this.entBox.id+" table.obj tr.rowselected td"];for(var i=0;i<prefs.length;i++){if(this.ssModifier[i]){if(_isIE){document.styleSheets[0].addRule(prefs[i],this.ssModifier[i])}else{document.styleSheets[0].insertRule(prefs[i]+" { "+this.ssModifier[i]+" } ",0)}}}};this.setColumnColor=function(clr){this.columnColor=clr.split(this.delim)};this.enableAlterCss=function(cssE,cssU,perLevel,levelUnique){if(cssE||cssU){this.attachEvent("onGridReconstructed",function(){if(!this._cssSP){this._fixAlterCss();if(this._fake){this._fake._fixAlterCss()}}})}this._cssSP=perLevel;this._cssSU=levelUnique;this._cssEven=cssE;this._cssUnEven=cssU};this._fixAlterCss=function(ind){if(this._cssSP&&this._h2){return this._fixAlterCssTGR(ind)}if(!this._cssEven&&!this._cssUnEven){return}ind=ind||0;var j=ind;for(var i=ind;i<this.rowsCol.length;i++){if(!this.rowsCol[i]){continue}if(this.rowsCol[i].style.display!="none"){if(this.rowsCol[i].className.indexOf("rowselected")!=-1){if(j%2==1){this.rowsCol[i].className=this._cssUnEven+" rowselected"+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+" rowselected"+(this.rowsCol[i]._css||"")}}else{if(j%2==1){this.rowsCol[i].className=this._cssUnEven+(this.rowsCol[i]._css||"")}else{this.rowsCol[i].className=this._cssEven+(this.rowsCol[i]._css||"")}}j++}}};this.clearChangedState=function(){for(var i=0;i<this.rowsCol.length;i++){var row=this.rowsCol[i];var cols=row.childNodes.length;for(var j=0;j<cols;j++){row.childNodes[j].wasChanged=false}}};this.getChangedRows=function(){var res=new Array();this.forEachRow(function(id){var row=this.rowsAr[id];var cols=row.childNodes.length;for(var j=0;j<cols;j++){if(row.childNodes[j].wasChanged){res[res.length]=row.idd;break}}});return res.join(this.delim)};this._sUDa=false;this._sAll=false;this.setSerializationLevel=function(userData,fullXML,config,changedAttr,onlyChanged,asCDATA){this._sUDa=userData;this._sAll=fullXML;this._sConfig=config;this._chAttr=changedAttr;this._onlChAttr=onlyChanged;this._asCDATA=asCDATA};this.setSerializableColumns=function(list){if(!list){this._srClmn=null;return}this._srClmn=(list||"").split(",");for(var i=0;i<this._srClmn.length;i++){this._srClmn[i]=convertStringToBoolean(this._srClmn[i])}};this._serialise=function(rCol,inner,closed){this.editStop();var out=[];var close="</"+this.xml.s_row+">";if(this.isTreeGrid()){this._h2.forEachChildF(0,function(el){var temp=this._serializeRow(this.render_row_tree(-1,el.id));out.push(temp);if(temp){return true}else{return false}},this,function(){out.push(close)})}else{for(var i=0;i<this.rowsBuffer.length;i++){if(this.rowsBuffer[i]){var temp=this._serializeRow(this.render_row(i));out.push(temp);if(temp){out.push(close)}}}}return[out.join("")]};this._serializeRow=function(r,i){var out=[];var ra=this.xml.row_attrs;var ca=this.xml.cell_attrs;out.push("<"+this.xml.s_row);out.push(" id='"+r.idd+"'");if((this._sAll)&&this.selectedRows._dhx_find(r)!=-1){out.push("selected='1'")}if(this._h2&&this._h2.get[r.idd].state=="minus"){out.push("open='1'")}if(ra.length){for(var i=0;i<ra.length;i++){out.push(" "+ra[i]+"='"+r._attrs[ra[i]]+"'")}}out.push(">");if(this._sUDa&&this.UserData[r.idd]){keysAr=this.UserData[r.idd].getKeys();for(var ii=0;ii<keysAr.length;ii++){out.push("<userdata name='"+keysAr[ii]+"'>"+this.UserData[r.idd].get(keysAr[ii])+"</userdata>")}}var changeFl=false;for(var jj=0;jj<this._cCount;jj++){if((!this._srClmn)||(this._srClmn[jj])){var zx=this.cells3(r,jj);out.push("<cell");if(ca.length){for(var i=0;i<ca.length;i++){out.push(" "+ca[i]+"='"+zx.cell._attrs[ca[i]]+"'")}}zxVal=zx[this._agetm]();if(this._asCDATA){zxVal="<![CDATA["+zxVal+"]]>"}if((this._ecspn)&&(zx.cell.colSpan)&&cvx.colSpan>1){out.push(' colspan="'+cvx.colSpan+'" ')}if(this._chAttr){if(zx.wasChanged()){out.push(' changed="1"');changeFl=true}}else{if((this._onlChAttr)&&(zx.wasChanged())){changeFl=true}}if(this._sAll){out.push((this._h2?(" image='"+this._h2.get[r.idd].image+"'"):"")+">"+zxVal+"</cell>")}else{out.push(">"+zxVal+"</cell>")}if((this._ecspn)&&(zx.cell.colSpan)){for(var u=0;u<zx.cell.colSpan-1;u++){out.push("<cell/>");jj++}}}}if((this._onlChAttr)&&(!changeFl)&&(!r._added)){return""}return out.join("")};this._serialiseConfig=function(){var out="<head>";for(var i=0;i<this.hdr.rows[0].cells.length;i++){out+="<column width='"+this.cellWidthPX[i]+"' align='"+this.cellAlign[i]+"' type='"+this.cellType[i]+"' sort='"+this.fldSort[i]+"' color='"+this.columnColor[i]+"'"+(this.columnIds[i]?(" id='"+this.columnIds[i]+"'"):"")+">";out+=this.getHeaderCol(i);var z=this.getCombo(i);if(z){for(var j=0;j<z.keys.length;j++){out+="<option value='"+z.keys[j]+"'>"+z.values[j]+"</option>"}}out+="</column>"}return out+="</head>"};this.serialize=function(){var out='<?xml version="1.0"?><rows>';if(this._mathSerialization){this._agetm="getMathValue"}else{this._agetm="getValue"}if(this._sUDa&&this.UserData.gridglobaluserdata){var keysAr=this.UserData.gridglobaluserdata.getKeys();for(var i=0;i<keysAr.length;i++){out+="<userdata name='"+keysAr[i]+"'>"+this.UserData.gridglobaluserdata.get(keysAr[i])+"</userdata>"}}if(this._sConfig){out+=this._serialiseConfig()}out+=this._serialise();out+="</rows>";return out};this.getPosition=function(oNode,pNode){if(!pNode){var pNode=document.body}var oCurrentNode=oNode;var iLeft=0;var iTop=0;while((oCurrentNode)&&(oCurrentNode!=pNode)){iLeft+=oCurrentNode.offsetLeft-oCurrentNode.scrollLeft;iTop+=oCurrentNode.offsetTop-oCurrentNode.scrollTop;oCurrentNode=oCurrentNode.offsetParent}if(pNode==document.body){if(_isIE){if(document.documentElement.scrollTop){iTop+=document.documentElement.scrollTop}if(document.documentElement.scrollLeft){iLeft+=document.documentElement.scrollLeft}}else{if(!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop}}}return new Array(iLeft,iTop)};this.getFirstParentOfType=function(obj,tag){while(obj&&obj.tagName!=tag&&obj.tagName!="BODY"){obj=obj.parentNode}return obj};this.objBox.onscroll=function(){this.grid._doOnScroll()};if((!_isOpera)||(_OperaRv>8.5)){this.hdr.onmousemove=function(e){this.grid.changeCursorState(e||window.event)};this.hdr.onmousedown=function(e){return this.grid.startColResize(e||window.event)}}this.obj.onmousemove=this._drawTooltip;this.obj.onclick=function(e){this.grid._doClick(e||window.event);if(this.grid._sclE){this.grid.editCell(e||window.event)}(e||event).cancelBubble=true};if(_isMacOS){this.entBox.oncontextmenu=function(e){return this.grid._doContClick(e||window.event)}}this.entBox.onmousedown=function(e){return this.grid._doContClick(e||window.event)};this.obj.ondblclick=function(e){if(!this.grid.wasDblClicked(e||window.event)){return false}if(this.grid._dclE){this.grid.editCell(e||window.event)}(e||event).cancelBubble=true};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){self._onHeaderClick.apply({grid:self},[null,self.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown){dhtmlxEvent(document,"keydown",function(e){if(globalActiveDHTMLGridObject){return globalActiveDHTMLGridObject.doKey(e||window.event)}});document.body._dhtmlxgrid_onkeydown=true}dhtmlxEvent(document.body,"click",function(){if(self.editStop){self.editStop()}});this.entBox.onbeforeactivate=function(){this._still_active=null;this.grid.setActive();event.cancelBubble=true};this.entBox.onbeforedeactivate=function(){if(this.grid._still_active){this.grid._still_active=null}else{this.grid.isActive=false}event.cancelBubble=true};if(this.entBox.style.height.toString().indexOf("%")!=-1){this._setAutoResize()}this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId;this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=this.enableAutoHeight;this.getUID=this.uid;return this}dhtmlXGridObject.prototype={getRowAttribute:function(f,b){return this.getRowById(f)._attrs[b]},setRowAttribute:function(g,b,f){this.getRowById(g)._attrs[b]=f},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(m,h){var g=convertStringToBoolean(h);var l=this.getRowById(m);if(!l){return}if(l.expand===""){this.collapseKids(l)}if((h)&&(l.style.display!="none")){l.style.display="none";var k=this.selectedRows._dhx_find(l);if(k!=-1){l.className=l.className.replace("rowselected","");for(var b=0;b<l.childNodes.length;b++){l.childNodes[b].className=l.childNodes[b].className.replace(/cellselected/g,"")}this.selectedRows._dhx_removeAt(k)}this.callEvent("onGridReconstructed",[])}if((!h)&&(l.style.display=="none")){l.style.display="";this.callEvent("onGridReconstructed",[])}this.setSizes()},setColumnHidden:function(h,g){if(!this.hdr.rows.length){if(!this._ivizcol){this._ivizcol=[]}return this._ivizcol[h]=g}if((this.fldSorted)&&(this.fldSorted.cellIndex==h)&&(g)){this.sortImg.style.display="none"}var b=convertStringToBoolean(g);if(b){if(!this._hrrar){this._hrrar=new Array()}else{if(this._hrrar[h]){return}}this._hrrar[h]="display:none;";this._hideShowColumn(h,"none")}else{if((!this._hrrar)||(!this._hrrar[h])){return}this._hrrar[h]="";this._hideShowColumn(h,"")}if((this.fldSorted)&&(this.fldSorted.cellIndex==h)&&(!g)){this.sortImg.style.display="inline"}},isColumnHidden:function(b){if((this._hrrar)&&(this._hrrar[b])){return true}return false},setColumnsVisibility:function(f){if(f){this._ivizcol=f.split(",")}if(this.hdr.rows.length&&this._ivizcol){for(var b=0;b<this._ivizcol.length;b++){this.setColumnHidden(b,this._ivizcol[b])}}},_fixHiddenRowsAll:function(h,l,n,k){var m=h.rows.length;for(var g=0;g<m;g++){var b=h.rows[g].cells;if(b.length!=this._cCount){for(var f=0;f<b.length;f++){if(b[f]._cellIndex==l){b[f].style[n]=k;break}}}else{b[l].style[n]=k}}},_hideShowColumn:function(h,g){var b=h;if((this.hdr.rows[1]._childIndexes)&&(this.hdr.rows[1]._childIndexes[h]!=h)){b=this.hdr.rows[1]._childIndexes[h]}if(g=="none"){this.hdr.rows[0].cells[h]._oldWidth=this.hdr.rows[0].cells[h].style.width;this.hdr.rows[0].cells[h]._oldWidthP=this.cellWidthPC[h];this.obj.rows[0].cells[h].style.width="0px";this._fixHiddenRowsAll(this.obj,h,"display","none");if(this._fixHiddenRowsAllTG){this._fixHiddenRowsAllTG(h,"none")}if((_isOpera&&_OperaRv<9)||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,h,"display","none");if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],h,"display","none")}}this._fixHiddenRowsAll(this.hdr,h,"whiteSpace","nowrap");if(!this.cellWidthPX.length&&!this.cellWidthPC.length){this.cellWidthPX=[].concat(this.initCellWidth)}if(this.cellWidthPX[h]){this.cellWidthPX[h]=0}if(this.cellWidthPC[h]){this.cellWidthPC[h]=0}}else{if(this.hdr.rows[0].cells[h]._oldWidth){var f=this.hdr.rows[0].cells[h];if(_isOpera||_isKHTML||(_isFF)){this._fixHiddenRowsAll(this.hdr,h,"display","")}if(this.ftr){this._fixHiddenRowsAll(this.ftr.childNodes[0],h,"display","")}this.obj.rows[0].cells[h].style.width=this.hdr.rows[0].cells[h]._oldWidth;this._fixHiddenRowsAll(this.obj,h,"display","");if(this._fixHiddenRowsAllTG){this._fixHiddenRowsAllTG(h,"")}f.style.width=f._oldWidth;this._fixHiddenRowsAll(this.hdr,h,"whiteSpace","normal");if(f._oldWidthP){this.cellWidthPC[h]=f._oldWidthP}if(f._oldWidth){this.cellWidthPX[h]=parseInt(f._oldWidth)}}}this.setSizes();if((!_isIE)&&(!_isFF)){this.obj.border=1;this.obj.border=0}},enableColSpan:function(b){this._ecspn=convertStringToBoolean(b)},enableRowsHover:function(f,b){this._hvrCss=b;if(convertStringToBoolean(f)){if(!this._elmnh){this.obj._honmousemove=this.obj.onmousemove;this.obj.onmousemove=this._setRowHover;if(_isIE){this.obj.onmouseleave=this._unsetRowHover}else{this.obj.onmouseout=this._unsetRowHover}this._elmnh=true}}else{if(this._elmnh){this.obj.onmousemove=this.obj._honmousemove;if(_isIE){this.obj.onmouseleave=null}else{this.obj.onmouseout=null}this._elmnh=false}}},enableEditEvents:function(f,g,b){this._sclE=convertStringToBoolean(f);this._dclE=convertStringToBoolean(g);this._f2kE=convertStringToBoolean(b)},enableLightMouseNavigation:function(b){if(convertStringToBoolean(b)){if(!this._elmn){this.entBox._onclick=this.entBox.onclick;this.entBox.onclick=function(){return true};this.obj._onclick=this.obj.onclick;this.obj.onclick=function(f){var g=this.grid.getFirstParentOfType(f?f.target:event.srcElement,"TD");this.grid.editStop();this.grid.doClick(g);this.grid.editCell();(f||event).cancelBubble=true};this.obj._onmousemove=this.obj.onmousemove;this.obj.onmousemove=this._autoMoveSelect;this._elmn=true}}else{if(this._elmn){this.entBox.onclick=this.entBox._onclick;this.obj.onclick=this.obj._onclick;this.obj.onmousemove=this.obj._onmousemove;this._elmn=false}}},_unsetRowHover:function(f,g){if(g){that=this}else{that=this.grid}if((that._lahRw)&&(that._lahRw!=g)){for(var b=0;b<that._lahRw.childNodes.length;b++){that._lahRw.childNodes[b].className=that._lahRw.childNodes[b].className.replace(that._hvrCss,"")}that._lahRw=null}},_setRowHover:function(f){var g=this.grid.getFirstParentOfType(f?f.target:event.srcElement,"TD");if(g){this.grid._unsetRowHover(0,g);g=g.parentNode;for(var b=0;b<g.childNodes.length;b++){g.childNodes[b].className+=" "+this.grid._hvrCss}this.grid._lahRw=g}this._honmousemove(f)},_autoMoveSelect:function(b){if(!this.grid.editor){var f=this.grid.getFirstParentOfType(b?b.target:event.srcElement,"TD");if(f.parentNode.idd){this.grid.doClick(f,true,0)}}this._onmousemove(b)},enableDistributedParsing:function(g,b,f){if(convertStringToBoolean(g)){this._ads_count=b||10;this._ads_time=f||250}else{this._ads_count=0}},destructor:function(){if(this._sizeTime){this._sizeTime=window.clearTimeout(this._sizeTime)}if(this.formInputs){for(var f=0;f<this.formInputs.length;f++){this.parentForm.removeChild(this.formInputs[f])}}var b;this.xmlLoader=this.xmlLoader.destructor();for(var f=0;f<this.rowsCol.length;f++){if(this.rowsCol[f]){this.rowsCol[f].grid=null}}for(f in this.rowsAr){if(this.rowsAr[f]){this.rowsAr[f]=null}}this.rowsCol=new dhtmlxArray();this.rowsAr=new Array();this.entBox.innerHTML="";this.entBox.onclick=function(){};this.entBox.onmousedown=function(){};this.entBox.onbeforeactivate=function(){};this.entBox.onbeforedeactivate=function(){};this.entBox.onbeforedeactivate=function(){};this.entBox.onselectstart=function(){};this.entBox.grid=null;for(b in this){if((this[b])&&(this[b].m_obj)){this[b].m_obj=null}this[b]=null}if(this==globalActiveDHTMLGridObject){globalActiveDHTMLGridObject=null}return null},getSortingState:function(){var b=new Array();if(this.fldSorted){b[0]=this.fldSorted._cellIndex;b[1]=(this.sortImg.src.indexOf("sort_desc.gif")!=-1)?"des":"asc"}return b},enableAutoHeight:function(g,f,b){this._ahgr=convertStringToBoolean(g);this._ahgrF=convertStringToBoolean(b);this._ahgrM=f||null;if(f=="auto"){this._ahgrM=null;this._ahgrMA=true;this._setAutoResize()}},enableStableSorting:function(b){this._sst=convertStringToBoolean(b);this.rowsCol.stablesort=function(l){var k=this.length-1;for(var h=0;h<this.length-1;h++){for(var g=0;g<k;g++){if(l(this[g],this[g+1])>0){var f=this[g];this[g]=this[g+1];this[g+1]=f}}k--}}},enableKeyboardSupport:function(b){this._htkebl=!convertStringToBoolean(b)},enableContextMenu:function(b){this._ctmndx=b},setScrollbarWidthCorrection:function(b){this._scrFix=parseInt(b)},enableTooltips:function(f){this._enbTts=f.split(",");for(var b=0;b<this._enbTts.length;b++){this._enbTts[b]=convertStringToBoolean(this._enbTts[b])}},enableResizing:function(f){this._drsclmn=f.split(",");for(var b=0;b<this._drsclmn.length;b++){this._drsclmn[b]=convertStringToBoolean(this._drsclmn[b])}},setColumnMinWidth:function(b,f){if(arguments.length==2){if(!this._drsclmW){this._drsclmW=new Array()}this._drsclmW[f]=b}else{this._drsclmW=b.split(",")}},enableCellIds:function(b){this._enbCid=convertStringToBoolean(b)},lockRow:function(b,g){var f=this.getRowById(b);if(f){f._locked=convertStringToBoolean(g);if((this.cell)&&(this.cell.parentNode.idd==b)){this.editStop()}}},_getRowArray:function(h){var g=new Array();for(var f=0;f<h.childNodes.length;f++){var b=this.cells3(h,f);if(b.cell._code){g[f]=b.cell._val}else{g[f]=b.getValue()}}return g},setDateFormat:function(b){this._dtmask=b},setNumberFormat:function(n,g,k,m){var h=n.replace(/[^0\,\.]*/g,"");var b=h.indexOf(".");if(b>-1){b=h.length-b-1}var f=h.indexOf(",");if(f>-1){f=h.length-b-2-f}if(typeof k!="string"){k=this.i18n.group_separator}if(typeof m!="string"){m=this.i18n.decimal_separator}var o=n.split(h)[0];var l=n.split(h)[1];this._maskArr[g]=[b,f,o,l,k,m]},_aplNFb:function(h,g){var b=this._maskArr[g];if(!b){return h}var f=parseFloat(h.toString().replace(/[^0-9]*/g,""));if(h.toString().substr(0,1)=="-"){f=f*-1}if(b[0]>0){f=f/Math.pow(10,b[0])}return f},_aplNF:function(h,g){var b=this._maskArr[g];if(!b){return h}var k=(parseFloat(h)<0?"-":"")+b[2];h=Math.abs(Math.round(parseFloat(h)*Math.pow(10,b[0]>0?b[0]:0))).toString();h=(h.length<b[0]?Math.pow(10,b[0]+1-h.length).toString().substr(1,b[0]+1)+h.toString():h).split("").reverse();h[b[0]]=(h[b[0]]||"0")+b[4];if(b[1]>0){for(var f=(b[0]>0?0:1)+b[0]+b[1];f<h.length;f+=b[1]){h[f]+=b[5]}}return k+h.reverse().join("")+b[3]},_launchCommands:function(b){for(var h=0;h<b.length;h++){var g=new Array();for(var f=0;f<b[h].childNodes.length;f++){if(b[h].childNodes[f].nodeType==1){g[g.length]=b[h].childNodes[f].firstChild.data}}this[b[h].getAttribute("command")].apply(this,g)}},_parseHead:function(v){var l=this.xmlLoader.doXPath("//rows/head",v);if(l.length){var f=this.xmlLoader.doXPath("//rows/head/column",l[0]);var n=this.xmlLoader.doXPath("//rows/head/settings",l[0]);var o="setInitWidths";var r=false;if(n[0]){for(var w=0;w<n[0].childNodes.length;w++){switch(n[0].childNodes[w].tagName){case"colwidth":if(n[0].childNodes[w].firstChild&&n[0].childNodes[w].firstChild.data=="%"){o="setInitWidthsP"}break;case"splitat":r=(n[0].childNodes[w].firstChild?n[0].childNodes[w].firstChild.data:false);break}}}this._launchCommands(this.xmlLoader.doXPath("//rows/head/beforeInit/call",l[0]));if(f.length>0){var q=[[],[],[],[],[],[],[],[],[]];var t=["","width","type","align","sort","color","format","hidden","id"];var u=["setHeader",o,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var m=0;m<f.length;m++){for(var k=1;k<t.length;k++){q[k].push(f[m].getAttribute(t[k]))}q[0].push((f[m].firstChild?f[m].firstChild.data:"").replace(/^\s*((.|\n)*.+)\s*$/gi,"$1"))}for(var m=0;m<u.length;m++){if(u[m]){this[u[m]](q[m].join(this.delim))}}for(var m=0;m<f.length;m++){if((this.cellType[m].indexOf("co")==0)||(this.cellType[m]=="clist")){var h=this.xmlLoader.doXPath("./option",f[m]);if(h.length){var b=new Array();if(this.cellType[m]=="clist"){for(var k=0;k<h.length;k++){b[b.length]=h[k].firstChild?h[k].firstChild.data:""}this.registerCList(m,b)}else{var g=this.getCombo(m);for(var k=0;k<h.length;k++){g.put(h[k].getAttribute("value"),h[k].firstChild?h[k].firstChild.data:"")}}}}else{if(q[6][m]){if((this.cellType[m]=="calendar")||(this.fldSort[m]=="date")){this.setDateFormat(q[6][m],m)}else{this.setNumberFormat(q[6][m],m)}}}}this.init();if(this.setColHidden){this.setColHidden(q[7].join(this.delim))}if((r)&&(this.splitAt)){this.splitAt(r)}}this._launchCommands(this.xmlLoader.doXPath("//rows/head/afterInit/call",l[0]))}var p=this.xmlLoader.doXPath("//rows/userdata",v);if(p.length>0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var k=0;k<p.length;k++){this.UserData.gridglobaluserdata.put(p[k].getAttribute("name"),p[k].firstChild?p[k].firstChild.data:"")}}},getCheckedRows:function(b){var f=new Array();this.forEachRow(function(g){if(this.cells(g,b).getValue()!=0){f.push(g)}});return f.join(",")},_drawTooltip:function(h){var k=this.grid.getFirstParentOfType(h?h.target:event.srcElement,"TD");if((this.grid.editor)&&(this.grid.editor.cell==k)){return true}var g=k.parentNode;if(!g.idd||g.idd=="__filler__"){return}var f=(h?h.target:event.srcElement);if(g.idd==window.unknown){return true}if(!this.grid.callEvent("onMouseOver",[g.idd,k._cellIndex])){return true}if((this.grid._enbTts)&&(!this.grid._enbTts[k._cellIndex])){if(f.title){f.title=""}return true}if(k._cellIndex>=this.grid._cCount){return}var b=this.grid.cells(g.idd,k._cellIndex);if(!b){return}if(f._title){b.cell.title=""}if(!b.cell.title){f._title=true}if(b){f.title=b.cell.title||(b.getTitle?b.getTitle():(b.getValue()||"").toString().replace(/<[^>]*>/gi,""))}return true},enableCellWidthCorrection:function(b){if(_isFF){this._wcorr=parseInt(b)}},getAllRowIds:function(g){var b=[];for(var f=0;f<this.rowsBuffer.length;f++){b.push(this.rowsBuffer[f].idd)}return b.join(g||this.delim)},getAllItemIds:function(){return this.getAllRowIds()},setColspan:function(f,t,g){if(!this._ecspn){return}var b=this.getRowById(f);if((b._childIndexes)&&(b.childNodes[b._childIndexes[t]])){var l=b._childIndexes[t];var h=b.childNodes[l];var k=h.colSpan;h.colSpan=1;if((k)&&(k!=1)){for(var p=1;p<k;p++){var s=document.createElement("TD");if(h.nextSibling){b.insertBefore(s,h.nextSibling)}else{b.appendChild(s)}b._childIndexes[t+p]=l+p;s._cellIndex=t+p;s.align=this.cellAlign[p];s.style.verticalAlign=this.cellVAlign[p];h=s;this.cells3(b,l+p-1).setValue("")}}for(var q=t*1+1*k;q<b._childIndexes.length;q++){b._childIndexes[q]+=(k-1)*1}}if((g)&&(g>1)){if(b._childIndexes){var l=b._childIndexes[t]}else{var l=t;b._childIndexes=new Array();for(var q=0;q<b.childNodes.length;q++){b._childIndexes[q]=q}}b.childNodes[l].colSpan=g;for(var q=1;q<g;q++){b._childIndexes[b.childNodes[l+1]._cellIndex]=l;b.removeChild(b.childNodes[l+1])}var o=b.childNodes[b._childIndexes[t]]._cellIndex;for(var q=o*1+1*g;q<b._childIndexes.length;q++){b._childIndexes[q]-=(g-1)}}},preventIECaching:function(b){this.no_cashe=convertStringToBoolean(b);this.xmlLoader.rSeed=this.no_cashe},enableColumnAutoSize:function(b){this._eCAS=convertStringToBoolean(b)},_onHeaderDblClick:function(g){var f=this.grid;var b=f.getFirstParentOfType(_isIE?event.srcElement:g.target,"TD");if(!f._eCAS){return false}f.adjustColumnSize(b._cellIndexS)},adjustColumnSize:function(k,o){this._notresize=true;var b=0;this._setColumnSizeR(k,20);for(var h=1;h<this.hdr.rows.length;h++){var g=this.hdr.rows[h];g=g.childNodes[(g._childIndexes)?g._childIndexes[k]:k];if((g)&&((!g.colSpan)||(g.colSpan<2))){if((g.childNodes[0])&&(g.childNodes[0].className=="hdrcell")){g=g.childNodes[0]}b=Math.max(b,((_isFF||_isOpera)?(g.textContent.length*7):g.scrollWidth))}}var f=this.obj.rows.length;for(var n=1;n<f;n++){var p=this.obj.rows[n];if(p._childIndexes&&p._childIndexes[k]!=k||!p.childNodes[k]){continue}if(_isFF||_isOpera||o){p=p.childNodes[k].textContent.length*7}else{p=p.childNodes[k].scrollWidth}if(p>b){b=p}}b+=20+(o||0);this._setColumnSizeR(k,b);this._notresize=false;this.setSizes()},detachHeader:function(b,g){g=g||this.hdr;var f=g.rows[b+1];if(f){f.parentNode.removeChild(f)}this.setSizes()},detachFooter:function(b){this.detachHeader(b,this.ftr)},attachHeader:function(b,h,f){if(typeof(b)=="string"){b=this._eSplit(b)}if(typeof(h)=="string"){h=h.split(this.delim)}f=f||"_aHead";if(this.hdr.rows.length){if(b){this._createHRow([b,h],this[(f=="_aHead")?"hdr":"ftr"])}else{if(this[f]){for(var g=0;g<this[f].length;g++){this.attachHeader.apply(this,this[f][g])}}}}else{if(!this[f]){this[f]=new Array()}this[f][this[f].length]=[b,h,f]}},_createHRow:function(g,p){if(!p){this.entBox.style.position="relative";var m=document.createElement("DIV");m.className="c_ftr".substr(2);this.entBox.appendChild(m);var s=document.createElement("TABLE");s.cellPadding=s.cellSpacing=0;if(!_isIE){s.width="100%";s.style.paddingRight="20px"}s.style.tableLayout="fixed";m.appendChild(s);s.appendChild(document.createElement("TBODY"));this.ftr=p=s;var l=s.insertRow(0);var b=((this.hdrLabels.length<=1)?g[0].length:this.hdrLabels.length);for(var h=0;h<b;h++){l.appendChild(document.createElement("TH"));l.childNodes[h]._cellIndex=h}if(_isIE){l.style.position="absolute"}else{l.style.height="auto"}}var k=g[1];var m=document.createElement("TR");p.rows[0].parentNode.appendChild(m);for(var h=0;h<g[0].length;h++){if(g[0][h]=="#cspan"){var n=m.cells[m.cells.length-1];n.colSpan=(n.colSpan||1)+1;continue}if((g[0][h]=="#rspan")&&(p.rows.length>1)){var v=p.rows.length-2;var u=false;var n=null;while(!u){var n=p.rows[v];for(var f=0;f<n.cells.length;f++){if(n.cells[f]._cellIndex==h){u=f+1;break}}v--}n=n.cells[u-1];n.rowSpan=(n.rowSpan||1)+1;continue}var o=document.createElement("TD");o._cellIndex=o._cellIndexS=h;if(this.forceDivInHeader){o.innerHTML="<div class='hdrcell'>"+g[0][h]+"</div>"}else{o.innerHTML=g[0][h]}if((g[0][h]||"").indexOf("#")!=-1){var s=g[0][h].match(/(^|{)#([^}]+)(}|$)/);if(s){var q="_in_header_"+s[2];if(this[q]){this[q]((this.forceDivInHeader?o.firstChild:o),h,g[0][h].split(s[0]))}}}if(k){o.style.cssText=k[h]}m.appendChild(o)}var r=p;if(_isKHTML){if(p._kTimer){window.clearTimeout(p._kTimer)}p._kTimer=window.setTimeout(function(){p.rows[1].style.display="none";window.setTimeout(function(){p.rows[1].style.display=""},1)},500)}},attachFooter:function(b,f){this.attachHeader(b,f,"_aFoot")},setCellExcellType:function(g,b,f){this.changeCellType(this.rowsAr[g],b,f)},changeCellType:function(g,h,f){f=f||this.cellType[h];var k=this.cells3(g,h);var b=k.getValue();k.cell._cellType=f;var k=this.cells3(g,h);k.setValue(b)},setRowExcellType:function(g,f){var h=this.rowsAr[g];for(var b=0;b<h.childNodes.length;b++){this.changeCellType(h,b,f)}},setColumnExcellType:function(b,g){for(var f=0;f<this.rowsCol.length;f++){this.changeCellType(this.rowsCol[f],b,g)}},dhx_Event:function(){this.dhx_SeverCatcherPath="";this.attachEvent=function(original,catcher,CallObj){CallObj=CallObj||this;original="ev_"+original;if((!this[original])||(!this[original].addEvent)){var z=new this.eventCatcher(CallObj);z.addEvent(this[original]);this[original]=z}return(original+":"+this[original].addEvent(catcher))};this.callEvent=function(name,arg0){if(this["ev_"+name]){return this["ev_"+name].apply(this,arg0)}return true};this.checkEvent=function(name){if(this["ev_"+name]){return true}return false};this.eventCatcher=function(obj){var dhx_catch=new Array();var m_obj=obj;var z=function(){if(dhx_catch){var res=true}for(var i=0;i<dhx_catch.length;i++){if(dhx_catch[i]!=null){var zr=dhx_catch[i].apply(m_obj,arguments);res=res&&zr}}return res};z.addEvent=function(ev){if(typeof(ev)!="function"){ev=eval(ev)}if(ev){return dhx_catch.push(ev)-1}return false};z.removeEvent=function(id){dhx_catch[id]=null};return z};this.detachEvent=function(id){if(id!=false){var list=id.split(":");this[list[0]].removeEvent(list[1])}}},forEachRow:function(b){for(a in this.rowsAr){if(this.rowsAr[a]&&this.rowsAr[a].idd){b.apply(this,[this.rowsAr[a].idd])}}},forEachCell:function(g,f){var h=this.rowsAr[g];if(!h){return}for(var b=0;b<this._cCount;b++){f(this.cells3(h,b),b)}},enableAutoWidth:function(g,b,f){this._awdth=[convertStringToBoolean(g),(b||99999),(f||0)]},updateFromXML:function(b,h,f,g){if(typeof h=="undefined"){h=true}this._refresh_mode=[true,h,f];if(g){this.xmlLoader.waitCall=g}this.callEvent("onXLS",[this]);this.xmlLoader.loadXML(b)},_refreshFromXML:function(h){if(window.eXcell_tree){eXcell_tree.prototype.setValueX=eXcell_tree.prototype.setValue;eXcell_tree.prototype.setValue=function(o){if(this.grid._h2.get[this.cell.parentNode.idd]){this.setLabel(o[1]);if(o[3]){this.setImage(o[3])}}else{this.setValueX(o)}}}var b=this.cellType._dhx_find("tree");var g=h.doXPath("//rows")[0].getAttribute("parent")||0;var f={};if(this._refresh_mode[2]){if(b!=-1){this._h2.forEachChild(g,function(o){f[o.id]=true},this)}else{this.forEachRow(function(o){f[o]=true})}}var l=h.doXPath("//row");for(var k=0;k<l.length;k++){var m=l[k];var n=m.getAttribute("id");f[n]=false;var g=m.parentNode.getAttribute("id")||g;if(this.rowsAr[n]&&this.rowsAr[n].tagName!="TR"){this.rowsAr[n].data=m}else{if(this.rowsAr[n]){this._process_xml_row(this.rowsAr[n],m,-1);this._postRowProcessing(this.rowsAr[n])}else{if(this._refresh_mode[1]){this.rowsBuffer.push({idd:n,data:m,_parser:this._process_xml_row,_locator:this._get_xml_data});this.rowsAr[n]=m;m=this.render_row(this.rowsBuffer.length-1);this._insertRowAt(m,-1)}}}}if(this._refresh_mode[2]){for(n in f){if(f[n]&&this.rowsAr[n]){this.deleteRow(n)}}}this._refresh_mode=null;if(window.eXcell_tree){eXcell_tree.prototype.setValue=eXcell_tree.prototype.setValueX}this.callEvent("onXLE",[this,l.length])},getCustomCombo:function(g,f){var b=this.cells(g,f).cell;if(!b._combo){b._combo=new dhtmlXGridComboObject()}return b._combo},setTabOrder:function(b){var g=b.split(this.delim);this._tabOrder=[];for(var f=0;f<this._cCount;f++){g[f]={c:parseInt(g[f]),ind:f}}g.sort(function(k,h){return(k.c>h.c?1:-1)});for(var f=0;f<this._cCount;f++){if(!g[f+1]||(typeof g[f].c=="undefined")){this._tabOrder[g[f].ind]=(g[0].ind+1)*-1}else{this._tabOrder[g[f].ind]=g[f+1].ind}}},i18n:{loading:"Loading",decimal_separator:".",group_separator:","},_key_events:{k13_1_0:function(){var b=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[b+1],this.cell._cellIndex,true)},k13_0_1:function(){var b=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[b-1],this.cell._cellIndex,true)},k13_0_0:function(){this.editStop();this.callEvent("onEnter",[(this.row?this.row.idd:null),(this.cell?this.cell._cellIndex:null)])},k9_0_0:function(){this.editStop();var b=this._getNextCell(null,1);if(b){this.selectCell(b.parentNode,b._cellIndex,(this.row!=b.parentNode),false,true);this._still_active=true}},k9_0_1:function(){this.editStop();var b=this._getNextCell(null,-1);if(b){this.selectCell(b.parentNode,b._cellIndex,(this.row!=b.parentNode),false,true);this._still_active=true}},k113_0_0:function(){if(this._f2kE){this.editCell()}},k32_0_0:function(){var b=this.cells4(this.cell);if(!b.changeState||(b.changeState()===false)){return false}},k27_0_0:function(){this.editStop(true)},k33_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage-1)}else{this.scrollPage(-1)}},k34_0_0:function(){if(this.pagingOn){this.changePage(this.currentPage+1)}else{this.scrollPage(1)}},k37_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.collapseKids(this.row)}else{return false}},k39_0_0:function(){if(!this.editor&&this.isTreeGrid()){this.expandKids(this.row)}else{return false}},k40_0_0:function(){if(this.editor&&this.editor.combo){this.editor.shiftNext()}else{var b=this.rowsCol._dhx_find(this.row)+1;if(b!=this.rowsCol.length&&b!=this.obj.rows.length-1){var f=this._nextRow(b-1,1);this.selectCell(f,this.cell._cellIndex,true)}else{this._key_events.k34_0_0.apply(this,[]);if(this.pagingOn&&this.rowsCol[0]){this.selectCell(0,0,true)}}}},k38_0_0:function(){if(this.editor&&this.editor.combo){this.editor.shiftPrev()}else{var b=this.rowsCol._dhx_find(this.row)+1;if(b!=-1&&(!this.pagingOn||(b!=1))){var f=this._nextRow(b-1,-1);this.selectCell(f,this.cell._cellIndex,true)}else{this._key_events.k33_0_0.apply(this,[]);if(this.pagingOn&&this.rowsCol[this.rowsBufferOutSize-1]){this.selectCell(this.rowsBufferOutSize-1,0,true)}}}}},_build_master_row:function(){var g=document.createElement("DIV");var f=["<table><tr>"];for(var b=0;b<this._cCount;b++){f.push("<td></td>")}f.push("</tr></table>");g.innerHTML=f.join("");this._master_row=g.firstChild.rows[0]},_prepareRow:function(b){if(!this._master_row){this._build_master_row()}var g=this._master_row.cloneNode(true);for(var f=0;f<g.childNodes.length;f++){g.childNodes[f]._cellIndex=f;if(this.dragAndDropOff){this.dragger.addDraggableItem(g.childNodes[f],this)}}g.idd=b;g.grid=this;return g},_process_jsarray_row:function(f,g){f._attrs={};for(var b=0;b<f.childNodes.length;b++){f.childNodes[b]._attrs={}}this._fillRow(f,(this._c_order?this._swapColumns(g):g));return f},_get_jsarray_data:function(f,b){return f[b]},_process_json_row:function(f,g){f._attrs={};for(var b=0;b<f.childNodes.length;b++){f.childNodes[b]._attrs={}}this._fillRow(f,(this._c_order?this._swapColumns(g.data):g.data));return f},_get_json_data:function(f,b){return f.data[b]},_process_csv_row:function(f,g){f._attrs={};for(var b=0;b<f.childNodes.length;b++){f.childNodes[b]._attrs={}}this._fillRow(f,(this._c_order?this._swapColumns(g.split(this.csv.cell)):g.split(this.csv.cell)));return f},_get_csv_data:function(f,b){return f.split(this.csv.cell)[b]},_process_xml_row:function(b,k){var o=this.xmlLoader.doXPath("./cell",k);var m=[];b._attrs=this._xml_attrs(k);if(this._ud_enabled){var n=this.xmlLoader.doXPath("./userdata",k);for(var g=n.length-1;g>=0;g--){this.setUserData(b.idd,n[g].getAttribute("name"),n[g].firstChild?n[g].firstChild.data:"")}}for(var f=0;f<o.length;f++){var h=o[f];var l=h.getAttribute("type");if(b.childNodes[f]){if(l){b.childNodes[f]._cellType=l}b.childNodes[f]._attrs=this._xml_attrs(o[f])}if(h.getAttribute("xmlcontent")){h=o[f]}else{if(h.firstChild){h=h.firstChild.data}else{h=""}}m.push(h)}for(f<o.length;f<b.childNodes.length;f++){b.childNodes[f]._attrs={}}if(b.parentNode&&b.parentNode.tagName=="row"){b._attrs.parent=b.parentNode.getAttribute("idd")}this._fillRow(b,(this._c_order?this._swapColumns(m):m));return b},_get_xml_data:function(f,b){f=f.firstChild;while(true){if(!f){return""}if(f.tagName=="cell"){b--}if(b<0){break}f=f.nextSibling}return(f.firstChild?f.firstChild.data:"")},_fillRow:function(g,k){if(this.editor){this.editStop()}for(var f=0;f<g.childNodes.length;f++){if((f<k.length)||(this.defVal[f])){var h=k[f];var b=this.cells5(g.childNodes[f],(g.childNodes[f]._cellType||this.cellType[f]));if((this.defVal[f])&&((h=="")||(typeof(h)=="undefined"))){h=this.defVal[f]}b.setValue(h)}else{var h="&nbsp;";g.childNodes[f].innerHTML=h;g.childNodes[f]._clearCell=true}}return g},_postRowProcessing:function(h){if(h._attrs["class"]){h.className=h._attrs["class"]}if(h._attrs.locked){h._locked=true}if(h._attrs.bgColor){h.bgColor=h._attrs.bgColor}var k=0;for(var f=0;f<h.childNodes.length;f++){c=h.childNodes[f+k];var g=c._attrs.style||h._attrs.style;if(g){c.style.cssText+=";"+g}if(c._attrs["class"]){c.className=c._attrs["class"]}g=c._attrs.align||this.cellAlign[f];if(g){c.align=g}c.style.verticalAlign=c._attrs.valign||this.cellVAlign[f];var b=c._attrs.bgColor||this.columnColor[f];if(b){c.bgColor=b}if(c._attrs.colspan){this.setColspan(h.idd,f,c._attrs.colspan);k+=(1-c._attrs.colspan);f-=(1-c._attrs.colspan)}if(this._hrrar&&this._hrrar[f]){c.style.display="none"}}this.callEvent("onRowCreated",[h.idd,h,null])},load:function(b,g,f){this.callEvent("onXLS",[this]);if(arguments.length==2&&typeof g!="function"){f=g;g=null}f=f||"xml";if(!this.xmlFileUrl){this.xmlFileUrl=b}this._data_type=f;this.xmlLoader.onloadAction=function(l,h,n,m,k){l["_process_"+f](k);l.callEvent("onXLE",[]);if(g){g();g=null}};this.xmlLoader.loadXML(b)},loadXMLString:function(g,f){var b=new dtmlXMLLoaderObject(function(){});b.loadXMLString(g);this.parse(b,f,"xml")},loadXML:function(b,f){this.load(b,f,"xml")},parse:function(g,f,b){if(arguments.length==2&&typeof f!="function"){b=f;f=null}b=b||"xml";this._data_type=b;this["_process_"+b](g);this.callEvent("onXLE",[]);if(f){f()}},xml:{top:"rows",row:"./row",cell:"./cell",s_row:"row",s_cell:"cell",row_attrs:[],cell_attrs:[]},csv:{row:"\n",cell:","},_xml_attrs:function(f){var g={};if(f.attributes.length){for(var b=0;b<f.attributes.length;b++){g[f.attributes[b].name]=f.attributes[b].value}}return g},_process_xml:function(b){if(this._refresh_mode){return this._refreshFromXML(b)}if(!b.doXPath){var g=new dtmlXMLLoaderObject(function(){});if(typeof b=="string"){g.loadXMLString(b)}else{g.xmlDoc=b;b.responseXML=b}b=g}this._parsing=true;var m=b.getXMLTopNode(this.xml.top);this._parseHead(m);var l=b.doXPath(this.xml.row,m);var k=parseInt(b.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0);var h=parseInt(b.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0);if(h&&!this.rowsBuffer[h-1]){this.rowsBuffer[h-1]=null}if(this.isTreeGrid()){return this._process_tree_xml(b)}for(var f=0;f<l.length;f++){if(this.rowsBuffer[f+k]){continue}var n=l[f].getAttribute("id");this.rowsBuffer[f+k]={idd:n,data:l[f],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[n]=l[f]}this.render_dataset();this._parsing=false},_process_jsarray:function(data){this._parsing=true;if(data&&data.xmlDoc){eval("data="+data.xmlDoc.responseText+";")}for(var i=0;i<data.length;i++){var id=i+1;this.rowsBuffer.push({idd:id,data:data[i],_parser:this._process_jsarray_row,_locator:this._get_jsarray_data});this.rowsAr[id]=data[i]}this.render_dataset();this._parsing=false},_process_csv:function(g){this._parsing=true;if(g.xmlDoc){g=g.xmlDoc.responseText}g=g.replace(/\r/g,"");g=g.split(this.csv.row);if(this._csvHdr){this.clearAll();this.setHeader(g.splice(0,1).split(this.csv.cell).join(this.delim));this.init()}for(var f=0;f<g.length;f++){if(this._csvAID){var h=f+1;this.rowsBuffer.push({idd:h,data:g[f],_parser:this._process_csv_row,_locator:this._get_csv_data})}else{var b=g[f].split(this.csv.cell);var h=b.splice(0,1)[0];this.rowsBuffer.push({idd:h,data:b,_parser:this._process_jsarray_row,_locator:this._get_jsarray_data})}this.rowsAr[h]=g[f]}this.render_dataset();this._parsing=false},_process_json:function(data){this._parsing=true;if(data&&data.xmlDoc){eval("data="+data.xmlDoc.responseText+";")}for(var i=0;i<data.rows.length;i++){var id=data.rows[i].id;this.rowsBuffer.push({idd:id,data:data.rows[i],_parser:this._process_json_row,_locator:this._get_json_data});this.rowsAr[id]=data[i]}this.render_dataset();this._parsing=false},render_dataset:function(g,b){if(this._srnd){if(this._fillers){return this._update_srnd_view()}b=Math.min(this._get_view_size(),this.rowsBuffer.length)}if(this.pagingOn){g=(this.currentPage-1)*this.rowsBufferOutSize;b=Math.min(g+this.rowsBufferOutSize,this.rowsBuffer.length)}else{g=g||0;b=b||this.rowsBuffer.length}for(var f=g;f<b;f++){var k=this.render_row(f);if(k==-1){if(this.xmlFileUrl){this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+f+"&count="+(this._dpref?this._dpref:(b-f)),this._data_type)}b=f;break}if(!k.parentNode||!k.parentNode.tagName){this._insertRowAt(k,f);if(k._attrs.selected){this.selectRow(k,false,true);delete k._attrs.selected}}if(this._ads_count&&f-g==this._ads_count){var h=this;return this._contextCallTimer=window.setTimeout(function(){h.render_dataset(f,b)},this._ads_time)}}if(this._srnd&&!this._fillers){this._fillers=[this._add_filler(b,this.rowsBuffer.length-b)]}this.setSizes()},render_row:function(f){if(!this.rowsBuffer[f]){return -1}if(this.rowsBuffer[f]._parser){var b=this.rowsBuffer[f];var g=this._prepareRow(b.idd);this.rowsBuffer[f]=g;this.rowsAr[b.idd]=g;b._parser.call(this,g,b.data);this._postRowProcessing(g);return g}return this.rowsBuffer[f]},_get_cell_value:function(f,b,g){if(f._locator){if(this._c_order){b=this._c_order[b]}return f._locator.call(this,f.data,b)}return this.cells3(f,b)[g?g:"getValue"]()},sortRows:function(g,l,f){if(this.isTreeGrid()){return this.sortTreeRows(g,l,f)}f=(f||"asc").toLowerCase();l=(l||this.fldSort[g]);g=g||0;var b={};var k=this.cellType[g];var m="getValue";if(k=="link"){m="getContent"}if(k=="dhxCalendar"||k=="dhxCalendarA"){m="getDate"}for(var h=0;h<this.rowsBuffer.length;h++){b[this.rowsBuffer[h].idd]=this._get_cell_value(this.rowsBuffer[h],g,m)}this._sortRows(g,l,f,b)},_sortCore:function(g,l,f,b,k){var h="sort";if(this._sst){k.stablesort=this.rowsCol.stablesort;h="stablesort"}if(l.length>4){l=window[l]}if(l=="cus"){var m=this._customSorts[g];k[h](function(o,n){return m(b[o.idd],b[n.idd],f,o.idd,n.idd)})}else{if(typeof(l)=="function"){k[h](function(o,n){return l(b[o.idd],b[n.idd],f,o.idd,n.idd)})}else{if(l=="str"){k[h](function(o,n){if(f=="asc"){return b[o.idd].toLowerCase()>b[n.idd].toLowerCase()?1:-1}else{return b[o.idd].toLowerCase()<b[n.idd].toLowerCase()?1:-1}})}else{if(l=="int"){k[h](function(p,o){var n=parseFloat(b[p.idd]);n=isNaN(n)?-99999999999999:n;var q=parseFloat(b[o.idd]);q=isNaN(q)?-99999999999999:q;if(f=="asc"){return n-q}else{return q-n}})}else{if(l=="date"){k[h](function(p,o){var r=b[p.idd].split("-");var t=(r[0]+"/"+r[1]+"/"+r[2]);var q=b[o.idd].split("-");var u=(q[0]+"/"+q[1]+"/"+q[2]);var n=Date.parse(t)||(Date.parse("01/01/1900"));var s=Date.parse(u)||(Date.parse("01/01/1900"));if(f=="asc"){return n-s}else{return s-n}})}else{if(l=="days"){k[h](function(p,o){var n=getWeekdayIndex(b[p.idd]);var q=getWeekdayIndex(b[o.idd]);if(f=="asc"){return n-q}else{return q-n}})}else{if(l=="snum"){k[h](function(p,o){var r=b[p.idd].split("-");var t=r[1];var q=b[o.idd].split("-");var u=q[1];var n=parseFloat(t);n=isNaN(n)?-99999999999999:n;var s=parseFloat(u);s=isNaN(s)?-99999999999999:s;if(f=="asc"){return n-s}else{return s-n}})}}}}}}}},_sortRows:function(g,h,f,b){this._sortCore(g,h,f,b,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(g){var b=this.obj.rows[0].parentNode;var h=b.removeChild(b.childNodes[0],true);if(_isKHTML){for(var f=b.parentNode.childNodes.length-1;f>=0;f--){if(b.parentNode.childNodes[f].tagName=="TR"){b.parentNode.removeChild(b.parentNode.childNodes[f],true)}}}else{if(_isIE){for(var f=b.childNodes.length-1;f>=0;f--){b.childNodes[f].removeNode(true)}}else{b.innerHTML=""}}b.appendChild(h);this.rowsCol=dhtmlxArray();this._fillers=this.undefined;if(!g){this.render_dataset()}},deleteRow:function(b,h){if(!h){h=this.getRowById(b)}if(!h){return}this.editStop();if(this.callEvent("onBeforeRowDeleted",[b])==false){return false}if(this.cellType._dhx_find("tree")!=-1){this._removeTrGrRow(h)}else{if(h.parentNode){h.parentNode.removeChild(h)}var l=this.rowsCol._dhx_find(h);if(l!=-1){this.rowsCol._dhx_removeAt(l)}for(var g=0;g<this.rowsBuffer.length;g++){if(this.rowsBuffer[g]&&this.rowsBuffer[g].idd==b){this.rowsBuffer._dhx_removeAt(g);l=g;break}}}this.rowsAr[b]=null;for(var g=0;g<this.selectedRows.length;g++){if(this.selectedRows[g].idd==b){this.selectedRows._dhx_removeAt(g)}}if(this._srnd){for(var g=0;g<this._fillers.length;g++){var k=this._fillers[g];if(k[0]>=l){k[0]=k[0]-1}else{if(k[1]>=l){k[1]=k[1]-1}}}this._update_srnd_view()}if(this.pagingOn){this.changePage()}this.callEvent("onGridReconstructed",[]);return true},_addRow:function(b,o,m){if(m==-1||typeof m=="undefined"){m=this.rowsBuffer.length}if(typeof o=="string"){o=o.split(this.delim)}var n=this._prepareRow(b);n._attrs={};for(var g=0;g<n.childNodes.length;g++){n.childNodes[g]._attrs={}}this._fillRow(n,o);this._postRowProcessing(n);if(this._skipInsert){this._skipInsert=false;return this.rowsAr[n.idd]=n}if(this.pagingOn){this.rowsBuffer._dhx_insertAt(m,n);this.rowsAr[n.idd]=n;return n}if(this._fillers){this.rowsCol._dhx_insertAt(m,null);this.rowsBuffer._dhx_insertAt(m,n);this.rowsAr[n.idd]=n;var l=false;for(var h=0;h<this._fillers.length;h++){var k=this._fillers[h];if(k&&k[0]<=m&&(k[0]+k[1])>=m){k[1]=k[1]+1;l=true}if(k&&k[0]>=m){k[0]=k[0]+1}}if(!l){this._fillers.push(this._add_filler(m,1,(m==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:(this.rowsCol[1])}:this.rowsCol[m-1])))}return n}this.rowsBuffer._dhx_insertAt(m,n);return this._insertRowAt(n,m)},addRow:function(b,h,g){var f=this._addRow(b,h,g);if(!this.dragContext){this.callEvent("onRowAdded",[b])}if(this.pagingOn){this.changePage(this.currentPage)}if(this._srnd){this._update_srnd_view()}f._added=true;if(this._ahgr){this.setSizes()}this.callEvent("onGridReconstructed",[]);return f},_insertRowAt:function(f,g,b){this.rowsAr[f.idd]=f;if(this._skipInsert){this._skipInsert=false;return f}if((g<0)||((!g)&&(parseInt(g)!==0))){g=this.rowsCol.length}else{if(g>this.rowsCol.length){g=this.rowsCol.length}}if(this._cssEven){if((this._cssSP?this.getLevel(f.idd):g)%2==1){f.className+=" "+this._cssUnEven+(this._cssSU?(this._cssUnEven+"_"+this.getLevel(f.idd)):"")}else{f.className+=" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(f.idd)):"")}}if(!b){if((g==(this.obj.rows.length-1))||(!this.rowsCol[g])){if(_isKHTML){this.obj.appendChild(f)}else{this.obj.firstChild.appendChild(f)}}else{this.rowsCol[g].parentNode.insertBefore(f,this.rowsCol[g])}}this.rowsCol._dhx_insertAt(g,f);return f},getRowById:function(g){var f=this.rowsAr[g];if(f){if(f.tagName!="TR"){for(var b=0;b<this.rowsBuffer.length;b++){if(this.rowsBuffer[b].idd==g){return this.render_row(b)}}if(this._h2){return this.render_row(null,f.idd)}}return f}return null},cellById:function(f,b){return this.cells(f,b)},cells:function(g,f){if(arguments.length==0){return this.cells4(this.cell)}else{var h=this.getRowById(g)}var b=(h._childIndexes?h.childNodes[h._childIndexes[f]]:h.childNodes[f]);return this.cells4(b)},cellByIndex:function(f,b){return this.cells2(f,b)},cells2:function(g,f){var h=this.rowsCol[parseInt(g)];var b=(h._childIndexes?h.childNodes[h._childIndexes[f]]:h.childNodes[f]);return this.cells4(b)},cells3:function(g,f){var b=(g._childIndexes?g.childNodes[g._childIndexes[f]]:g.childNodes[f]);return this.cells4(b)},cells4:function(b){var f=window["eXcell_"+(b._cellType||this.cellType[b._cellIndex])];if(f){return new f(b)}},cells5:function(b,g){var g=g||(b._cellType||this.cellType[b._cellIndex]);if(!this._ecache[g]){if(!window["eXcell_"+g]){var f=eXcell_ro}else{var f=window["eXcell_"+g]}this._ecache[g]=new f(b)}this._ecache[g].cell=b;return this._ecache[g]},dma:function(b){if(!this._ecache){this._ecache={}}if(b&&!this._dma){this._dma=this.cells4;this.cells4=this.cells5}else{if(!b&&this._dma){this.cells4=this._dma;this._dma=null}}},getRowsNum:function(){return this.rowsBuffer.length},enableEditTabOnly:function(b){if(arguments.length>0){this.smartTabOrder=convertStringToBoolean(b)}else{this.smartTabOrder=true}},setExternalTabOrder:function(g,b){var f=this;this.tabStart=(typeof(g)=="object")?g:document.getElementById(g);this.tabStart.onkeydown=function(k){var h=(k||window.event);h.cancelBubble=true;if(h.keyCode==9){f.selectCell(0,0,0,0,1);if(f.cells2(0,0).isDisabled()){f._key_events.k9_0_0.call(f)}return false}};this.tabEnd=(typeof(b)=="object")?b:document.getElementById(b);this.tabEnd.onkeydown=function(k){var h=(k||window.event);h.cancelBubble=true;if((h.keyCode==9)&&h.shiftKey){f.selectCell((f.getRowsNum()-1),(f.getColumnCount()-1),0,0,1);if(f.cells2((f.getRowsNum()-1),(f.getColumnCount()-1)).isDisabled()){f._key_events.k9_0_1.call(f)}return false}}},uid:function(){if(!this._ui_seed){this._ui_seed=(new Date()).valueOf()}return this._ui_seed++},clearAndLoad:function(){var b=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=b;this.load.apply(this,arguments)},getStateOfView:function(){if(this.pagingOn){return[this.currentPage,(this.currentPage-1)*this.rowsBufferOutSize,(this.currentPage-1)*this.rowsBufferOutSize+this.rowsCol.length,this.rowsBuffer.length]}return[Math.floor(this.objBox.scrollTop/this._srdh),Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),this.limit]}};function dhtmlXGridCellObject(b){this.destructor=function(){this.cell.obj=null;this.cell=null;this.grid=null;this.base=null;return null};this.cell=b;this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}else{return this.cell.innerHTML._dhx_trim()}};this.getMathValue=function(){if(this.cell._val){return this.cell._val}else{return this.getValue()}};this.getFont=function(){arOut=new Array(3);if(this.cell.style.fontFamily){arOut[0]=this.cell.style.fontFamily}if(this.cell.style.fontWeight=="bold"||this.cell.parentNode.style.fontWeight=="bold"){arOut[1]="bold"}if(this.cell.style.fontStyle=="italic"||this.cell.parentNode.style.fontWeight=="italic"){arOut[1]+="italic"}if(this.cell.style.fontSize){arOut[2]=this.cell.style.fontSize}else{arOut[2]=""}return arOut.join("-")};this.getTextColor=function(){if(this.cell.style.color){return this.cell.style.color}else{return"#000000"}};this.getBgColor=function(){if(this.cell.bgColor){return this.cell.bgColor}else{return"#FFFFFF"}};this.getHorAlign=function(){if(this.cell.style.textAlign){return this.cell.style.textAlign}else{if(this.cell.align){return this.cell.align}else{return"left"}}};this.getWidth=function(){return this.cell.scrollWidth};this.setFont=function(f){fntAr=f.split("-");this.cell.style.fontFamily=fntAr[0];this.cell.style.fontSize=fntAr[fntAr.length-1];if(fntAr.length==3){if(/bold/.test(fntAr[1])){this.cell.style.fontWeight="bold"}if(/italic/.test(fntAr[1])){this.cell.style.fontStyle="italic"}if(/underline/.test(fntAr[1])){this.cell.style.textDecoration="underline"}}};this.setTextColor=function(f){this.cell.style.color=f};this.setBgColor=function(f){if(f==""){f=null}this.cell.bgColor=f};this.setHorAlign=function(f){if(f.length==1){if(f=="c"){this.cell.style.textAlign="center"}else{if(f=="l"){this.cell.style.textAlign="left"}else{this.cell.style.textAlign="right"}}}else{this.cell.style.textAlign=f}};this.wasChanged=function(){if(this.cell.wasChanged){return true}else{return false}};this.isCheckbox=function(){var f=this.cell.firstChild;if(f&&f.tagName=="INPUT"){type=f.type;if(type=="radio"||type=="checkbox"){return true}else{return false}}else{return false}};this.isChecked=function(){if(this.isCheckbox()){return this.cell.firstChild.checked}};this.isDisabled=function(){return this.cell._disabled};this.setChecked=function(f){if(this.isCheckbox()){if(f!="true"&&f!=1){f=false}this.cell.firstChild.checked=f}};this.setDisabled=function(f){if(f!="true"&&f!=1){f=false}if(this.isCheckbox()){this.cell.firstChild.disabled=f;if(this.disabledF){this.disabledF(f)}}this.cell._disabled=f}}dhtmlXGridCellObject.prototype={getAttribute:function(b){return this.cell._attrs[b]},setAttribute:function(b,f){this.cell._attrs[b]=f}};dhtmlXGridCellObject.prototype.setValue=function(b){if((typeof(b)!="number")&&(!b||b.toString()._dhx_trim()=="")){b="&nbsp;";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCValue(b)};dhtmlXGridCellObject.prototype.getTitle=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};dhtmlXGridCellObject.prototype.setCValue=function(f,b){this.cell.innerHTML=f;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,(arguments.length>1?b:f)])};dhtmlXGridCellObject.prototype.setCTxtValue=function(b){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(b));this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,b])};dhtmlXGridCellObject.prototype.setLabel=function(b){this.cell.innerHTML=b};dhtmlXGridCellObject.prototype.getMath=function(){if(this._val){return this.val}else{return this.getValue()}};function eXcell(){this.obj=null;this.val=null;this.changeState=function(){return false};this.edit=function(){this.val=this.getValue()};this.detach=function(){return false};this.getPosition=function(h){var b=h;var g=0;var f=0;while(b.tagName!="BODY"){g+=b.offsetLeft;f+=b.offsetTop;b=b.offsetParent}return new Array(g,f)}}eXcell.prototype=new dhtmlXGridCellObject;function eXcell_ed(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.atag=((!this.grid.multiLine)&&(_isKHTML||_isMacOS||_isFF))?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:2))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(f){(f||event).cancelBubble=true};this.obj.onmousedown=function(f){(f||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);if(_isFF){this.obj.style.overflow="visible";if((this.grid.multiLine)&&(this.obj.offsetHeight>=18)&&(this.obj.offsetHeight<40)){this.obj.style.height="36px";this.obj.style.overflow="scroll"}}this.obj.onselectstart=function(f){if(!f){f=event}f.cancelBubble=true;return true};this.obj.focus();this.obj.focus()};this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell.innerHTML.toString()._dhx_trim()};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_ed.prototype=new eXcell;function eXcell_edtxt(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(f){if(!f||f.toString()._dhx_trim()==""){f=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(f)}}eXcell_edtxt.prototype=new eXcell_ed;function eXcell_edn(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)};this.detach=function(){var f=this.obj.value;this.setValue(f);return this.val!=this.getValue()}}eXcell_edn.prototype=new eXcell_ed;eXcell_edn.prototype.setValue=function(b){if(!b||b.toString()._dhx_trim()==""){b="0";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCValue(this.grid._aplNF(b,this.cell._cellIndex))};function eXcell_ch(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid;this.cell.obj=this}this.disabledF=function(f){if((f==true)||(f==1)){this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0.","item_chk0_dis.").replace("item_chk1.","item_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0_dis.","item_chk0.").replace("item_chk1_dis.","item_chk1.")}};this.changeState=function(){if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){return this.cell.chstate?this.cell.chstate.toString():"0"};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(f){this.setValue(f.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell;eXcell_ch.prototype.setValue=function(f){this.cell.style.verticalAlign="middle";if(f){f=f.toString()._dhx_trim();if((f=="false")||(f=="0")){f=""}}if(f){f="1";this.cell.chstate="1"}else{f="0";this.cell.chstate="0"}var b=this;this.setCValue("<img src='"+this.grid.imgURL+"item_chk"+f+".gif' onclick='new eXcell_ch(this.parentNode).changeState();(arguments[0]||event).cancelBubble=true;'>",this.cell.chstate)};function eXcell_ra(b){this.base=eXcell_ch;this.base(b);this.grid=b.parentNode.grid;this.disabledF=function(f){if((f==true)||(f==1)){this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0.","radio_chk0_dis.").replace("radio_chk1.","radio_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0_dis.","radio_chk0.").replace("radio_chk1_dis.","radio_chk1.")}};this.changeState=function(){if((!this.grid.isEditable)||(this.cell.parentNode._locked)){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.edit=null}eXcell_ra.prototype=new eXcell_ch;eXcell_ra.prototype.setValue=function(g){this.cell.style.verticalAlign="middle";if(g){g=g.toString()._dhx_trim();if((g=="false")||(g=="0")){g=""}}if(g){if(!this.grid._RaSeCol){this.grid._RaSeCol=[]}if(this.grid._RaSeCol[this.cell._cellIndex]){var f=this.grid.cells4(this.grid._RaSeCol[this.cell._cellIndex]);f.setValue("0");if(this.grid.rowsAr[f.cell.parentNode.idd]){this.grid.callEvent("onEditCell",[1,f.cell.parentNode.idd,f.cell._cellIndex])}}this.grid._RaSeCol[this.cell._cellIndex]=this.cell;g="1";this.cell.chstate="1"}else{g="0";this.cell.chstate="0"}var b=this;this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+g+".gif' onclick='this.parentNode.obj.changeState()'>",this.cell.chstate)};function eXcell_txt(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_textarea";this.obj.onclick=function(k){(k||event).cancelBubble=true};var g=this.grid.getPosition(this.cell);if(!this.cell._clearCell){this.obj.value=this.val}this.obj.style.display="";this.obj.style.textAlign=this.cell.align;if(_isFF){var f=document.createElement("DIV");f.appendChild(this.obj);f.style.overflow="auto";f.className="dhx_textarea";this.obj.style.margin="0px 0px 0px 0px";this.obj.style.border="0px";this.obj=f}document.body.appendChild(this.obj);this.obj.onkeydown=function(l){var k=(l||event);if(k.keyCode==9){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:k.keyCode,shiftKey:k.shiftKey,srcElement:"0"});return false}};this.obj.style.left=g[0]+"px";this.obj.style.top=g[1]+this.cell.offsetHeight+"px";if(this.cell.scrollWidth<200){var h=200}else{var h=this.cell.scrollWidth}this.obj.style.width=h+(_isFF?18:16)+"px";if(_isFF){this.obj.firstChild.style.width=parseInt(this.obj.style.width)+"px";this.obj.firstChild.style.height=this.obj.offsetHeight-3+"px"}if(_isFF){this.obj.firstChild.focus()}else{this.obj.focus();this.obj.focus()}};this.detach=function(){var f="";if(_isFF){f=this.obj.firstChild.value}else{f=this.obj.value}if(f==""){this.cell._clearCell=true}else{this.cell._clearCell=false}this.setValue(f);document.body.removeChild(this.obj);return this.val!=this.getValue()};this.getValue=function(){if(this.cell.firstChild){if(this.cell.firstChild.tagName=="TEXTAREA"){return this.obj.firstChild.value}else{if(this.cell.firstChild.tagName=="DIV"){return this.obj.firstChild.firstChild.value}}}if(this.cell._clearCell){return""}if((!this.grid.multiLine)){return this.cell._brval||this.cell.innerHTML}else{return this.cell.innerHTML.replace(/<br[^>]*>/gi,"\n")._dhx_trim()}}}eXcell_txt.prototype=new eXcell;function eXcell_txttxt(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}if((!this.grid.multiLine)&&this.cell._brval){return this.cell._brval}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(f){this.cell._brval=f;if(!f||f.toString()._dhx_trim()==""){f=" "}this.setCTxtValue(f)}}eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(b){if(!b||b.toString()._dhx_trim()==""){b="&nbsp;";this.cell._clearCell=true}else{this.cell._clearCell=false}this.cell._brval=b;if((!this.grid.multiLine)){this.setCValue(b,b)}else{this.setCValue(b.replace(/\n/g,"<br/>"),b)}};function eXcell_co(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid;this.combo=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));this.editable=true}this.shiftNext=function(){var f=this.list.options[this.list.selectedIndex+1];if(f){f.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text;return true};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var f=this.list.options[this.list.selectedIndex-1];if(f){f.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text}return true};this.edit=function(){this.val=this.getValue();this.text=this.getText()._dhx_trim();var h=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-4)+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.align;this.obj.onclick=function(o){(o||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(o){if(!o){o=event}o.cancelBubble=true;return true};var l=this;this.obj.onkeyup=function(p){var q=this.readonly?String.fromCharCode((p||event).keyCode):this.value;var r=l.list.options;for(var o=0;o<r.length;o++){if(r[o].text.indexOf(q)==0){return r[o].selected=true}}};this.list=document.createElement("SELECT");this.list.className="dhx_combo_select";this.list.style.width=this.cell.offsetWidth+"px";this.list.style.left=h[0]+"px";this.list.style.top=h[1]+this.cell.offsetHeight+"px";this.list.onclick=function(q){var p=q||window.event;var o=p.target||p.srcElement;if(o.tagName=="OPTION"){o=o.parentNode}l.setValue(o.value);l.editable=false;l.grid.editStop()};var f=this.combo.getKeys();var k=false;var n=0;for(var g=0;g<f.length;g++){var m=this.combo.get(f[g]);this.list.options[this.list.options.length]=new Option(m,f[g]);if(f[g]==this.val){n=this.list.options.length-1;k=true}}if(k==false){this.list.options[this.list.options.length]=new Option(this.text,this.val===null?"":this.val);n=this.list.options.length-1}document.body.appendChild(this.list);this.list.size="6";this.cstate=1;if(this.editable){this.cell.innerHTML=""}else{this.obj.style.width="1px";this.obj.style.height="1px"}this.cell.appendChild(this.obj);this.list.options[n].selected=true;if((!_isFF)||(this.editable)){this.obj.focus();this.obj.focus()}if(!this.editable){this.obj.style.visibility="hidden";this.list.focus();this.list.onkeydown=function(o){o=o||window.event;l.grid.setActive(true);if(o.keyCode<30){return l.grid.doKey({target:l.cell,keyCode:o.keyCode,shiftKey:o.shiftKey,ctrlKey:o.ctrlKey})}}}};this.getValue=function(){return((this.cell.combo_value==window.undefined)?"":this.cell.combo_value)};this.detach=function(){if(this.val!=this.getValue()){this.cell.wasChanged=true}if(this.list.parentNode!=null){if(this.editable){if(this.obj.value._dhx_trim()!=this.text){if(this.list.selectedIndex&&this.list.options[this.list.selectedIndex].text==this.obj.value){this.setValue(this.list.value)}else{this.setValue(this.obj.value)}}else{this.setValue(this.val)}}else{this.setValue(this.list.value)}}if(this.list.parentNode){this.list.parentNode.removeChild(this.list)}if(this.obj.parentNode){this.obj.parentNode.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_co.prototype=new eXcell;eXcell_co.prototype.getText=function(){return this.cell.innerHTML};eXcell_co.prototype.setValue=function(g){if(typeof(g)=="object"){var f=this.grid.xmlLoader.doXPath("./option",g);if(f.length){this.cell._combo=new dhtmlXGridComboObject()}for(var b=0;b<f.length;b++){this.cell._combo.put(f[b].getAttribute("value"),f[b].firstChild?f[b].firstChild.data:"")}g=g.firstChild.data}if((g||"").toString()._dhx_trim()==""){g=null}if(g!==null){this.setCValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(g)||g,g)}else{this.setCValue("&nbsp;",g)}this.cell.combo_value=g};function eXcell_coro(b){this.base=eXcell_co;this.base(b);this.editable=false}eXcell_coro.prototype=new eXcell_co;function eXcell_cotxt(b){this.base=eXcell_co;this.base(b)}eXcell_cotxt.prototype=new eXcell_co;eXcell_cotxt.prototype.getText=function(){return(_isIE?this.cell.innerText:this.cell.textContent)};eXcell_cotxt.prototype.setValue=function(g){if(typeof(g)=="object"){var f=this.grid.xmlLoader.doXPath("./option",g);if(f.length){this.cell._combo=new dhtmlXGridComboObject()}for(var b=0;b<f.length;b++){this.cell._combo.put(f[b].getAttribute("value"),f[b].firstChild?f[b].firstChild.data:"")}g=g.firstChild.data}if((g||"").toString()._dhx_trim()==""){g=null}if(g!==null){this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(g)||g,g)}else{this.setCTxtValue(" ",g)}this.cell.combo_value=g};function eXcell_corotxt(b){this.base=eXcell_co;this.base(b);this.editable=false}eXcell_corotxt.prototype=new eXcell_cotxt;function eXcell_cp(b){try{this.cell=b;this.grid=this.cell.parentNode.grid}catch(f){}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("SPAN");this.obj.style.border="1px solid black";this.obj.style.position="absolute";var g=this.grid.getPosition(this.cell);this.colorPanel(4,this.obj);document.body.appendChild(this.obj);this.obj.style.left=g[0]+"px";this.obj.style.top=g[1]+this.cell.offsetHeight+"px"};this.toolDNum=function(g){if(g.length==1){g="0"+g}return g};this.colorPanel=function(p,t){var m=document.createElement("TABLE");t.appendChild(m);m.cellSpacing=0;m.editor_obj=this;m.style.cursor="default";m.style.cursor="table-layout:fixed";m.onclick=function(v){var u=v||window.event;var n=u.target||u.srcElement;var r=n.parentNode.parentNode.parentNode.editor_obj;r.setValue(n.style.backgroundColor);r.grid.editStop()};var k=256/p;for(var l=0;l<=(256/k);l++){var g=m.insertRow(l);for(var o=0;o<=(256/k);o++){for(var h=0;h<=(256/k);h++){R=new Number(k*l)-(l==0?0:1);G=new Number(k*o)-(o==0?0:1);B=new Number(k*h)-(h==0?0:1);var s=this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16));var q=g.insertCell(o);q.width="10px";q.innerHTML="&nbsp;";q.title=s.toUpperCase();q.style.backgroundColor="#"+s;if(this.val!=null&&"#"+s.toUpperCase()==this.val.toUpperCase()){q.style.border="2px solid white"}}}}};this.getValue=function(){return this.cell.firstChild.style?this.cell.firstChild.style.backgroundColor:""};this.getRed=function(){return Number(parseInt(this.getValue().substr(1,2),16))};this.getGreen=function(){return Number(parseInt(this.getValue().substr(3,2),16))};this.getBlue=function(){return Number(parseInt(this.getValue().substr(5,2),16))};this.detach=function(){if(this.obj.offsetParent!=null){document.body.removeChild(this.obj)}return this.val!=this.getValue()}}eXcell_cp.prototype=new eXcell;eXcell_cp.prototype.setValue=function(b){this.setCValue("<div style='width:100%;height:"+(this.cell.offsetHeight-2)+";background-color:"+(b||"")+";border:0px;'>&nbsp;</div>",b)};function eXcell_img(b){try{this.cell=b;this.grid=this.cell.parentNode.grid}catch(f){}this.getValue=function(){if(this.cell.firstChild.tagName=="IMG"){return this.cell.firstChild.src+(this.cell.titFl!=null?"^"+this.cell.tit:"")}else{if(this.cell.firstChild.tagName=="A"){var g=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell.tit:"");g+="^"+this.cell.lnk;if(this.cell.trg){g+="^"+this.cell.trg}return g}}}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell.tit};eXcell_img.prototype.setValue=function(g){var f=g;if(g.indexOf("^")!=-1){var b=g.split("^");g=b[0];f=b[1];if(b.length>2){this.cell.lnk=b[2];if(b[3]){this.cell.trg=b[3]}}this.cell.titFl="1"}this.setCValue("<img src='"+(g||"")._dhx_trim()+"' border='0'>",g);if(this.cell.lnk){if(typeof(this.cell.trg)=="undefined"){this.cell.innerHTML="<a href='#' onclick='"+this.cell.lnk+"'>"+this.cell.innerHTML+"</a>"}else{this.cell.innerHTML="<a href='#' onclick='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>"}}this.cell.tit=f};function eXcell_price(b){this.base=eXcell_ed;this.base(b);this.getValue=function(){if(this.cell.childNodes.length>1){return this.cell.childNodes[1].innerHTML.toString()._dhx_trim()}else{return"0"}}}eXcell_price.prototype=new eXcell_ed;eXcell_price.prototype.setValue=function(f){if(isNaN(parseFloat(f))){f=this.val||0}var b="green";if(f<0){b="red"}this.setCValue("<span>$</span><span style='padding-right:2px;color:"+b+";'>"+f+"</span>",f)};function eXcell_dyn(b){this.base=eXcell_ed;this.base(b);this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()}}eXcell_dyn.prototype=new eXcell_ed;eXcell_dyn.prototype.setValue=function(g){if(!g||isNaN(Number(g))){g=0}if(g>0){var f="green";var b="dyn_up.gif"}else{if(g==0){var f="black";var b="dyn_.gif"}else{var f="red";var b="dyn_down.gif"}}this.setCValue("<div style='position:relative;padding-right:2px;width:100%;'><img src='"+this.grid.imgURL+""+b+"' height='15' style='position:absolute;top:0px;left:0px;'><span style='width:100%;color:"+f+";'>"+g+"</span></div>",g)};function eXcell_ro(b){if(b){this.cell=b;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true}}eXcell_ro.prototype=new eXcell;function eXcell_ron(b){this.cell=b;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)}}eXcell_ron.prototype=new eXcell;eXcell_ron.prototype.setValue=function(b){if(b===0){b="0"}else{if(!b||b.toString()._dhx_trim()==""){this.setCValue("&nbsp;");return this.cell._clearCell=true}}this.setCValue(this.grid._aplNF(b,this.cell._cellIndex));this.cell._clearCell=false};function eXcell_rotxt(b){this.cell=b;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.setValue=function(f){if(!f||f.toString()._dhx_trim()==""){f=" "}this.setCTxtValue(f)}}eXcell_rotxt.prototype=new eXcell;function dhtmlXGridComboObject(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();this.put=function(f,g){for(var b=0;b<this.keys.length;b++){if(this.keys[b]==f){this.values[b]=g;return true}}this.values[this.values.length]=g;this.keys[this.keys.length]=f};this.get=function(f){for(var b=0;b<this.keys.length;b++){if(this.keys[b]==f){return this.values[b]}}return null};this.clear=function(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray()};this.remove=function(f){for(var b=0;b<this.keys.length;b++){if(this.keys[b]==f){this.keys._dhx_removeAt(b);this.values._dhx_removeAt(b);return true}}};this.size=function(){var b=0;for(var f=0;f<this.keys.length;f++){if(this.keys[f]!=null){b++}}return b};this.getKeys=function(){var b=new Array(0);for(var f=0;f<this.keys.length;f++){if(this.keys[f]!=null){b[b.length]=this.keys[f]}}return b};this.save=function(){this._save=new Array();for(var b=0;b<this.keys.length;b++){this._save[b]=[this.keys[b],this.values[b]]}};this.restore=function(){if(this._save){this.keys[b]=new Array();this.values[b]=new Array();for(var b=0;b<this._save.length;b++){this.keys[b]=this._save[b][0];this.values[b]=this._save[b][1]}}};return this}function Hashtable(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();return this}Hashtable.prototype=new dhtmlXGridComboObject;dhtmlXGridObject.prototype.filterBy=function(g,h,f){if(this.isTreeGrid()){return this.filterTreeBy(g,h,f)}if(this._f_rowsBuffer){if(!f){this.rowsBuffer=dhtmlxArray([].concat(this._f_rowsBuffer))}}else{this._f_rowsBuffer=[].concat(this.rowsBuffer)}if(!this.rowsBuffer.length){return}var k=true;this.dma(true);if(typeof(g)=="object"){for(var b=0;b<h.length;b++){this._filterA(g[b],h[b])}}else{this._filterA(g,h)}this.dma(false);if(this.pagingOn&&this.rowsBuffer.length/this.rowsBufferOutSize<this.currentPage){this.changePage(0)}this._reset_view();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._filterA=function(f,g){if(g==""){return}var h=true;if(typeof(g)=="function"){h=false}else{g=(g||"").toString().toLowerCase()}if(!this.rowsBuffer.length){return}for(var b=this.rowsBuffer.length-1;b>=0;b--){if(h?(this._get_cell_value(this.rowsBuffer[b],f).toString().toLowerCase().indexOf(g)==-1):(!g(this._get_cell_value(this.rowsBuffer[b],f),this.rowsBuffer[b].idd))){this.rowsBuffer.splice(b,1)}}};dhtmlXGridObject.prototype.filterDropdownBy=function(g,h,f){if(this.isTreeGrid()){return this.filterTreeBy(g,h,f)}if(this._f_rowsBuffer){if(!f){this.rowsBuffer=dhtmlxArray([].concat(this._f_rowsBuffer))}}else{this._f_rowsBuffer=[].concat(this.rowsBuffer)}if(!this.rowsBuffer.length){return}var k=true;this.dma(true);if(typeof(g)=="object"){for(var b=0;b<h.length;b++){this._filterDropdown(g[b],h[b])}}else{this._filterDropdown(g,h)}this.dma(false);if(this.pagingOn&&this.rowsBuffer.length/this.rowsBufferOutSize<this.currentPage){this.changePage(0)}this._reset_view();this.callEvent("onGridReconstructed",[])};dhtmlXGridObject.prototype._filterDropdown=function(f,g){if(g==""){return}var h=true;if(typeof(g)=="function"){h=false}else{g=(g||"").toString().toLowerCase()}if(!this.rowsBuffer.length){return}for(var b=this.rowsBuffer.length-1;b>=0;b--){if(h?(this._get_cell_value(this.rowsBuffer[b],f).toString().toLowerCase()!=g):(!g(this._get_cell_value(this.rowsBuffer[b],f),this.rowsBuffer[b].idd))){this.rowsBuffer.splice(b,1)}}};dhtmlXGridObject.prototype.collectValues=function(h){if(this.isTreeGrid()){return this.collectTreeValues(h)}this.dma(true);h=this._m_order?this._m_order[h]:h;var n={};var l=[];this._build_m_order();var b=this._f_rowsBuffer||this.rowsBuffer;for(var g=0;g<b.length;g++){var m=this._get_cell_value(b[g],h);if(m){n[m]=true}}this.dma(false);var k=this.combos[h];for(d in n){if(n[d]===true){l.push(k?(k.get(d)||d):d)}}return l.sort()};dhtmlXGridObject.prototype._build_m_order=function(){if(this._c_order){this._m_order=[];for(var b=0;b<this._c_order.length;b++){this._m_order[this._c_order[b]]=b}}};dhtmlXGridObject.prototype.filterByAll=function(){this.callEvent("onFilterStart",[]);var g=[];var f=[];this._build_m_order();for(var h=0;h<this.filters.length;h++){var l=this._m_order?this._m_order[this.filters[h][1]]:this.filters[h][1];f.push(l);var m=this.filters[h][0]._filter?this.filters[h][0]._filter():this.filters[h][0].value;var k;if(typeof m!="function"&&(k=this.combos[l])){l=k.values._dhx_find(m);m=(l==-1)?m:k.keys[l]}g.push(m)}if(arguments.length){this.filterDropdownBy(f,g)}else{this.filterBy(f,g)}this.getrecordCount();if(this._cssEven){this._fixAlterCss()}this.callEvent("onFilterEnd",[this.filters])};dhtmlXGridObject.prototype.makeFilter=function(k,g,f){if(!this.filters){this.filters=[]}if(typeof(k)!="object"){k=document.getElementById(k)}if(!k){return}var b=this;if(!k.style.width){k.style.width="90%"}if(k.tagName=="SELECT"){this.filters.push([k,g]);this._loadSelectOptins(k,g);k.onchange=function(){b.filterByAll(1)};if(_isIE){k.style.marginTop="1px"}this.attachEvent("onEditCell",function(m,l,n){this._build_m_order();if(m==2&&this.filters&&(this._m_order?(n==this._m_order[g]):(n==g))){this._loadSelectOptins(k,g)}return true})}else{if(k.tagName=="INPUT"){this.filters.push([k,g]);k.value="";k.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){b.filterByAll()},500)}}else{if(k.tagName=="DIV"&&k.className=="combo"){this.filters.push([k,g]);k.style.padding="0px";k.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var h=new dhtmlXCombo(k,"_filter","90%");h.enableFilteringMode(true);k.combo=h;k.value="";this._loadComboOptins(k,g);h.attachEvent("onChange",function(){k.value=h.getSelectedValue();b.filterByAll()})}}}if(k.parentNode){k.parentNode.className+=" filter"}};dhtmlXGridObject.prototype.findCell=function(h,k,l){var g=new Array();h=h.toString().toLowerCase();if(!this.rowsBuffer.length){return g}for(var f=(k||0);f<this._cCount;f++){if(this._h2){this._h2.forEachChild(0,function(m){if(this._get_cell_value(m.buff,f).toString().toLowerCase().indexOf(h)!=-1){g.push([m.id,f]);if(l){return g}}},this)}else{for(var b=0;b<this.rowsBuffer.length;b++){if(this._get_cell_value(this.rowsBuffer[b],f).toString().toLowerCase().indexOf(h)!=-1){g.push([this.rowsBuffer[b].idd,f]);if(l){return g}}}}if(typeof(k)!="undefined"){return g}}return g};dhtmlXGridObject.prototype.makeSearch=function(g,f){if(typeof(g)!="object"){g=document.getElementById(g)}if(!g){return}var b=this;if(g.tagName=="INPUT"){g.onkeypress=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(g.value==""){return}var h=b.findCell(g.value,f,true);if(h.length){b.setSelectedRow(h[0][0])}},500)}}if(g.parentNode){g.parentNode.className+=" filter"}};dhtmlXGridObject.prototype._loadSelectOptins=function(h,m){var b=this.collectValues(m);h.innerHTML="";h.options[0]=new Option("","");var k=this._filter_tr?this._filter_tr[m]:null;for(var g=0;g<b.length;g++){h.options[h.options.length]=new Option(k?k(b[g]):b[g],b[g])}};dhtmlXGridObject.prototype.setSelectFilterLabel=function(f,b){if(!this._filter_tr){this._filter_tr=[]}this._filter_tr[f]=b};dhtmlXGridObject.prototype._loadComboOptins=function(g,h){var b=this.collectValues(h);g.combo.clearAll();g.combo.render(false);g.combo.addOption("","");for(var f=0;f<b.length;f++){g.combo.addOption(b[f],b[f])}g.combo.render(true)};dhtmlXGridObject.prototype.refreshFilters=function(){for(var b=0;b<this.filters.length;b++){switch(this.filters[b][0].tagName.toLowerCase()){case"input":break;case"select":this._loadSelectOptins.apply(this,this.filters[b]);break;case"div":this._loadComboOptins.apply(this,this.filters[b]);break}}};dhtmlXGridObject.prototype._filters_ready=function(f,b){this.attachEvent("onXLE",this.refreshFilters);this.attachEvent("onClearAll",function(){this._f_rowsBuffer=null;if(!this.obj.rows.length){this.filters=[]}});this._filters_ready=function(){}};dhtmlXGridObject.prototype._in_header_text_filter=function(f,b){f.innerHTML="<input type='text' style='width:90%;font-size:8pt;font-family:Tahoma;-moz-user-select:text;'>";f.onclick=f.onmousedown=function(g){(g||event).cancelBubble=true;return true};f.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(f.firstChild,b);this._filters_ready()};dhtmlXGridObject.prototype._in_header_select_filter=function(f,b){f.innerHTML="<select style='width:90%;font-size:8pt;font-family:Tahoma;'></select>";f.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(f.firstChild,b);this._filters_ready()};dhtmlXGridObject.prototype._in_header_combo_filter=function(f,b){f.innerHTML="<div style='width:100%;padding-left:2px;overflow:hidden;font-size:8pt;font-family:Tahoma;-moz-user-select:text;' class='combo'></div>";f.onselectstart=function(){return(event.cancelBubble=true)};f.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(f.firstChild,b);this._filters_ready()};dhtmlXGridObject.prototype._in_header_text_search=function(f,b){f.innerHTML="<input type='text' style='width:90%;font-size:8pt;font-family:Tahoma;-moz-user-select:text;'>";f.onclick=f.onmousedown=function(g){(g||event).cancelBubble=true;return true};f.onselectstart=function(){return(event.cancelBubble=true)};this.makeSearch(f.firstChild,b)};dhtmlXGridObject.prototype._in_header_numeric_filter=function(f,b){this._in_header_text_filter.call(this,f,b);f.firstChild._filter=function(){var g=this.value;var k;var m="==";var h=parseFloat(g.replace("=",""));var l=null;if(g){if(g.indexOf("..")!=-1){g=g.split("..");h=parseFloat(g[0]);l=parseFloat(g[1]);return function(n){if(n>=h&&n<=l){return true}return false}}k=g.match(/>|>=|<=|</);if(k){m=k[0];h=parseFloat(g.replace(m,""))}return Function("v"," if (v "+m+" "+h+" )return true;return false;")}}};dhtmlXGridObject.prototype._in_header_master_checkbox=function(g,f){g.innerHTML="<input type='checkbox' />";var b=this;g.firstChild.onclick=function(h){var k=this.checked?1:0;b.forEachRow(function(l){this.cells(l,f).setValue(k)});(h||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(f,b,h){var g=function(){var m=0;for(var l=0;l<this.rowsBuffer.length;l++){var k=parseFloat(this._get_cell_value(this.rowsBuffer[l],b));m+=isNaN(k)?0:k}return this._maskArr[b]?this._aplNF(m,b):(Math.round(m*100)/100)};this._stat_in_header(f,g,b,h,h)};dhtmlXGridObject.prototype._in_header_stat_multi_total=function(g,f,l){var k=l[1].split(":");l[1]="";k[0]=parseInt(k[0]);k[1]=parseInt(k[1]);var h=function(){var o=0;for(var n=0;n<this.rowsBuffer.length;n++){var m=parseFloat(this._get_cell_value(this.rowsBuffer[n],k[0]))*parseFloat(this._get_cell_value(this.rowsBuffer[n],k[1]));o+=isNaN(m)?0:m}return this._maskArr[f]?this._aplNF(o,f):(Math.round(o*100)/100)};var b=[];b[k[0]]=true;b[k[1]]=true;this._stat_in_header(g,h,b,l,l)};dhtmlXGridObject.prototype._in_header_stat_max=function(f,b,h){var g=function(){var l=-999999999;if(this.getRowsNum()==0){return""}for(var k=0;k<this.rowsBuffer.length;k++){l=Math.max(l,parseFloat(this._get_cell_value(this.rowsBuffer[k],b)))}return this._maskArr[b]?this._aplNF(l,b):l};this._stat_in_header(f,g,b,h)};dhtmlXGridObject.prototype._in_header_stat_min=function(f,b,h){var g=function(){var l=999999999;if(this.getRowsNum()==0){return""}for(var k=0;k<this.rowsBuffer.length;k++){l=Math.min(l,parseFloat(this._get_cell_value(this.rowsBuffer[k],b)))}return this._maskArr[b]?this._aplNF(l,b):l};this._stat_in_header(f,g,b,h)};dhtmlXGridObject.prototype._in_header_stat_average=function(f,b,h){var g=function(){var n=0;var m=0;for(var l=0;l<this.rowsBuffer.length;l++){var k=parseFloat(this._get_cell_value(this.rowsBuffer[l],b));n+=isNaN(k)?0:k;m++}return this._maskArr[b]?this._aplNF(n,b):(Math.round(n/m*100)/100)};this._stat_in_header(f,g,b,h)};dhtmlXGridObject.prototype._in_header_stat_count=function(f,b,h){var g=function(){return this.getRowsNum()};this._stat_in_header(f,g,b,h)};dhtmlXGridObject.prototype._stat_in_header=function(g,h,b,m){var k=this;var l=function(){this.dma(true);g.innerHTML=(m[0]?m[0]:"")+h.call(this)+(m[1]?m[1]:"");this.dma(false);this.callEvent("onStatReady",[])};if(!this._stat_events){this._stat_events=[];this.attachEvent("onClearAll",function(){if(!this.hdr.rows[1]){for(var n=0;n<this._stat_events.length;n++){for(var f=0;f<4;f++){this.detachEvent(this._stat_events[n][f])}}this._stat_events=[]}})}this._stat_events.push([this.attachEvent("onGridReconstructed",l),this.attachEvent("onXLE",l),this.attachEvent("onFilterEnd",l),this.attachEvent("onEditCell",function(f,o,n){if(f==2&&(n==b||(b&&b[n]))){l.call(this)}return true})]);g.innerHTML=""};dhtmlXGridObject.prototype.getrecordCount=function(){document.getElementById("recdiv").style.display="block";var b=document.getElementById("recfound");b.style.color="";if(this.rowsBuffer.length){b.innerHTML=this.rowsBuffer.length+" "}else{b.innerHTML=" No "}};function grayOut(g){if(arguments.length>1){var b=arguments[1];var f=arguments[2];mainDiv=document.getElementById(b);document.getElementById("fade").style.top=document.getElementById(f).offsetTop;document.getElementById("fade").style.left=document.getElementById(f).offsetLeft;document.getElementById("fade").style.width=mainDiv.offsetWidth+"px";document.getElementById("fade").style.height=mainDiv.offsetHeight+"px"}else{mainDiv=document.getElementById("a_tabbar");if(mainDiv!=null){document.getElementById("fade").style.top=document.getElementById("grayout_div").offsetTop;document.getElementById("fade").style.left=document.getElementById("grayout_div").offsetLeft;document.getElementById("fade").style.width=mainDiv.offsetWidth+"px";document.getElementById("fade").style.height=mainDiv.offsetHeight+"px"}else{mainDiv=document.getElementById("divPageLoadMessage");if(mainDiv!=null){document.getElementById("fade").style.top=document.getElementById("grayout_div").offsetTop;document.getElementById("fade").style.left=document.getElementById("grayout_div").offsetLeft;document.getElementById("fade").style.width=mainDiv.offsetWidth+"px";document.getElementById("fade").style.height=mainDiv.offsetHeight+"px"}}}if(g){document.getElementById("fade").style.display="block"}else{document.getElementById("fade").style.display="none"}}function dhtmlXTabBar(f,g,b){this._isIE7s=((_isIE)&&window.XMLHttpRequest&&(document.compatMode!="BackCompat"));g=g||"top";this._mode=g+"/";this._eczF=true;if(_isIE){this.preventIECashing(true)}if(typeof(f)!="object"){this.entBox=document.getElementById(f)}else{this.entBox=f}this.width=this.entBox.getAttribute("width")||this.entBox.style.width||(window.getComputedStyle?window.getComputedStyle(this.entBox,null)["width"]:(this.entBox.currentStyle?this.entBox.currentStyle.width:0));this.height=this.entBox.getAttribute("height")||this.entBox.style.height||(window.getComputedStyle?window.getComputedStyle(this.entBox,null)["height"]:(this.entBox.currentStyle?this.entBox.currentStyle.height:0));if(((this.width||"").indexOf("%")!=-1)||((this.width||"").indexOf("%")!=-1)){this.enableAutoReSize(true,true)}if((!this.width)||(this.width=="auto")||(this.width.indexOf("%")!=-1)||(parseInt(this.width)==0)){this.width=this.entBox.offsetWidth+"px"}if((!this.height)||(this.height.indexOf("%")!=-1)||(this.height=="auto")){this.height=this.entBox.offsetHeight+"px"}this.activeTab=null;this.tabsId=new Object();this._align="left";this._offset=5;this._margin=1;this._height=parseInt(b||20);this._bMode=(g=="right"||g=="bottom");this._tabSize="150";this._content=new Array();this._tbst="win_text";this._styles={winDflt:["p_left.gif","p_middle.gif","p_right.gif","a_left.gif","a_middle.gif","a_right.gif","p_middle.gif",3,3,6,"","white",false],winScarf:["with_bg/p_left.gif","with_bg/p_middle.gif","with_bg/p_right_skos.gif","with_bg/a_left.gif","with_bg/a_middle.gif","with_bg/a_right_skos.gif","with_bg/p_middle_over.gif",3,18,6,false,false,false],winBiScarf:["with_bg/p_left_skos.gif","with_bg/p_middle.gif","with_bg/p_right_skos.gif","with_bg/a_left_skos.gif","with_bg/a_middle.gif","with_bg/a_right_skos.gif","with_bg/p_middle_over.gif",18,18,6,false,false,false],winRound:["circuses/p_left.gif","circuses/p_middle.gif","circuses/p_right.gif","circuses/a_left.gif","circuses/a_middle.gif","circuses/a_right.gif","circuses/p_middle_over.gif",10,10,6,false,false,false],silver:["silver/p_left.gif","silver/p_middle.gif","silver/p_right.gif","silver/a_left.gif","silver/a_middle.gif","silver/a_right.gif","silver/p_middle.gif",7,8,6,"#F4F3EE","#F0F8FF","white"],modern:["modern/p_left.gif","modern/p_middle.gif","modern/p_right.gif","modern/a_left.gif","modern/a_middle.gif","modern/a_right.gif","modern/p_middle_over.gif",5,5,6,false,false,"white"]};this._createSelf(g=="right"||g=="left");this.setStyle("winDflt");this._TabCloseButton=false;this._TabCloseButtonSrc="close.png";this._enableAutoRowAdd=false;return this}dhtmlXTabBar.prototype.setOffset=function(b){this._offset=b};dhtmlXTabBar.prototype.setAlign=function(b){if(b=="top"){b="left"}if(b=="bottom"){b="right"}this._align=b};dhtmlXTabBar.prototype.setMargin=function(b){this._margin=b};dhtmlXTabBar.prototype._createSelf=function(b){this._tabAll=document.createElement("DIV");this._tabZone=document.createElement("DIV");this._conZone=document.createElement("DIV");this.entBox.appendChild(this._tabAll);if(this._bMode){this._tabAll.appendChild(this._conZone);this._tabAll.appendChild(this._tabZone)}else{this._tabAll.appendChild(this._tabZone);this._tabAll.appendChild(this._conZone)}this._vMode=b;if(b){this._tabAll.className="dhx_tabbar_zoneV";this._setSizes=this._setSizesV;this._redrawRow=this._redrawRowV}else{this._tabAll.className="dhx_tabbar_zone"}if(this._bMode){this._tabAll.className+="B"}this._tabZone.className="dhx_tablist_zone";this._conZone.className="dhx_tabcontent_zone";this._tabZone.onselectstart=function(){return false};this._tabAll.onclick=this._onClickHandler;this._tabAll.onmouseover=this._onMouseOverHandler;if(_isFF){this._tabZone.onmouseout=this._onMouseOutHandler}else{this._tabZone.onmouseleave=this._onMouseOutHandler}this._tabAll.tabbar=this;this._lineA=document.createElement("div");this._lineA.className="dhx_tablist_line";this._lineA.style[b?"left":"top"]=(this._bMode?0:(this._height+2))+"px";this._lineA.style[b?"height":"width"]=parseInt(this[b?"height":"width"])+((_isIE&&document.compatMode!="BackCompat")?2:0)+"px";if(b){this._conZone.style.height=parseInt(this.height)+"px"}else{this._conZone.style.width=parseInt(this.width)-(_isFF?2:0)+"px"}this.rows=new Array();this.rowscount=1;this._createRow();this._setSizes()};dhtmlXTabBar.prototype._createRow=function(){var b=document.createElement("DIV");b.className="dhx_tabbar_row";this._tabZone.appendChild(b);b._rowScroller=document.createElement("DIV");b._rowScroller.style.display="none";b.appendChild(b._rowScroller);this.rows[this.rows.length]=b;if(this._vMode){b.style.width=this._height+3+"px";b.style.height=parseInt(this.height)+"px";if(!this._bMode){this.setRowSizesA()}else{this.setRowSizesB()}}else{b.style.height=parseInt(this._height)+3+"px";b.style.width=parseInt(this.width)+((_isIE&&document.compatMode!="BackCompat")?2:0)+"px"}b.appendChild(this._lineA)};dhtmlXTabBar.prototype._removeRow=function(g){g.parentNode.removeChild(g);var f=new Array();for(var b=0;b<this.rows.length;b++){if(this.rows[b]!=g){f[f.length]=this.rows[b]}}this.rows=f};dhtmlXTabBar.prototype._checkSizes=function(g){var f=parseInt(this._offset);for(var b=0;b<g.tabCount;b++){if(g.childNodes[b].style.display=="none"){continue}f+=g.childNodes[b]._offsetSize+this._margin*1}return(g.offsetWidth<(f-this._margin*1))};dhtmlXTabBar.prototype._setSizes=function(){this._tabAll.height=this.height;this._tabAll.width=this.width;if(this._tabZone.childNodes.length){var f=this._tabZone.lastChild.offsetTop-this._tabZone.firstChild.offsetTop+this._height}else{var f=this._height+(_isIE?5:0)}var b=f-2;this._tabZone.style.height=(b>0?b:0)+"px";b=parseInt(this.height)-f-4;this._conZone.style.height=(b>0?b:0)+"px"};dhtmlXTabBar.prototype._setSizesV=function(){this._tabAll.height=this.height;this._tabAll.width=this.width;var b=this._height*this.rows.length;if(!this._bMode){this._tabZone.style.width=b+3+"px";this._conZone.style.width=parseInt(this.width)-(b+(_isFF?5:3))+"px";this._conZone.style.left=b+3+"px"}else{this._tabZone.style.width=b+3+"px";this._conZone.style.width=parseInt(this.width)-(b+3)+"px";this._tabZone.style.left=parseInt(this.width)-(b+3)+"px"}this._conZone.style.height=parseInt(this.height)-(_isFF?2:0)+"px";this._tabZone.style.height=parseInt(this.height)+"px"};dhtmlXTabBar.prototype._redrawRowV=function(h){var g=this._align=="left"?"top":"bottom";var f=parseInt(this._offset);for(var b=0;b<h.tabCount;b++){if(h.childNodes[b].style.display=="none"){continue}h.childNodes[b]._cInd=b;h.childNodes[b].style[g]=f+"px";f+=h.childNodes[b]._offsetSize+parseInt(this._margin)}if((h.offsetHeight<f-parseInt(this._margin))||(parseInt(h.childNodes[0].style[this._align=="left"?"top":"bottom"])<0)){this._showRowScroller(h)}else{this._hideRowScroller(h)}};dhtmlXTabBar.prototype._setTabTop=function(g){if(!this._vMode){if(g.parentNode!=this.rows[0]){this._tabZone.insertBefore(g.parentNode,this.rows[0])}}var b=new Array();b[b.length]=g.parentNode;for(var f=0;f<this.rows.length;f++){if(this.rows[f]!=g.parentNode){b[b.length]=this.rows[f]}}this.rows=b;if(this._vMode){this.setRowSizesB()}else{this.setRowSizesC()}this._lineA.parentNode.removeChild(this._lineA);this.rows[0].appendChild(this._lineA)};dhtmlXTabBar.prototype.setRowSizesA=function(){for(var b=0;b<this.rows.length;b++){this.rows[b].style.left=b*this._height+"px";this.rows[b].style.zIndex=5+b}};dhtmlXTabBar.prototype.setRowSizesB=function(){for(var b=this.rows.length-1;b>=0;b--){this.rows[b].style.left=b*this._height+"px";this.rows[b].style.zIndex=15-b}};dhtmlXTabBar.prototype.setRowSizesC=function(){for(var b=this.rows.length-1;b>=0;b--){this.rows[b].style.zIndex=15-b}};dhtmlXTabBar.prototype._initScroller=function(f){var b=f._rowScroller;if(this._vMode){b.innerHTML="<img src='"+this._imgPath+"scrl_t.gif' style='display:block;'><img src='"+this._imgPath+"scrl_b.gif'>"}else{b.innerHTML="<img src='"+this._imgPath+"scrl_l.gif'><img src='"+this._imgPath+"scrl_r.gif'>"}if(this._align=="left"){b.childNodes[1].onclick=this._scrollRight;b.childNodes[0].onclick=this._scrollLeft}else{b.childNodes[1].onclick=this._scrollLeft;b.childNodes[0].onclick=this._scrollRight}b.className="dhx_tablist_scroll";b._init=1};dhtmlXTabBar.prototype._scrollLeft=function(){var f=this.parentNode.parentNode.parentNode.parentNode.tabbar;var g=this.parentNode.parentNode;if(!g.scrollIndex){g.scrollIndex=0}g.scrollIndex--;if(g.scrollIndex<0){g.scrollIndex=0;return}var b=g.childNodes[g.scrollIndex]._offsetSize+f._margin*1;f._offset+=b;f._redrawRow(g);return b};dhtmlXTabBar.prototype._scrollTo=function(b){var f=this;var h=b.parentNode;if(!h._rowScroller._init){this._initScroller(h)}if(this._vMode){var g=parseInt(b.style[f._align=="left"?"top":"bottom"])+b._offsetSize-parseInt(f.height)}else{var g=parseInt(b.style[f._align])+b._offsetSize-parseInt(f.width)}while(g>0){if(f._align=="left"){g-=h._rowScroller.childNodes[1].onclick()}else{g-=h._rowScroller.childNodes[0].onclick()}}if(this._vMode){var g=parseInt(b.style[f._align=="left"?"top":"bottom"])-b._offsetSize}else{var g=parseInt(b.style[f._align])-b._offsetSize}while(g<0){if(f._align=="left"){g+=h._rowScroller.childNodes[0].onclick()}else{g+=h._rowScroller.childNodes[1].onclick()}}};dhtmlXTabBar.prototype._scrollRight=function(){var f=this.parentNode.parentNode.parentNode.parentNode.tabbar;var g=this.parentNode.parentNode;if(g.tabCount-g.scrollIndex<2){return}if(!g.scrollIndex){g.scrollIndex=0}var b=g.childNodes[g.scrollIndex]._offsetSize+f._margin*1;f._offset-=b;f._redrawRow(g);g.scrollIndex++;return b};dhtmlXTabBar.prototype._hideRowScroller=function(b){b._rowScroller.style.display="none"};dhtmlXTabBar.prototype.enableScroll=function(f){this._edscr=(!convertStringToBoolean(f));if(this._edscr){for(var b=0;b<this.rows.length;b++){this._hideRowScroller(this.rows[b])}}};dhtmlXTabBar.prototype._showRowScroller=function(b){if(this._edscr){return}if(!b._rowScroller._init){this._initScroller(b)}b._rowScroller.style.display="block";if(this._vMode){if(this._align=="left"){b._rowScroller.style.top=b.scrollTop-38+parseInt(this.height)+"px"}else{b._rowScroller.style.top=b.scrollTop+4+"px"}this._lineA.style.top=b.scrollLeft+"px"}else{if(this._align=="left"){b._rowScroller.style.left=b.scrollLeft-38+parseInt(this.width)+"px"}else{b._rowScroller.style.left=b.scrollLeft+4+"px"}this._lineA.style.left=b.scrollLeft+"px"}};dhtmlXTabBar.prototype._onMouseOverHandler=function(f){if(_isIE){var b=event.srcElement}else{var b=f.target}b=this.tabbar._getTabTarget(b);if(!b){this.tabbar._hideHover(b);return}this.tabbar._showHover(b);(f||event).cancelBubble=true};dhtmlXTabBar.prototype._onMouseOutHandler=function(b){this.parentNode.tabbar._hideHover(null);return};dhtmlXTabBar.prototype._onClickHandler=function(f){if(_isIE){var b=event.srcElement}else{var b=f.target}if(document.body.onclick){document.body.onclick(f)}(f||event).cancelBubble=true;b=this.tabbar._getTabTarget(b);if(!b){return}this.tabbar._setTabActive(b);return false};dhtmlXTabBar.prototype._getTabTarget=function(b){while((!b.className)||(b.className.indexOf("dhx_tab_element")==-1)){if((b.className)&&(b.className.indexOf("dhx_tabbar_zone")!=-1)){return null}b=b.parentNode;if(!b){return null}}return b};dhtmlXTabBar.prototype._redrawRow=function(g){var f=parseInt(this._offset);for(var b=0;b<g.tabCount;b++){if(g.childNodes[b].style.display=="none"){continue}g.childNodes[b]._cInd=b;g.childNodes[b].style[this._align]=f+"px";f+=g.childNodes[b]._offsetSize+parseInt(this._margin)}if((g.offsetWidth<f-parseInt(this._margin))||(parseInt(g.childNodes[0].style[this._align])<0)){this._showRowScroller(g)}else{this._hideRowScroller(g)}};dhtmlXTabBar.prototype.removeTab=function(b,g){var b=this.tabsId[b];if(!b){return}if(this._content[b.idd]){this._content[b.idd].parentNode.removeChild(this._content[b.idd]);this._content[b.idd]=null}this._goToAny(b,g);var f=b.parentNode;f.removeChild(b);f.tabCount--;if((f.tabCount==0)&&(this.rows.length>1)){this._removeRow(f)}this.tabsId[b.idd]=null;this._redrawRow(f);this._setSizes()};dhtmlXTabBar.prototype._goToAny=function(b,f){if((this._lastActive)==b){if(convertStringToBoolean(f)){if(null===this.goToPrevTab()){if(null===this.goToNextTab()){this._lastActive=null}}}else{this._lastActive=null}}};dhtmlXTabBar.prototype.addTab=function(b,m,r,k,q){q=q||0;if(this.rows.length<=q){for(var h=this.rows.length;h<=q;h++){this._createRow()}}var l=this.rows[q].tabCount||0;if((!k)&&(k!==0)){k=l}var n=this._getTabStyle(b);var f=this._createTab(m,r,this._TabCloseButton,n);f.idd=b;this.tabsId[b]=f;var p=f.childNodes[2].getElementsByTagName("img")[0];if(this._TabCloseButton&&p){var o=this;p.onclick=function(){if((!o.dhx_tab_close)||(o.dhx_tab_close(b))){o.removeTab(b,true)}}}this.rows[q].insertBefore(f,this.rows[q].childNodes[k]);var g=this.rows[q].tabCount;this.rows[q].tabCount=l+1;if(r=="*"){this.adjustTabSize(f)}if(this._enableAutoRowAdd&&this._checkSizes(this.rows[q])){this.rows[q].tabCount=g;delete this.tabsId[b];this.rows[q].removeChild(f);q++;k=this.rows[q]?this.rows[q].tabCount:0;this.addTab(b,m,r,k,q);return}this._redrawRow(this.rows[q]);this._setSizes()};dhtmlXTabBar.prototype.enableAutoRow=function(b){this._enableAutoRowAdd=convertStringToBoolean(b)};dhtmlXTabBar.prototype.normalize=function(f,k){f=f||this._tabZone.offsetWidth;var l=[];for(var g=0;g<this.rows.length;g++){for(var h=0;h<this.rows[g].tabCount;h++){l[l.length]=this.rows[g].removeChild(this.rows[g].childNodes[0])}}this._tabZone.innerHTML="";this.rows=[];this._createRow();var m=0;var o=this._offset*1;var n=[];this.rows[m].tabCount=0;for(var h=0;h<l.length;h++){if((o+l[h]._offsetSize+this._margin*1)<f){this.rows[m].insertBefore(l[h],this.rows[m].childNodes[this.rows[m].tabCount]);this.rows[m].tabCount++;o+=l[h]._offsetSize+this._margin*1}else{n[m]=o;this._createRow();h--;m++;o=this._offset*1;this.rows[m].tabCount=0;continue}}n[m]=o;if(k){for(var h=1;h<this.rows.length;h++){if(n[h]<n[0]){var b=this.rows[h].childNodes[this.rows[h].tabCount-1];var o=b._offsetSize+(n[0]-n[h]);this.adjustTabSize(b,o)}}}for(var h=0;h<this.rows.length;h++){this._redrawRow(this.rows[h])}this._setSizes()};dhtmlXTabBar.prototype._showHover=function(f){if(f._disabled){return}this._hideHover(f);if(f==this._lastActive){return}var b=this._getTabStyle(f.idd);switch(this._tbst){case"win_text":f._lChild.style.backgroundImage="url("+this._imgPath+this._mode+b[6]+")";break}this._lastHower=f};dhtmlXTabBar.prototype._getTabStyle=function(f){var b=this._styles[this._cstyle];if(b["id_"+f]){b=b["id_"+f]}return b};dhtmlXTabBar.prototype.setCustomStyle=function(k,b,h,g){var f=this._styles[this._cstyle];if(f["id_"+k]){f=f["id_"+k]}else{f=(f["id_"+k]=([]).concat(f))}f[10]=b;f[11]=h;f[13]=g};dhtmlXTabBar.prototype._hideHover=function(f){if((!this._lastHower)||(this._lastHower==f)||(this._lastHower==this._lastActive)){return}var b=this._getTabStyle(this._lastHower.idd);switch(this._tbst){case"win_text":this._lastHower._lChild.style.backgroundImage="url("+this._imgPath+this._mode+b[1]+")";break}this._lastHower=null};dhtmlXTabBar.prototype._getTabById=function(b){return this.tabsId[b]};dhtmlXTabBar.prototype.setTabActive=function(b,g){var f=this._getTabById(b);if(f){this._setTabActive(f,(g===false))}};dhtmlXTabBar.prototype._setTabActive=function(f,g){if(f==this._lastActive){return false}var b=this._styles[this._cstyle];if(b["id_"+f.idd]){b=b["id_"+f.idd]}if((f._disabled)||(f.style.display=="none")){return false}if(((!g)&&this._onsel)&&(!this._onsel(f.idd,this._lastActive?this._lastActive.idd:null))){return false}f.className=f.className.replace(/dhx_tab_element_inactive/g,"dhx_tab_element_active");if(b[11]){f.style.backgroundColor=b[11]}this._setContent(f);this._deactivateTab();if(this._vMode){switch(this._tbst){case"win_text":f._lChild.style.backgroundImage="url("+this._imgPath+this._mode+b[4]+")";f.childNodes[0].childNodes[0].src=this._imgPath+this._mode+b[3];f.childNodes[1].childNodes[0].src=this._imgPath+this._mode+b[5];f.style.height=parseInt(f.style.height)+b[9]+"px";f._lChild.style.height=parseInt(f._lChild.style.height)+b[9]+"px";f.style[this._align=="right"?"marginBottom":"marginTop"]="-3px";f.style.width=this._height+3+"px";if(this._bMode){f._lChild.style.width=this._height+3+"px"}this._conZone.scrollLeft=f._scrollState||0;break}}else{switch(this._tbst){case"win_text":f._lChild.style.backgroundImage="url("+this._imgPath+this._mode+b[4]+")";f.childNodes[0].childNodes[0].src=this._imgPath+this._mode+b[3];f.childNodes[1].childNodes[0].src=this._imgPath+this._mode+b[5];f.style.width=parseInt(f.style.width)+b[9]+"px";f._lChild.style.width=parseInt(f._lChild.style.width)+b[9]+"px";f.style[this._align=="left"?"marginLeft":"marginRight"]="-3px";f.style.height=this._height+3+"px";if(this._bMode){f._lChild.style.height=this._height+3+"px"}this._conZone.scrollTop=f._scrollState||0;break}}this._lastActive=f;return true};dhtmlXTabBar.prototype._setTabBottom=function(g){if(!this._vMode){if(g.parentNode!=this.rows[this.rows.length-1]){this._tabZone.appendChild(g.parentNode)}}var b=new Array();for(var f=0;f<this.rows.length;f++){if(this.rows[f]!=g.parentNode){b[b.length]=this.rows[f]}}b[b.length]=g.parentNode;this.rows=b;if(this._vMode){this.setRowSizesA()}if(this._lineA.parentNode!=this.rows[this.rows.length-1]){this._lineA.parentNode.removeChild(this._lineA);this.rows[this.rows.length-1].appendChild(this._lineA)}};dhtmlXTabBar.prototype._createTab=function(l,g,b,f){var k=document.createElement("DIV");k.className="dhx_tab_element dhx_tab_element_inactive";var h="";if(g=="*"){g="10";k.style.whiteSpace="nowrap"}switch(this._tbst){case"text":h=l;break;case"win_text":if(this._vMode){h='<div style="position:absolute; '+(this._bMode?"right":"left")+":0px; top:0px; height:"+f[7]+"px; width:"+(this._height+3)+'px;"><img src="'+this._imgPath+this._mode+f[0]+((this._bMode&&(_isFF||this._isIE7s||_isOpera))?'" style="position:absolute; right:1px;"':'"')+"></div>";h+='<div style="position:absolute; '+(this._bMode?"right":"left")+":0px; bottom:0px; height:"+f[8]+"px; width:"+(this._height+3)+'px;"><img src="'+this._imgPath+this._mode+f[2]+((this._bMode&&(_isFF||this._isIE7s||_isOpera))?'" style="position:absolute; right:1px;"':'"')+"></div>";h+='<div style="position:absolute; background-repeat: repeat-y; background-image:url('+this._imgPath+this._mode+f[1]+"); width:"+(this._height)+"px; left:0px; top:"+f[7]+"px; height:"+(parseInt(g||this._tabSize)-f[8]-f[7]+"px")+(f[13]?('" class="'+f[13]):"")+'">'+l+"";if(b){h+='<img src="'+(this._imgPath+this._TabCloseButtonSrc)+'" style="cursor:pointer;position:absolute;right:2px;bottom:4px;" onclick="" />'}h+="</div>"}else{h='<div style="position:absolute; '+(this._bMode?"bottom":"top")+":0px; left:0px; width:"+f[7]+"px; height:"+(this._height+3)+'px;"><img src="'+this._imgPath+this._mode+f[0]+((this._bMode&&(_isOpera||_isFF||this._isIE7s))?'" style="position:absolute; bottom:0px;"':'"')+"></div>";h+='<div style="position:absolute;'+(this._bMode?"bottom":"top")+":0px; right:0px; width:"+f[8]+"px; height:"+(this._height+3)+'px;"><img src="'+this._imgPath+this._mode+f[2]+((this._bMode&&(_isOpera||_isFF||this._isIE7s))?'" style="position:absolute; bottom:0px; left:0px;"':'"')+"></div>";h+='<div style="position:absolute; background-repeat: repeat-x; background-image:url('+this._imgPath+this._mode+f[1]+"); height:"+(this._height+(this._bMode?1:3))+"px; top:0px; left:"+f[7]+"px; width:"+(parseInt(g||this._tabSize)-f[8]-f[7]+"px")+';">';if(b){h+='<img src="'+(this._imgPath+this._TabCloseButtonSrc)+'" style="cursor:pointer;position:absolute;right:0px;top:4px;" onclick="" />'}h+='<div style="padding-top:3px;" '+(f[13]?('" class="'+f[13]+'"'):"")+">"+l+"</div>";h+="</div>"}if(!f[10]){k.style.backgroundColor="transparent"}else{k.style.backgroundColor=f[10]}break}k.innerHTML=h;k.style.padding="0px";k._lChild=k.childNodes[k.childNodes.length-1];if(this._vMode){k.style.height=parseInt(g||this._tabSize)+"px";k.style.width=this._height+1+"px"}else{k.style.width=parseInt(g||this._tabSize)+"px";k.style.height=this._height+1+"px"}k._offsetSize=parseInt(g||this._tabSize);return k};dhtmlXTabBar.prototype.adjustTabSize=function(g,f){var b=this._getTabStyle(g.idd);f=f||g.scrollWidth+(this._TabCloseButton?50:20);g.style[this._vMode?"height":"width"]=f+"px";g.childNodes[2].style[this._vMode?"height":"width"]=f-b[8]-b[7]+"px";g._offsetSize=f};dhtmlXTabBar.prototype.clearAll=function(){var b=this._conZone.style.backgroundColor;this._content=new Array();this.tabsId=new Array();this.rows=new Array();this._lastActive=null;this._lastHower=null;this.entBox.innerHTML="";this._glframe=null;this._createSelf(this._vMode);this.setStyle(this._cstyle);if(b){this._conZone.style.backgroundColor=b}this.enableContentZone(this._eczF)};dhtmlXTabBar.prototype.setImagePath=function(b){this._imgPath=b};dhtmlXTabBar.prototype.loadXMLString=function(f,b){this.XMLLoader=new dtmlXMLLoaderObject(this._parseXML,this,true,this.no_cashe);this.XMLLoader.waitCall=b||0;this.XMLLoader.loadXMLString(f)};dhtmlXTabBar.prototype.loadXML=function(b,f){this.XMLLoader=new dtmlXMLLoaderObject(this._parseXML,this,true,this.no_cashe);this.XMLLoader.waitCall=f||0;this.XMLLoader.loadXML(b)};dhtmlXTabBar.prototype._getXMLContent=function(f){var h="";for(var b=0;b<f.childNodes.length;b++){var g=f.childNodes[b];h+=(g.nodeValue===null?"":g.nodeValue)}return h};dhtmlXTabBar.prototype._parseXML=function(s,x,w,v,q){s.clearAll();var o="";if(!q){q=s.XMLLoader}var r=q.getXMLTopNode("tabbar");var t=q.doXPath("//row",r);s._hrfmode=r.getAttribute("hrefmode")||s._hrfmode;s._margin=r.getAttribute("margin")||s._margin;s._align=r.getAttribute("align")||s._align;s._offset=r.getAttribute("offset")||s._offset;var u=r.getAttribute("tabstyle");if(u){s.setStyle(u)}u=r.getAttribute("skinColors");if(u){s.setSkinColors(u.split(",")[0],u.split(",")[1])}for(var p=0;p<t.length;p++){var l=q.doXPath("./tab",t[p]);for(var n=0;n<l.length;n++){var h=l[n].getAttribute("width");var f=s._getXMLContent(l[n]);var g=l[n].getAttribute("id");s.addTab(g,f,h,"",p);if(l[n].getAttribute("selected")){o=g}if(s._hrfmode){s.setContentHref(g,l[n].getAttribute("href"))}else{for(var m=0;m<l[n].childNodes.length;m++){var y=l[n].childNodes[m];if(y.tagName=="content"){if(y.getAttribute("id")){s.setContent(g,y.getAttribute("id"))}else{s.setContentHTML(g,s._getXMLContent(y))}}}}}}if(o){s.setTabActive(o)}if(s.dhx_xml_end){s.dhx_xml_end(s)}};dhtmlXTabBar.prototype.setOnLoadingEnd=function(func){if(typeof(func)=="function"){this.dhx_xml_end=func}else{this.dhx_xml_end=eval(func)}};dhtmlXTabBar.prototype.setOnTabContentLoaded=function(func){if(typeof(func)=="function"){this.dhx_tab_loaded=func}else{this.dhx_tab_loaded=eval(func)}};dhtmlXTabBar.prototype.setOnTabClose=function(func){if(typeof(func)=="function"){this.dhx_tab_close=func}else{this.dhx_tab_close=eval(func)}};dhtmlXTabBar.prototype.forceLoad=function(f,b){var g=this.tabsId[f];if(b){this._hrefs[f]=b}this._content[g.idd]._loaded=false;this._setContent(g,this._lastActive.idd!=f)};dhtmlXTabBar.prototype.setHrefMode=function(b){this._hrfmode=b};dhtmlXTabBar.prototype.setContentHref=function(g,b){if(!this._hrefs){this._hrefs=new Array()}this._hrefs[g]=b;switch(this._hrfmode){case"iframe":if(!this._glframe){var f=document.createElement("DIV");f.className="dhx_tabcontent_sub_zone";f.innerHTML="<iframe frameborder='0' width='100%' height='100%' src='"+this._imgPath+"blank.html' onload='grayOut(false);'></iframe>";this._glframe=f.childNodes[0];this._conZone.appendChild(this._glframe)}return;break;case"iframes":case"iframes-on-demand":var f=document.createElement("DIV");f.className="dhx_tabcontent_sub_zone";f.style.display="none";f.innerHTML="<iframe frameborder='0' width='100%' height='100%' src='"+((this._hrfmode=="iframes")?b:(this._imgPath+"blank.html"))+"' onload='grayOut(false);'></iframe>";this.setContent(g,f);break;case"ajax":case"ajax-html":var f=document.createElement("DIV");f.className="dhx_tabcontent_sub_zone";this.setContent(g,f);break}this._content[g]._loaded=false};dhtmlXTabBar.prototype.tabWindow=function(b){if(this._hrfmode.indexOf("iframe")==0){return(this._content[b]?this._content[b].childNodes[0].contentWindow:null)}};dhtmlXTabBar.prototype._ajaxOnLoad=function(k,h,g,n,f){if(k[0]._hrfmode=="ajax"){var m=f.getXMLTopNode("content");var l=k[0]._getXMLContent(m)}else{var l=f.xmlDoc.responseText}k[0]._resolveContent(k[1],l);k[0].adjustSize();if(k[0].dhx_tab_loaded){k[0].dhx_tab_loaded(k[1])}};dhtmlXTabBar.prototype._resolveContent=function(id,val){var z=val.match(/<script[^>]*>([^<]+)<\/script>/g);if(this._content[id]){this._content[id].innerHTML=val;if(z){for(var i=0;i<z.length;i++){eval(z[i].replace(/<([\/]{0,1})s[^>]*>/g,""))}}}};dhtmlXTabBar.prototype.setOnSelectHandler=function(func){if(typeof(func)=="function"){this._onsel=func}else{this._onsel=eval(func)}};dhtmlXTabBar.prototype.setContent=function(f,b){if(typeof(b)=="string"){b=document.getElementById(b)}if(this._content[f]){this._content[f].parentNode.removeChild(this._content[f])}this._content[f]=b;this._content[f]._loaded=true;if(b.parentNode){b.parentNode.removeChild(b)}b.style.position="absolute";if(this._dspN){b.style.display="none";b.style.visibility="visible"}else{b.style.visibility="hidden";b.style.display="block"}b.style.top="0px";b.style.top="0px";this._conZone.appendChild(b);if((this._lastActive)&&(this._lastActive.idd==f)){this._setContent(this._lastActive)}};dhtmlXTabBar.prototype._setContent=function(b,f){if(this._hrfmode){switch(this._hrfmode){case"iframe":this._glframe.src=this._hrefs[b.idd];return;break;case"iframes":case"iframes-on-demand":if((this._hrfmode=="iframes-on-demand")&&(!this._content[b.idd]._loaded)){this._content[b.idd].childNodes[0].src=this._hrefs[b.idd];this._content[b.idd]._loaded="true"}break;case"ajax":case"ajax-html":var g=this._content[b.idd];if(!g._loaded){g.innerHTML="<div class='dhx_ajax_loader'><img src='"+this._imgPath+"loading.gif' />&nbsp;Loading...</div>";(new dtmlXMLLoaderObject(this._ajaxOnLoad,[this,b.idd],true,this.no_cashe)).loadXML(this._hrefs[b.idd]);g._loaded=true}break}}if(!f){if((this._lastActive)&&(this._content[this._lastActive.idd])){if(this._dspN){this._content[this._lastActive.idd].style.display="none"}else{this._content[this._lastActive.idd].style.visibility="hidden"}}if(this._content[b.idd]){if(this._dspN){this._content[b.idd].style.display="block"}else{this._content[b.idd].style.visibility=""}}}this.adjustSize()};dhtmlXTabBar.prototype.setContentHTML=function(g,b){var f=document.createElement("DIV");f.className="dhx_tabcontent_sub_zone";f.innerHTML=b;this.setContent(g,f)};dhtmlXTabBar.prototype.setStyle=function(b){if(this._styles[b]){this._cstyle=b;if(this._styles[this._cstyle][12]){this._conZone.style.backgroundColor=this._styles[this._cstyle][12]}}};dhtmlXTabBar.prototype.enableContentZone=function(b){this._eczF=convertStringToBoolean(b);this._conZone.style.display=this._eczF?"":"none"};dhtmlXTabBar.prototype.enableForceHiding=function(b){this._dspN=convertStringToBoolean(b)};dhtmlXTabBar.prototype.setSkinColors=function(f,g,b){this._styles[this._cstyle][10]=g;this._styles[this._cstyle][11]=f;this._conZone.style.backgroundColor=b||f};dhtmlXTabBar.prototype.getActiveTab=function(){if(this._lastActive){return this._lastActive.idd}return null};dhtmlXTabBar.prototype._deactivateTab=function(){if(!this._lastActive){return}var b=this._styles[this._cstyle];if(b["id_"+this._lastActive.idd]){b=b["id_"+this._lastActive.idd]}if(b[10]){this._lastActive.style.backgroundColor=b[10]}this._lastActive.className=this._lastActive.className.replace(/dhx_tab_element_active/g,"dhx_tab_element_inactive");if(this._vMode){switch(this._tbst){case"win_text":if(this._lastActive){this._lastActive._scrollState=this._conZone.scrollLeft;this._lastActive._lChild.style.backgroundImage="url("+this._imgPath+this._mode+b[1]+")";this._lastActive.childNodes[0].childNodes[0].src=this._imgPath+this._mode+b[0];this._lastActive.childNodes[1].childNodes[0].src=this._imgPath+this._mode+b[2];this._lastActive.style.height=parseInt(this._lastActive.style.height)-b[9]+"px";this._lastActive._lChild.style.height=parseInt(this._lastActive._lChild.style.height)-b[9]+"px";this._lastActive.style[this._align=="right"?"marginBottom":"marginTop"]="0px";this._lastActive.style.width=this._height+1+"px";if(this._bMode){this._lastActive._lChild.style.width=this._height+1+"px"}}}}else{switch(this._tbst){case"win_text":if(this._lastActive){this._lastActive._scrollState=this._conZone.scrollTop;this._lastActive._lChild.style.backgroundImage="url("+this._imgPath+this._mode+b[1]+")";this._lastActive.childNodes[0].childNodes[0].src=this._imgPath+this._mode+b[0];this._lastActive.childNodes[1].childNodes[0].src=this._imgPath+this._mode+b[2];this._lastActive.style.width=parseInt(this._lastActive.style.width)-b[9]+"px";this._lastActive._lChild.style.width=parseInt(this._lastActive._lChild.style.width)-b[9]+"px";this._lastActive.style[this._align=="left"?"marginLeft":"marginRight"]="0px";this._lastActive.style.height=this._height+1+"px";if(this._bMode){this._lastActive._lChild.style.height=this._height+1+"px"}}}}this._lastActive=null};dhtmlXTabBar.prototype.goToNextTab=function(f){var g=f||this._lastActive;if(g){if(g.nextSibling.idd){if(!this._setTabActive(g.nextSibling)){return this.goToNextTab(g.nextSibling)}return g.nextSibling.idd}else{if(g.parentNode.nextSibling){var b=g.parentNode.nextSibling.childNodes[0];if(!this._setTabActive(b)){return this.goToNextTab(b)}return b.idd}}}return null};dhtmlXTabBar.prototype.goToPrevTab=function(f){var g=f||this._lastActive;if(g){if(g.previousSibling){if(!this._setTabActive(g.previousSibling)){return this.goToPrevTab(g.previousSibling)}return this._lastActive.idd}else{if(g.parentNode.previousSibling){var b=g.parentNode.previousSibling.childNodes;if((!b)||(!b.tabCount)){return null}b=b[b.tabCount-1];if(!this._setTabActive(b)){return this.goToPrevTab(b)}return b.idd}}}return null};dhtmlXTabBar.prototype.enableAutoSize=function(f,b){this._ahdj=convertStringToBoolean(b);this._awdj=convertStringToBoolean(f);if(this._awdj&&this._ahdj){this._conZone.style.overflow="hidden"}else{this._conZone.style.overflow="auto"}};dhtmlXTabBar.prototype.enableAutoReSize=function(f){this._EARS=convertStringToBoolean(f);if(this._EARS){this.entBox.style.overflow="hidden";if(arguments.length==1){if((this.entBox.style.width||"").indexOf("%")==-1){this.entBox.style.width="100%"}if((this.entBox.style.height||"").indexOf("%")==-1){this.entBox.style.height="100%"}}var b=this;if(this.entBox.addEventListener){if((_isFF)&&(_FFrv<1.8)){window.addEventListener("resize",function(){window.setTimeout(function(){b.adjustOuterSize()},10)},false)}else{window.addEventListener("resize",function(){if(b.adjustOuterSize){b.adjustOuterSize()}},false)}}else{if(window.attachEvent){window.attachEvent("onresize",function(){if(b._resize_timer){window.clearTimeout(b._resize_timer)}if(b.adjustOuterSize){b._resize_timer=window.setTimeout(function(){b.adjustOuterSize()},500)}})}}if(this._lineA){this.adjustOuterSize()}}};dhtmlXTabBar.prototype.setSize=function(g,b,h){b=parseInt(b);g=parseInt(g);if(h){if(!this._vMode){b+=20*this.rows.length}else{g+=20*this.rows.length}}this.height=b+"px";this.width=g+"px";this._lineA.style[this._vMode?"left":"top"]=(this._bMode?0:(this._height+2))+"px";this._lineA.style[this._vMode?"height":"width"]=this[this._vMode?"height":"width"];if(this._vMode){for(var f=0;f<this.rows.length;f++){this.rows[f].style.height=parseInt(this.height)+"px"}this._conZone.style.height=b-(_isFF?2:0)+"px"}else{this._conZone.style.width=parseInt(this.width)-(_isFF?2:0)+"px";for(var f=0;f<this.rows.length;f++){this.rows[f].style.width=parseInt(this.width)+"px"}}for(var f=0;f<this.rows.length;f++){this._redrawRow(this.rows[f])}this._setSizes()};dhtmlXTabBar.prototype.adjustOuterSize=function(){if(!this._EARS){return}this.setSize(this.entBox.offsetWidth,this.entBox.offsetHeight,false)};dhtmlXTabBar.prototype.adjustSize=function(){if((!this._ahdj)&&(!this._awdj)){return}var f=false;var b=0;var k=0;for(var h in this._content){var g=this._content[h];if(!g){continue}if((this._ahdj)&&(g.scrollHeight>k)){k=g.scrollHeight+2;f=true}if((this._awdj)&&(g.scrollWidth>b)){b=g.scrollWidth+2;f=true}}if(f){this.setSize(b||this._conZone.offsetWidth,k||this._conZone.offsetHeight,true)}};dhtmlXTabBar.prototype.preventIECashing=function(b){this.no_cashe=convertStringToBoolean(b);if(this.XMLLoader){this.XMLLoader.rSeed=this.no_cashe}};dhtmlXTabBar.prototype.hideTab=function(b,g){var b=this.tabsId[b];if(!b){return}this._goToAny(b,g);b.style.display="none";var f=b.parentNode;this._redrawRow(f)};dhtmlXTabBar.prototype.showTab=function(b){var b=this.tabsId[b];if(!b){return}b.style.display="block";var f=b.parentNode;this._redrawRow(f)};dhtmlXTabBar.prototype.enableTab=function(b){var b=this.tabsId[b];if(!b){return}b._disabled=false;b.className=(b.className||"").replace(/dhx_tab_element_disabled/g,"")};dhtmlXTabBar.prototype.disableTab=function(b,f){var b=this.tabsId[b];if(!b){return}this._goToAny(b,f);b._disabled=true;b.className+=" dhx_tab_element_disabled"};dhtmlXTabBar.prototype.setLabel=function(b,f){var b=this.tabsId[b];if(!b){return}switch(this._tbst){case"text":b.innerHTML=f;break;case"win_text":b.childNodes[2].childNodes[0].innerHTML=f;break}};dhtmlXTabBar.prototype.getLabel=function(b){var b=this.tabsId[b];if(!b){return}switch(this._tbst){case"text":return b.innerHTML;break;case"win_text":return b.childNodes[2].childNodes[0].innerHTML;break}};dhtmlXTabBar.prototype.detachTab=function(b){var p=this.getLabel(b);var g=this.tabsId[b];if(!g){return}var k=this._content[g.idd];g=this._getTabById(b);var n=parseInt(g.style.width);this.removeTab(b,true);k.style.position="";var f=parseInt(this._conZone.style.width)+5;var r=parseInt(this._conZone.style.height)+25;var l=100;var q=50;f=f<l?l:f;r=r<q?q:r;var o=Math.ceil(window.offsetHeight/20-r/20);var h=Math.ceil(window.offsetWidth/20-f/20);var m=new dhtmlxWindow(420,300,f,r,p,false);m._tab_w=n;m.attachContent(k);return m};dhtmlXTabBar.prototype.enableTabCloseButton=function(b){this._TabCloseButton=convertStringToBoolean(b)};var kNoCanonicalCounterpart=0;var kCapitalLetter=0;var kSmallLetter=1;var kDigit=2;var kPunctuation=3;var kAlpha=4;var kCanonicalizeLettersOnly=true;var kCananicalizeEverything=false;var gDebugOutput=null;var kDebugTraceLevelNone=0;var kDebugTraceLevelSuperDetail=120;var kDebugTraceLevelRealDetail=100;var kDebugTraceLevelAll=80;var kDebugTraceLevelMost=60;var kDebugTraceLevelFew=40;var kDebugTraceLevelRare=20;var gDebugTraceLevel=kDebugTraceLevelNone;function DebugPrint(){var f="";if(gDebugTraceLevel&&gDebugOutput&&DebugPrint.arguments&&(DebugPrint.arguments.length>1)&&(DebugPrint.arguments[0]<=gDebugTraceLevel)){for(var b=1;b<DebugPrint.arguments.length;b++){f+=DebugPrint.arguments[b]+" "}f+="<br>\n";gDebugOutput(f)}}function CSimilarityMap(){this.m_elements="";this.m_canonicalCounterparts=""}function SimilarityMap_Add(b,f){this.m_elements+=b;this.m_canonicalCounterparts+=f}function SimilarityMap_Lookup(f){var g=kNoCanonicalCounterpart;var b=this.m_elements.indexOf(f);if(b>=0){g=this.m_canonicalCounterparts.charAt(b)}else{}return g}function SimilarityMap_GetCount(){return this.m_elements.length}CSimilarityMap.prototype.Add=SimilarityMap_Add;CSimilarityMap.prototype.Lookup=SimilarityMap_Lookup;CSimilarityMap.prototype.GetCount=SimilarityMap_GetCount;function CDictionaryEntry(f,b){this.m_length=f;this.m_wordList=b}function DictionaryEntry_Lookup(k){var b=false;if(k.length==this.m_length){var g=0;var f=this.m_wordList.length-1;while(g<=f){var h=Math.floor((g+f)/2);if(k==this.m_wordList[h]){b=true;break}else{if(k>this.m_wordList[h]){f=h-1}else{g=h+1}}}}return b}CDictionaryEntry.prototype.Lookup=DictionaryEntry_Lookup;function CDictionary(){this.m_entries=new Array()}function Dictionary_Lookup(f){for(var b=0;b<this.m_entries.length;b++){if(this.m_entries[b].Lookup(f)){return true}}}function Dictionary_Add(g,f){var b=this.m_entries.length;var h=new CDictionaryEntry(g,f);this.m_entries[b]=h}CDictionary.prototype.Lookup=Dictionary_Lookup;CDictionary.prototype.Add=Dictionary_Add;var gSimilarityMap=new CSimilarityMap();var gDictionary=new CDictionary();function CharacterSetChecks(f,b){this.type=f;this.fResult=b}function isctype(h,g,f){var b=false;switch(g){case kCapitalLetter:if((h>="A")&&(h<="Z")){b=true}break;case kSmallLetter:if((h>="a")&&(h<="z")){b=true}break;case kDigit:if((h>="0")&&(h<="9")){b=true}break;case kPunctuation:if("!@#$%^&*()_+-='\";:[{]}|.>,</?`~".indexOf(h)>=0){b=true}break;case kAlpha:if(isctype(h,kCapitalLetter)||isctype(h,kSmallLetter)){b=true}break;default:break}return b}function CanonicalizeWord(m,f,g){var l=kNoCanonicalCounterpart;var b="";var k=0;if((m!=null)&&(m.length>0)){b=m;b=b.toLowerCase();if(f.GetCount()>0){k=b.length;for(var h=0;h<k;h++){if(g&&!isctype(b.charAt(h),kSmallLetter,kDebugTraceLevelSuperDetail)){continue}l=f.Lookup(b.charAt(h));if(l!=kNoCanonicalCounterpart){b=b.substring(0,h)+l+b.substring(h+1,k)}}}}return b}function IsLongEnough(f,b){if((f==null)||isNaN(b)){return false}else{if(f.length<b){return false}}return true}function SpansEnoughCharacterSets(l,k){var g=0;var b=new Array(new CharacterSetChecks(kCapitalLetter,false),new CharacterSetChecks(kSmallLetter,false),new CharacterSetChecks(kDigit,false),new CharacterSetChecks(kPunctuation,false));if((l==null)||isNaN(k)){return false}for(var f=0;f<l.length;f++){for(var h=0;h<b.length;h++){if(!b[h].fResult&&isctype(l.charAt(f),b[h].type,kDebugTraceLevelAll)){b[h].fResult=true;break}}}for(var h=0;h<b.length;h++){if(b[h].fResult){g++}}if(g<k){return false}return true}function FoundInDictionary(h,f,g){var b="";if((h==null)||(f==null)||(g==null)){return true}b=CanonicalizeWord(h,f,kCanonicalizeLettersOnly);if(g.Lookup(b)){return true}return false}function IsCloseVariationOfAWordInDictionary(k,h,f,l){var g="";var m=0;if((k==null)||isNaN(h)||(f==null)||(l==null)){return true}g=CanonicalizeWord(k,f,kCananicalizeEverything);m=Math.floor((h)*g.length);for(var n=g.length;n>=m;n--){for(var b=0;(b+m)<g.length;b++){var o=g.substr(b,n);if(l.Lookup(o)){return true}}}return false}function Init(){gSimilarityMap.Add("3","e");gSimilarityMap.Add("x","k");gSimilarityMap.Add("5","s");gSimilarityMap.Add("$","s");gSimilarityMap.Add("6","g");gSimilarityMap.Add("7","t");gSimilarityMap.Add("8","b");gSimilarityMap.Add("|","l");gSimilarityMap.Add("9","g");gSimilarityMap.Add("+","t");gSimilarityMap.Add("@","a");gSimilarityMap.Add("0","o");gSimilarityMap.Add("1","l");gSimilarityMap.Add("2","z");gSimilarityMap.Add("!","i");gDictionary.Add(3,"oat|not|ken|keg|ham|hal|gas|cpu|cit|bop|bah".split("|"));gDictionary.Add(4,"zeus|ymca|yang|yaco|work|word|wool|will|viva|vito|vita|visa|vent|vain|uucp|util|utah|unix|trek|town|torn|tina|time|tier|tied|tidy|tide|thud|test|tess|tech|tara|tape|tapa|taos|tami|tall|tale|spit|sole|sold|soil|soft|sofa|soap|slav|slat|slap|slam|shit|sean|saud|sash|sara|sand|sail|said|sago|sage|saga|safe|ruth|russ|rusk|rush|ruse|runt|rung|rune|rove|rose|root|rick|rich|rice|reap|ream|rata|rare|ramp|prod|pork|pete|penn|penh|pend|pass|pang|pane|pale|orca|open|olin|olga|oldy|olav|olaf|okra|okay|ohio|oath|numb|null|nude|note|nosy|nose|nita|next|news|ness|nasa|mike|mets|mess|math|mash|mary|mars|mark|mara|mail|maid|mack|lyre|lyra|lyon|lynx|lynn|lucy|love|lose|lori|lois|lock|lisp|lisa|leah|lass|lash|lara|lank|lane|lana|kink|keri|kemp|kelp|keep|keen|kate|karl|june|judy|judo|judd|jody|jill|jean|jane|isis|iowa|inna|holm|help|hast|half|hale|hack|gust|gush|guru|gosh|gory|golf|glee|gina|germ|gatt|gash|gary|game|fred|fowl|ford|flea|flax|flaw|finn|fink|film|fill|file|erin|emit|elmo|easy|done|disk|disc|diet|dial|dawn|dave|data|derek|damn|dame|crab|cozy|coke|city|cite|chem|chat|cats|burl|bred|bill|bilk|bile|bike|beth|beta|benz|beau|bath|bass|bart|bank|bake|bait|bail|aria|anne|anna|andy|alex|abcd".split("|"));gDictionary.Add(5,"yacht|xerox|wilma|willy|wendy|wendi|water|warez|vitro|vital|vitae|vista|visor|vicky|venus|venom|value|ultra|u.s.a|tubas|tress|tramp|trait|tracy|traci|toxic|tiger|tidal|thumb|texas|test2|test1|terse|terry|tardy|tappa|tapis|tapir|taper|tanya|tansy|tammy|tamie|taint|sybil|suzie|susie|susan|super|steph|stacy|staci|spark|sonya|sonia|solar|soggy|sofia|smile|slave|slate|slash|slant|slang|simon|shiva|shell|shark|sharc|shack|scrim|screw|scott|scorn|score|scoot|scoop|scold|scoff|saxon|saucy|satan|sasha|sarah|sandy|sable|rural|rupee|runty|runny|runic|runge|rules|ruben|royal|route|rouse|roses|rolex|robyn|robot|robin|ridge|rhode|revel|renee|ranch|rally|radio|quark|quake|quail|power|polly|polis|polio|pluto|plane|pizza|photo|phone|peter|perry|penna|penis|paula|patty|parse|paris|parch|paper|panic|panel|olive|olden|okapi|oasis|oaken|nurse|notre|notch|nancy|nagel|mouse|moose|mogul|modem|merry|megan|mckee|mckay|mcgee|mccoy|marty|marni|mario|maria|marcy|marci|maint|maine|magog|magic|lyric|lyons|lynne|lynch|louis|lorry|loris|lorin|loren|linda|light|lewis|leroy|laura|later|lasso|laser|larry|ladle|kinky|keyes|kerry|kerri|kelly|keith|kazoo|kayla|kathy|karie|karen|julie|julia|joyce|jenny|jenni|japan|janie|janet|james|irene|inane|impel|idaho|horus|horse|honey|honda|holly|hello|heidi|hasty|haste|hamal|halve|haley|hague|hager|hagen|hades|guest|guess|gucci|group|grahm|gouge|gorse|gorky|glean|gleam|glaze|ghoul|ghost|gauss|gauge|gaudy|gator|gases|games|freer|fovea|float|fiona|finny|filly|field|erika|erica|enter|enemy|empty|emily|email|elmer|ellis|ellen|eight|eerie|edwin|edges|eatme|earth|eager|dulce|donor|donna|diane|diana|delay|defoe|david|danny|daisy|cuzco|cubit|cozen|coypu|coyly|cowry|condo|class|cindy|cigar|chess|cathy|carry|carol|carla|caret|caren|candy|candi|burma|burly|burke|brian|breed|borax|booze|booty|bloom|blood|bitch|bilge|bilbo|betty|beryl|becky|beach|bathe|batch|basic|bantu|banks|banjo|baird|baggy|azure|arrow|array|april|anita|angie|amber|amaze|alpha|alisa|alike|align|alice|alias|album|alamo|aires|admin|adept|adele|addle|addis|added|acura|abyss|abcde|1701d|123go|!@#$%".split("|"));gDictionary.Add(6,"yankee|yamaha|yakima|y7u8i9|xyzxyz|wombat|wizard|wilson|willie|weenie|warren|visual|virgin|viking|venous|venice|venial|vasant|vagina|ursula|urchin|uranus|uphill|umpire|u.s.a.|tuttle|trisha|trails|tracie|toyota|tomato|toggle|tidbit|thorny|thomas|terror|tennis|taylor|target|tardis|tappet|taoist|tannin|tanner|tanker|tamara|system|surfer|summer|subway|stacie|stacey|spring|sondra|solemn|soleil|solder|solace|soiree|soften|soffit|sodium|sodden|snoopy|snatch|smooch|smiles|slavic|slater|single|singer|simple|sherri|sharon|sharks|sesame|sensor|secret|second|season|search|scroll|scribe|scotty|scooby|schulz|school|scheme|saturn|sandra|sandal|saliva|saigon|sahara|safety|safari|sadism|saddle|sacral|russel|runyon|runway|runoff|runner|ronald|romano|rodent|ripple|riddle|ridden|reveal|return|remote|recess|recent|realty|really|reagan|raster|rascal|random|radish|radial|racoon|racket|racial|rachel|rabbit|qwerty|qawsed|puppet|puneet|public|prince|presto|praise|poster|polite|polish|policy|police|plover|pierre|phrase|photon|philip|persia|peoria|penmen|penman|pencil|peanut|parrot|parent|pardon|papers|pander|pamela|pallet|palace|oxford|outlaw|osiris|orwell|oregon|oracle|olivia|oliver|olefin|office|notion|notify|notice|notate|notary|noreen|nobody|nicole|newton|nevada|mutant|mozart|morley|monica|moguls|minsky|mickey|merlin|memory|mellon|meagan|mcneil|mcleod|mclean|mckeon|mchugh|mcgraw|mcgill|mccann|mccall|mccabe|mayfly|maxine|master|massif|maseru|marvin|markus|malcom|mailer|maiden|magpie|magnum|magnet|maggot|lorenz|lisbon|limpid|leslie|leland|latest|latera|latent|lascar|larkin|langur|landis|landau|lambda|kristy|kristi|krista|knight|kitten|kinney|kerrie|kernel|kermit|kennan|kelvin|kelsey|kelley|keller|keenan|katina|karina|kansas|juggle|judith|jsbach|joshua|joseph|johnny|joanne|joanna|jixian|jimmie|jimbob|jester|jeanne|jasmin|janice|jaguar|jackie|island|invest|instar|ingrid|ingres|impute|holmes|holman|hockey|hidden|hawaii|hasten|harvey|harold|hamlin|hamlet|halite|halide|haggle|haggis|hadron|hadley|hacker|gustav|gusset|gurkha|gurgle|guntis|guitar|gamlyn|gospel|gorton|gorham|gorges|golfer|glassy|ginger|gibson|ghetto|german|george|gauche|gasify|gambol|gamble|gambit|friend|freest|fourth|format|flower|flaxen|flaunt|flakes|finley|finite|fillip|fillet|filler|filled|fermat|fender|fatten|fatima|fathom|father|evelyn|euclid|estate|enzyme|engine|employ|emboss|elanor|elaine|eileen|eighty|eighth|effect|efface|eeyore|eerily|edwina|easier|durkin|durkee|during|durham|duress|duncan|donner|donkey|donate|donald|domino|disney|dieter|device|denise|deluge|delete|debbie|deaden|ddurer|dapper|daniel|dancer|damask|dakota|daemon|cuvier|cuddly|cuddle|cuckoo|cretin|create|cozier|coyote|cowpox|cooper|cookie|connie|coneck|condom|coffee|citrus|citron|citric|circus|charon|change|censor|cement|celtic|cecily|cayuga|catnip|catkin|cation|castle|carson|carrot|carrie|carole|carmen|caress|cantor|burley|burlap|buried|burial|brenda|bremen|breezy|breeze|breech|brandy|brandi|border|borden|borate|bloody|bishop|bilbao|bikini|bigred|betsie|berman|berlin|bedbug|became|beavis|beaver|beauty|beater|batman|bathos|barony|barber|baobab|bantus|banter|bantam|banish|bangui|bangor|bangle|bandit|banana|bakery|bailey|bahama|bagley|badass|aztecs|azsxdc|athena|asylum|arthur|arrest|arrear|arrack|arlene|anvils|answer|angela|andrea|anchor|analog|amazon|amanda|alison|alight|alicia|albino|albert|albeit|albany|alaska|adrian|adelia|adduce|addict|addend|accrue|access|abcdef|abcabc|abc123|a1b2c3|a12345|@#$%^&|7y8u9i|1qw23e|1q2w3e|1p2o3i|1a2b3c|123abc|10sne1|0p9o8i|!@#$%^".split("|"));gDictionary.Add(7,"yolanda|wyoming|winston|william|whitney|whiting|whatnot|vitriol|vitrify|vitiate|vitamin|visitor|village|vertigo|vermont|venturi|venture|ventral|venison|valerie|utility|upgrade|unknown|unicorn|unhappy|trivial|torrent|tinfoil|tiffany|tidings|thunder|thistle|theresa|test123|terrify|teleost|tarbell|taproot|tapping|tapioca|tantrum|tantric|tanning|takeoff|swearer|suzanne|susanne|support|success|student|squires|sossina|soldier|sojourn|soignee|sodding|smother|slavish|slavery|slander|shuttle|shivers|shirley|sheldon|shannon|service|seattle|scooter|scissor|science|scholar|scamper|satisfy|sarcasm|salerno|sailing|saguaro|saginaw|sagging|saffron|sabrina|russell|rupture|running|runneth|rosebud|receipt|rebecca|realtor|raleigh|rainbow|quarrel|quality|qualify|pumpkin|protect|program|profile|profess|profane|private|prelude|porsche|politic|playboy|phoenix|persona|persian|perseus|perseid|perplex|penguin|pendant|parapet|panoply|panning|panicle|panicky|pangaea|pandora|palette|pacific|olivier|olduvai|oldster|okinawa|oakwood|nyquist|nursery|numeric|number1|nullify|nucleus|nuclear|notused|nothing|newyork|network|neptune|montana|minimum|michele|michael|merriam|mercury|melissa|mcnulty|mcnally|mcmahon|mckenna|mcguire|mcgrath|mcgowan|mcelroy|mcclure|mcclain|mccarty|mcbride|mcadams|mbabane|mayoral|maurice|marimba|manhole|manager|mammoth|malcolm|malaria|mailbox|magnify|magneto|losable|lorinda|loretta|lorelei|lockout|lioness|limpkin|library|lazarus|lathrop|lateran|lateral|kristin|kristie|kristen|kinsman|kingdom|kennedy|kendall|kellogg|keelson|katrina|jupiter|judaism|judaica|jessica|janeiro|inspire|inspect|insofar|ingress|indiana|include|impetus|imperil|holmium|holmdel|herbert|heather|headmen|headman|harmony|handily|hamburg|halifax|halibut|halfway|haggard|hafnium|hadrian|gustave|gunther|gunshot|gryphon|gosling|goshawk|gorilla|gleason|glacier|ghostly|germane|georgia|geology|gaseous|gascony|gardner|gabriel|freeway|fourier|flowers|florida|fishers|finnish|finland|ferrari|felicia|feather|fatigue|fairway|express|expound|emulate|empress|empower|emitted|emerald|embrace|embower|ellwood|ellison|egghead|durward|durrell|drought|donning|donahue|digital|develop|desiree|default|deborah|damming|cynthia|cyanate|cutworm|cutting|cuddles|cubicle|crystal|coxcomb|cowslip|cowpony|cowpoke|console|conquer|connect|comrade|compton|collins|cluster|claudia|classic|citroen|citrate|citizen|citadel|cistern|christy|chester|charles|charity|celtics|celsius|catlike|cathode|carroll|carrion|careful|carbine|carbide|caraway|caravan|camille|burmese|burgess|bridget|breccia|bradley|bopping|blondie|bilayer|beverly|bernard|bermuda|berlitz|berlioz|beowulf|beloved|because|beatnik|beatles|beatify|bassoon|bartman|baroque|barbara|baptism|banshee|banquet|bannock|banning|bananas|bainite|bailiff|bahrein|bagpipe|baghdad|bagging|bacchus|asshole|arrange|arraign|arragon|arizona|ariadne|annette|animals|anatomy|anatole|amatory|amateur|amadeus|allison|alimony|aliases|algebra|albumin|alberto|alberta|albania|alameda|aladdin|alabama|airport|airpark|airfoil|airflow|airfare|airdrop|adenoma|adenine|address|addison|accrual|acclaim|academy|abcdefg|!@#$%^&".split("|"));gDictionary.Add(8,"yosemite|y7u8i9o0|wormwood|woodwind|whistler|whatever|warcraft|vitreous|virginia|veronica|venomous|trombone|transfer|tortoise|tientsin|tideland|ticklish|thailand|testtest|tertiary|terrific|terminal|telegram|tarragon|tapeworm|tapestry|tanzania|tantalus|tantalum|sysadmin|symmetry|sunshine|strangle|startrek|springer|sparrows|somebody|solecism|soldiery|softwood|software|softball|socrates|slatting|slapping|slapdash|slamming|simpsons|serenity|security|schwartz|sanctity|sanctify|samantha|salesman|sailfish|sailboat|sagittal|sagacity|sabotage|rushmore|rosemary|rochelle|robotics|reverend|regional|raindrop|rachelle|qwertyui|qwerasdf|qawsedrf|q1w2e3r4|protozoa|prodding|princess|precious|politics|politico|plymouth|pershing|penitent|penelope|pendulum|patricia|password|passport|paranoia|panorama|panicked|pandemic|pandanus|pakistan|painless|operator|olivetti|oleander|oklahoma|notocord|notebook|notarize|nebraska|napoleon|missouri|michigan|michelle|mesmeric|mercedes|mcmullen|mcmillan|mcknight|mckinney|mckinley|mckesson|mckenzie|mcintyre|mcintosh|mcgregor|mcgovern|mcginnis|mcfadden|mcdowell|mcdonald|mcdaniel|mcconnel|mccauley|mccarthy|mccallum|mayapple|masonite|maryland|marjoram|marinate|marietta|maneuver|mandamus|maledict|maladapt|magnuson|magnolia|magnetic|lyrebird|lymphoma|lorraine|lionking|linoleum|limitate|limerick|laterite|landmass|landmark|landlord|landlady|landhold|landfill|kristine|kirkland|kingston|kimberly|khartoum|keystone|kentucky|keeshond|kathrine|kathleen|jubilant|joystick|jennifer|jacobsen|irishman|interpol|internet|insulate|instinct|instable|insomnia|insolent|insolate|inactive|imperial|iloveyou|illinois|hydrogen|hutchins|homework|hologram|holocene|hibernia|hiawatha|heinlein|hebrides|headlong|headline|headland|hastings|hamilton|halftone|halfback|hagstrom|gunsling|gunpoint|gumption|gorgeous|glaucous|glaucoma|glassine|ginnegan|ghoulish|gertrude|geometry|geometer|garfield|gamesman|gamecock|fungible|function|frighten|freetown|foxglove|fourteen|foursome|forsythe|football|flaxseed|flautist|flatworm|flatware|fidelity|exposure|eternity|enthrone|enthrall|enthalpy|entendre|entangle|engineer|emulsion|emulsify|emporium|employer|employee|employed|emmanuel|elliptic|elephant|einstein|eighteen|duration|donnelly|dominion|dlmhurst|delegate|delaware|december|deadwood|deadlock|deadline|deadhead|danielle|cyanamid|cucumber|cristina|criminal|creosote|creation|cowpunch|couscous|conquest|comrades|computer|comprise|compress|colorado|clusters|citation|charming|cerulean|cenozoic|cemetery|cellular|catskill|cationic|catholic|cathodic|catheter|cascades|carriage|caroline|carolina|carefree|cardinal|burgundy|burglary|bumbling|broadway|breeches|bordello|bordeaux|bilinear|bilabial|bernardo|berliner|berkeley|bedazzle|beaumont|beatrice|beatific|bathrobe|baronial|baritone|bankrupt|banister|bakelite|azsxdcfv|asdfqwer|arkansas|appraise|apposite|anything|angerine|ancestry|ancestor|anatomic|anathema|ambiance|alphabet|albright|albrecht|alberich|albacore|alastair|alacrity|airspace|airplane|airfield|airedale|aircraft|airbrush|airborne|aerobics|adrianna|adelaide|additive|addition|addendum|accouter|academic|academia|abcdefgh|abcd1234|a1b2c3d4|7y8u9i0o|7890yuio|1234qwer|0p9o8i7u|0987poiu|!@#$%^&*".split("|"));gDictionary.Add(9,"zimmerman|worldwide|wisconsin|wholesale|vitriolic|ventricle|ventilate|valentine|tidewater|testament|territory|tennessee|telephone|telepathy|teleology|telemetry|telemeter|telegraph|tarantula|tarantara|tangerine|supported|superuser|stuttgart|stratford|stephanie|solemnity|softcover|slaughter|slapstick|signature|sheffield|sarcastic|sanctuary|sagebrush|sagacious|runnymede|rochester|receptive|reception|racketeer|professor|princeton|pondering|politburo|policemen|policeman|persimmon|persevere|persecute|percolate|peninsula|penetrate|pendulous|paralytic|panoramic|panicking|panhandle|oligopoly|oligocene|oligarchy|olfactory|oldenburg|nutrition|nurturant|notorious|notoriety|minnesota|microsoft|mcpherson|mcfarland|mcdougall|mcdonnell|mcdermott|mccracken|mccormick|mcconnell|mccluskey|mcclellan|marijuana|malicious|magnitude|magnetron|magnetite|macintosh|lynchburg|louisiana|lissajous|limousine|limnology|landscape|landowner|kinshasha|kingsbury|kibbutzim|kennecott|jamestown|ironstone|invisible|invention|intuitive|intervene|intersect|inspector|insomniac|insolvent|insoluble|impetuous|imperious|imperfect|holocaust|hollywood|hollyhock|headphone|headlight|headdress|headcount|headboard|happening|hamburger|halverson|gustafson|gunpowder|glasswort|glassware|ghostlike|geometric|gaucherie|freewheel|freethink|freestone|foresight|foolproof|extension|expositor|establish|entertain|employing|emittance|ellsworth|elizabeth|eightieth|eightfold|eiderdown|dusenbury|dusenberg|donaldson|dominique|discovery|desperate|delegable|delectate|decompose|decompile|damnation|cutthroat|crabapple|cornelius|conqueror|connubial|commrades|citizenry|christine|christina|chemistry|cellulose|celluloid|catherine|carryover|burlesque|bloodshot|bloodshed|bloodroot|bloodline|bloodbath|bilingual|bilateral|bijective|bijection|bernadine|berkshire|beethoven|beatitude|bakhtiari|asymptote|asymmetry|apprehend|appraisal|apportion|ancestral|anatomist|alexander|albatross|alabaster|alabamian|adenosine|abcabcabc".split("|"));gDictionary.Add(10,"washington|volkswagen|topography|tessellate|temptation|telephonic|telepathic|telemetric|telegraphy|tantamount|superstage|slanderous|salamander|qwertyuiop|polynomial|politician|phrasemake|photometry|photolytic|photolysis|photogenic|phosphorus|phosphoric|persiflage|persephone|perquisite|peninsular|penicillin|penetrable|panjandrum|oligoclase|oligarchic|oldsmobile|nottingham|noticeable|noteworthy|mcnaughton|mclaughlin|mccullough|mcallister|malconduct|maidenhair|limitation|lascivious|landowning|landlubber|landlocked|lamination|khrushchev|juggernaut|irrational|invariable|insouciant|insolvable|incomplete|impervious|impersonal|headmaster|glaswegian|geopolitic|geophysics|fourteenth|foursquare|expressive|expression|expository|exposition|enterprise|eightyfold|eighteenth|effaceable|donnybrook|delectable|decolonize|cuttlefish|cuttlebone|compromise|compressor|comprehend|cellophane|carruthers|california|burlington|burgundian|borderline|borderland|bloodstone|bloodstain|bloodhound|bijouterie|biharmonic|bernardino|beaujolais|basketball|bankruptcy|bangladesh|atmosphere|asymptotic|asymmetric|appreciate|apposition|ambassador|amateurish|alimentary|additional|accomplish|1q2w3e4r5t".split("|"));gDictionary.Add(11,"yellowstone|venturesome|territorial|telekinesis|sagittarius|safekeeping|politicking|policewoman|photometric|photography|phosphorous|perseverant|persecutory|persecution|penitential|pandemonium|mississippi|marketplace|magnificent|irremovable|interrogate|institution|inspiration|incompetent|impertinent|impersonate|impermeable|headquarter|hamiltonian|halfhearted|hagiography|geophysical|expressible|emptyhanded|eigenvector|deleterious|decollimate|decolletage|connecticut|comptroller|compressive|compression|catholicism|bloodstream|bakersfield|arrangeable|appreciable|anastomotic|albuquerque".split("|"));gDictionary.Add(12,"williamsburg|testamentary|qwerasdfzxcv|q1w2e3r4t5y6|perseverance|pennsylvania|penitentiary|malformation|liquefaction|interstitial|inconclusive|incomputable|incompletion|incompatible|incomparable|imperishable|impenetrable|headquarters|geometrician|ellipsometry|decomposable|decommission|compressible|burglarproof|bloodletting|bilharziasis|asynchronous|asymptomatic|ambidextrous|1q2w3e4r5t6y".split("|"));gDictionary.Add(13,"ventriloquist|ventriloquism|poliomyelitis|phosphorylate|oleomargarine|massachusetts|jitterbugging|interpolatory|inconceivable|imperturbable|impermissible|decomposition|comprehensive|comprehension".split("|"));gDictionary.Add(14,"slaughterhouse|irreproducible|incompressible|comprehensible|bremsstrahlung".split("|"));gDictionary.Add(15,"irreconciliable|instrumentation|incomprehension".split("|"));gDictionary.Add(16,"incomprehensible".split("|"))}function ClientSideStrongPassword(){return(IsLongEnough(ClientSideStrongPassword.arguments[0],"8")&&SpansEnoughCharacterSets(ClientSideStrongPassword.arguments[0],"3")&&(!(IsCloseVariationOfAWordInDictionary(ClientSideStrongPassword.arguments[0],"0.6",ClientSideStrongPassword.arguments[1],ClientSideStrongPassword.arguments[2]))))}function ClientSideBestPassword(){return(IsLongEnough(ClientSideBestPassword.arguments[0],"14")&&SpansEnoughCharacterSets(ClientSideBestPassword.arguments[0],"3")&&(!(IsCloseVariationOfAWordInDictionary(ClientSideBestPassword.arguments[0],"0.6",ClientSideBestPassword.arguments[1],ClientSideBestPassword.arguments[2]))))}function ClientSideMediumPassword(){return(IsLongEnough(ClientSideMediumPassword.arguments[0],"8")&&SpansEnoughCharacterSets(ClientSideMediumPassword.arguments[0],"2")&&(!(FoundInDictionary(ClientSideMediumPassword.arguments[0],ClientSideMediumPassword.arguments[1],ClientSideMediumPassword.arguments[2]))))}function ClientSideWeakPassword(){return(IsLongEnough(ClientSideWeakPassword.arguments[0],"1")||(!(IsLongEnough(ClientSideWeakPassword.arguments[0],"0"))))}function GEId(b){return document.getElementById(b)}function EvalPwdStrength(f,b){if(ClientSideBestPassword(b,gSimilarityMap,gDictionary)){DispPwdStrength(4,"pwdChkCon4")}else{if(ClientSideStrongPassword(b,gSimilarityMap,gDictionary)){DispPwdStrength(3,"pwdChkCon3")}else{if(ClientSideMediumPassword(b,gSimilarityMap,gDictionary)){DispPwdStrength(2,"pwdChkCon2")}else{if(ClientSideWeakPassword(b,gSimilarityMap,gDictionary)){DispPwdStrength(1,"pwdChkCon1")}else{DispPwdStrength(0,"pwdChkCon0")}}}}}function PadPasswd(f,h){if(typeof f.PwdPad=="object"){var b="djg";var g=b.length-h;f.PwdPad.value=b.substr(0,(g<0)?0:g)}}function DispPwdStrength(h,f){if(h>4){h=4}for(var g=0;g<5;g++){var b="pwdChkCon0";if(g<=h){b=f}if(g>0){GEId("idSM"+g).className=b}GEId("idSMT"+g).style.display=((g==h)?"inline":"none")}}Calendar=function(h,g,l,b){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=l||null;this.onClose=b||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof h=="number"?h:Calendar._FD;this.showsOtherMonths=false;this.dateStr=g;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var f=new Array();for(var k=8;k>0;){f[--k]=Calendar._DN[k].substr(0,Calendar._SDN_len)}Calendar._SDN=f;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}f=new Array();for(var k=12;k>0;){f[--k]=Calendar._MN[k].substr(0,Calendar._SMN_len)}Calendar._SMN=f}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(k){var b=0,h=0;var g=/^div$/i.test(k.tagName);if(g&&k.scrollLeft){b=k.scrollLeft}if(g&&k.scrollTop){h=k.scrollTop}var l={x:k.offsetLeft-b,y:k.offsetTop-h};if(k.offsetParent){var f=this.getAbsolutePos(k.offsetParent);l.x+=f.x;l.y+=f.y}return l};Calendar.isRelated=function(g,b){var h=b.relatedTarget;if(!h){var f=b.type;if(f=="mouseover"){h=b.fromElement}else{if(f=="mouseout"){h=b.toElement}}}while(h){if(h==g){return true}h=h.parentNode}return false};Calendar.removeClass=function(k,h){if(!(k&&k.className)){return}var b=k.className.split(" ");var f=new Array();for(var g=b.length;g>0;){if(b[--g]!=h){f[f.length]=b[g]}}k.className=f.join(" ")};Calendar.addClass=function(f,b){Calendar.removeClass(f,b);f.className+=" "+b};Calendar.getElement=function(b){var g=Calendar.is_ie?window.event.srcElement:b.currentTarget;while(g.nodeType!=1||/^div$/i.test(g.tagName)){g=g.parentNode}return g};Calendar.getTargetElement=function(b){var g=Calendar.is_ie?window.event.srcElement:b.target;while(g.nodeType!=1){g=g.parentNode}return g};Calendar.stopEvent=function(b){b||(b=window.event);if(Calendar.is_ie){b.cancelBubble=true;b.returnValue=false}else{b.preventDefault();b.stopPropagation()}return false};Calendar.addEvent=function(b,g,f){if(b.attachEvent){b.attachEvent("on"+g,f)}else{if(b.addEventListener){b.addEventListener(g,f,true)}else{b["on"+g]=f}}};Calendar.removeEvent=function(b,g,f){if(b.detachEvent){b.detachEvent("on"+g,f)}else{if(b.removeEventListener){b.removeEventListener(g,f,true)}else{b["on"+g]=null}}};Calendar.createElement=function(g,f){var b=null;if(document.createElementNS){b=document.createElementNS("http://www.w3.org/1999/xhtml",g)}else{b=document.createElement(g)}if(typeof f!="undefined"){f.appendChild(b)}return b};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(b){if(typeof b.month!="undefined"){return b}else{if(typeof b.parentNode.month!="undefined"){return b.parentNode}}return null};Calendar.findYear=function(b){if(typeof b.year!="undefined"){return b}else{if(typeof b.parentNode.year!="undefined"){return b.parentNode}}return null};Calendar.showMonthsCombo=function(){var k=Calendar._C;if(!k){return false}var k=k;var l=k.activeDiv;var h=k.monthsCombo;if(k.hilitedMonth){Calendar.removeClass(k.hilitedMonth,"hilite")}if(k.activeMonth){Calendar.removeClass(k.activeMonth,"active")}var g=k.monthsCombo.getElementsByTagName("div")[k.date.getMonth()];Calendar.addClass(g,"active");k.activeMonth=g;var f=h.style;f.display="block";if(l.navtype<0){f.left=l.offsetLeft+"px"}else{var b=h.offsetWidth;if(typeof b=="undefined"){b=50}f.left=(l.offsetLeft+l.offsetWidth-b)+"px"}f.top=(l.offsetTop+l.offsetHeight)+"px"};Calendar.showYearsCombo=function(h){var b=Calendar._C;if(!b){return false}var b=b;var g=b.activeDiv;var l=b.yearsCombo;if(b.hilitedYear){Calendar.removeClass(b.hilitedYear,"hilite")}if(b.activeYear){Calendar.removeClass(b.activeYear,"active")}b.activeYear=null;var f=b.date.getFullYear()+(h?1:-1);var o=l.firstChild;var n=false;for(var k=12;k>0;--k){if(f>=b.minYear&&f<=b.maxYear){o.innerHTML=f;o.year=f;o.style.display="block";n=true}else{o.style.display="none"}o=o.nextSibling;f+=h?b.yearStep:-b.yearStep}if(n){var p=l.style;p.display="block";if(g.navtype<0){p.left=g.offsetLeft+"px"}else{var m=l.offsetWidth;if(typeof m=="undefined"){m=50}p.left=(g.offsetLeft+g.offsetWidth-m)+"px"}p.top=(g.offsetTop+g.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(s){var b=Calendar._C;if(!b){return}var g=b.activeDiv;var o=Calendar.getTargetElement(s);if(o==g||o.parentNode==g){Calendar.addClass(g,"hilite active");Calendar.addClass(g.parentNode,"rowhilite")}else{if(typeof g.navtype=="undefined"||(g.navtype!=50&&(g.navtype==0||Math.abs(g.navtype)>2))){Calendar.removeClass(g,"active")}Calendar.removeClass(g,"hilite");Calendar.removeClass(g.parentNode,"rowhilite")}s||(s=window.event);if(g.navtype==50&&o!=g){var r=Calendar.getAbsolutePos(g);var u=g.offsetWidth;var t=s.clientX;var v;var q=true;if(t>r.x+u){v=t-r.x-u;q=false}else{v=r.x-t}if(v<0){v=0}var l=g._range;var n=g._current;var m=Math.floor(v/10)%l.length;for(var k=l.length;--k>=0;){if(l[k]==n){break}}while(m-->0){if(q){if(--k<0){k=l.length-1}}else{if(++k>=l.length){k=0}}}var f=l[k];g.innerHTML=f;b.onUpdateTime()}var h=Calendar.findMonth(o);if(h){if(h.month!=b.date.getMonth()){if(b.hilitedMonth){Calendar.removeClass(b.hilitedMonth,"hilite")}Calendar.addClass(h,"hilite");b.hilitedMonth=h}else{if(b.hilitedMonth){Calendar.removeClass(b.hilitedMonth,"hilite")}}}else{if(b.hilitedMonth){Calendar.removeClass(b.hilitedMonth,"hilite")}var p=Calendar.findYear(o);if(p){if(p.year!=b.date.getFullYear()){if(b.hilitedYear){Calendar.removeClass(b.hilitedYear,"hilite")}Calendar.addClass(p,"hilite");b.hilitedYear=p}else{if(b.hilitedYear){Calendar.removeClass(b.hilitedYear,"hilite")}}}else{if(b.hilitedYear){Calendar.removeClass(b.hilitedYear,"hilite")}}}return Calendar.stopEvent(s)};Calendar.tableMouseDown=function(b){if(Calendar.getTargetElement(b)==Calendar.getElement(b)){return Calendar.stopEvent(b)}};Calendar.calDragIt=function(f){var g=Calendar._C;if(!(g&&g.dragging)){return false}var k;var h;if(Calendar.is_ie){h=window.event.clientY+document.body.scrollTop;k=window.event.clientX+document.body.scrollLeft}else{k=f.pageX;h=f.pageY}g.hideShowCovered();var b=g.element.style;b.left=(k-g.xOffs)+"px";b.top=(h-g.yOffs)+"px";return Calendar.stopEvent(f)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(b){Calendar.cellClick(Calendar.getElement(b),b||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(f){var b=Calendar.getElement(f);if(Calendar.isRelated(b,f)||Calendar._C||b.disabled){return false}if(b.ttip){if(b.ttip.substr(0,1)=="_"){b.ttip=b.caldate.print(b.calendar.ttDateFormat)+b.ttip.substr(1)}b.calendar.tooltips.innerHTML=b.ttip}if(b.navtype!=300){Calendar.addClass(b,"hilite");if(b.caldate){Calendar.addClass(b.parentNode,"rowhilite")}}return Calendar.stopEvent(f)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(k,t){var g=k.calendar;var n=false;var q=false;var l=null;if(typeof k.navtype=="undefined"){if(g.currentDateEl){Calendar.removeClass(g.currentDateEl,"selected");Calendar.addClass(k,"selected");n=(g.currentDateEl==k);if(!n){g.currentDateEl=k}}g.date.setDateOnly(k.caldate);l=g.date;var f=!(g.dateClicked=!k.otherMonth);if(!f&&!g.currentDateEl){g._toggleMultipleDate(new Date(l))}else{q=!k.disabled}if(f){g._init(g.firstDayOfWeek,l)}}else{if(k.navtype==200){Calendar.removeClass(k,"hilite");g.callCloseHandler();return}l=new Date(g.date);if(k.navtype==0){l.setDateOnly(new Date())}g.dateClicked=false;var s=l.getFullYear();var m=l.getMonth();function b(w){var x=l.getDate();var v=l.getMonthDays(w);if(x>v){l.setDate(v)}l.setMonth(w)}switch(k.navtype){case 400:Calendar.removeClass(k,"hilite");var u=Calendar._TT.ABOUT;if(typeof u!="undefined"){u+=g.showsTime?Calendar._TT.ABOUT_TIME:""}else{u='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(u);return;case -2:if(s>g.minYear){l.setFullYear(s-1)}break;case -1:if(m>0){b(m-1)}else{if(s-->g.minYear){l.setFullYear(s);b(11)}}break;case 1:if(m<11){b(m+1)}else{if(s<g.maxYear){l.setFullYear(s+1);b(0)}}break;case 2:if(s<g.maxYear){l.setFullYear(s+1)}break;case 100:g.setFirstDayOfWeek(k.fdow);return;case 50:var p=k._range;var r=k.innerHTML;for(var o=p.length;--o>=0;){if(p[o]==r){break}}if(t&&t.shiftKey){if(--o<0){o=p.length-1}}else{if(++o>=p.length){o=0}}var h=p[o];k.innerHTML=h;g.onUpdateTime();return;case 0:if((typeof g.getDateStatus=="function")&&g.getDateStatus(l,l.getFullYear(),l.getMonth(),l.getDate())){return false}break}if(!l.equalsTo(g.date)){g.setDate(l);q=true}else{if(k.navtype==0){q=n=true}}}if(q){t&&g.callHandler()}if(n){Calendar.removeClass(k,"hilite");t&&g.callCloseHandler()}};Calendar.prototype.create=function(r){var q=null;if(!r){q=document.getElementsByTagName("body")[0];this.isPopup=true}else{q=r;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var u=Calendar.createElement("table");this.table=u;u.cellSpacing=0;u.cellPadding=0;u.calendar=this;Calendar.addEvent(u,"mousedown",Calendar.tableMouseDown);var b=Calendar.createElement("div");this.element=b;b.className="calendar";if(this.isPopup){b.style.position="absolute";b.style.display="none"}b.appendChild(u);var o=Calendar.createElement("thead",u);var s=null;var v=null;var f=this;var k=function(y,x,w){s=Calendar.createElement("td",v);s.colSpan=x;s.className="button";if(w!=0&&Math.abs(w)<=2){s.className+=" nav"}Calendar._add_evs(s);s.calendar=f;s.navtype=w;s.innerHTML="<div unselectable='on'>"+y+"</div>";return s};v=Calendar.createElement("tr",o);var g=6;(this.isPopup)&&--g;(this.weekNumbers)&&++g;k("?",1,400).ttip=Calendar._TT.INFO;this.title=k("",g,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";k("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}v=Calendar.createElement("tr",o);v.className="headrow";this._nav_py=k("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=k("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=k(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=k("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=k("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;v=Calendar.createElement("tr",o);v.className="daynames";if(this.weekNumbers){s=Calendar.createElement("td",v);s.className="name wn";s.innerHTML=Calendar._TT.WK}for(var n=7;n>0;--n){s=Calendar.createElement("td",v);if(!n){s.navtype=100;s.calendar=this;Calendar._add_evs(s)}}this.firstdayname=(this.weekNumbers)?v.firstChild.nextSibling:v.firstChild;this._displayWeekdays();var m=Calendar.createElement("tbody",u);this.tbody=m;for(n=6;n>0;--n){v=Calendar.createElement("tr",m);if(this.weekNumbers){s=Calendar.createElement("td",v)}for(var l=7;l>0;--l){s=Calendar.createElement("td",v);s.calendar=this;Calendar._add_evs(s)}}if(this.showsTime){v=Calendar.createElement("tr",m);v.className="time";s=Calendar.createElement("td",v);s.className="time";s.colSpan=2;s.innerHTML=Calendar._TT.TIME||"&nbsp;";s=Calendar.createElement("td",v);s.className="time";s.colSpan=this.weekNumbers?4:3;(function(){function z(K,M,L,N){var I=Calendar.createElement("span",s);I.className=K;I.innerHTML=M;I.calendar=f;I.ttip=Calendar._TT.TIME_PART;I.navtype=50;I._range=[];if(typeof L!="number"){I._range=L}else{for(var J=L;J<=N;++J){var H;if(J<10&&N>=10){H="0"+J}else{H=""+J}I._range[I._range.length]=H}}Calendar._add_evs(I);return I}var E=f.date.getHours();var w=f.date.getMinutes();var F=!f.time24;var x=(E>12);if(F&&x){E-=12}var C=z("hour",E,F?1:0,F?12:23);var A=Calendar.createElement("span",s);A.innerHTML=":";A.className="colon";var y=z("minute",w,0,59);var D=null;s=Calendar.createElement("td",v);s.className="time";s.colSpan=2;if(F){D=z("ampm",x?"pm":"am",["am","pm"])}else{s.innerHTML="&nbsp;"}f.onSetTime=function(){var I,H=this.date.getHours(),J=this.date.getMinutes();if(F){I=(H>=12);if(I){H-=12}if(H==0){H=12}D.innerHTML=I?"pm":"am"}C.innerHTML=(H<10)?("0"+H):H;y.innerHTML=(J<10)?("0"+J):J};f.onUpdateTime=function(){var I=this.date;var J=parseInt(C.innerHTML,10);if(F){if(/pm/i.test(D.innerHTML)&&J<12){J+=12}else{if(/am/i.test(D.innerHTML)&&J==12){J=0}}}var K=I.getDate();var H=I.getMonth();var L=I.getFullYear();I.setHours(J);I.setMinutes(parseInt(y.innerHTML,10));I.setFullYear(L);I.setMonth(H);I.setDate(K);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var p=Calendar.createElement("tfoot",u);v=Calendar.createElement("tr",p);v.className="footrow";s=k(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);s.className="ttip";if(this.isPopup){s.ttip=Calendar._TT.DRAG_TO_MOVE;s.style.cursor="move"}this.tooltips=s;b=Calendar.createElement("div",this.element);this.monthsCombo=b;b.className="combo";for(n=0;n<Calendar._MN.length;++n){var h=Calendar.createElement("div");h.className=Calendar.is_ie?"label-IEfix":"label";h.month=n;h.innerHTML=Calendar._SMN[n];b.appendChild(h)}b=Calendar.createElement("div",this.element);this.yearsCombo=b;b.className="combo";for(n=12;n>0;--n){var t=Calendar.createElement("div");t.className=Calendar.is_ie?"label-IEfix":"label";b.appendChild(t)}this._init(this.firstDayOfWeek,this.date);q.appendChild(this.element)};Calendar._keyEvent=function(q){var b=window._dynarch_popupCalendar;if(!b||b.multiple){return false}(Calendar.is_ie)&&(q=window.event);var o=(Calendar.is_ie||q.type=="keypress"),r=q.keyCode;if(q.ctrlKey){switch(r){case 37:o&&Calendar.cellClick(b._nav_pm);break;case 38:o&&Calendar.cellClick(b._nav_py);break;case 39:o&&Calendar.cellClick(b._nav_nm);break;case 40:o&&Calendar.cellClick(b._nav_ny);break;default:return false}}else{switch(r){case 32:Calendar.cellClick(b._nav_now);break;case 27:o&&b.callCloseHandler();break;case 37:case 38:case 39:case 40:if(o){var k,s,p,m,g,h;k=r==37||r==38;h=(r==37||r==39)?1:7;function f(){g=b.currentDateEl;var t=g.pos;s=t&15;p=t>>4;m=b.ar_days[p][s]}f();function l(){var t=new Date(b.date);t.setDate(t.getDate()-h);b.setDate(t)}function n(){var t=new Date(b.date);t.setDate(t.getDate()+h);b.setDate(t)}while(1){switch(r){case 37:if(--s>=0){m=b.ar_days[p][s]}else{s=6;r=38;continue}break;case 38:if(--p>=0){m=b.ar_days[p][s]}else{l();f()}break;case 39:if(++s<7){m=b.ar_days[p][s]}else{s=0;r=40;continue}break;case 40:if(++p<b.ar_days.length){m=b.ar_days[p][s]}else{n();f()}break}break}if(m){if(!m.disabled){Calendar.cellClick(m)}else{if(k){l()}else{n()}}}}break;case 13:if(o){Calendar.cellClick(b.currentDateEl,q)}break;default:return false}}return Calendar.stopEvent(q)};Calendar.prototype._init=function(r,C){var A=new Date(),v=A.getFullYear(),E=A.getMonth(),f=A.getDate();this.table.style.visibility="hidden";var n=C.getFullYear();if(n<this.minYear){n=this.minYear;C.setFullYear(n)}else{if(n>this.maxYear){n=this.maxYear;C.setFullYear(n)}}this.firstDayOfWeek=r;this.date=new Date(C);var D=C.getMonth();var H=C.getDate();var F=C.getMonthDays();C.setDate(1);var w=(C.getDay()-this.firstDayOfWeek)%7;if(w<0){w+=7}C.setDate(-w);C.setDate(C.getDate()+1);var k=this.tbody.firstChild;var p=Calendar._SMN[D];var t=this.ar_days=new Array();var s=Calendar._TT.WEEKEND;var h=this.multiple?(this.datesCells={}):null;for(var y=0;y<6;++y,k=k.nextSibling){var b=k.firstChild;if(this.weekNumbers){b.className="day wn";b.innerHTML=C.getWeekNumber();b=b.nextSibling}k.className="daysrow";var z=false,l,g=t[y]=[];for(var x=0;x<7;++x,b=b.nextSibling,C.setDate(l+1)){l=C.getDate();var m=C.getDay();b.className="day";b.pos=y<<4|x;g[x]=b;var q=(C.getMonth()==D);if(!q){if(this.showsOtherMonths){b.className+=" othermonth";b.otherMonth=true}else{b.className="emptycell";b.innerHTML="&nbsp;";b.disabled=true;continue}}else{b.otherMonth=false;z=true}b.disabled=false;b.innerHTML=this.getDateText?this.getDateText(C,l):l;if(h){h[C.print("%Y%m%d")]=b}if(this.getDateStatus){var u=this.getDateStatus(C,n,D,l);if(this.getDateToolTip){var o=this.getDateToolTip(C,n,D,l);if(o){b.title=o}}if(u===true){b.className+=" disabled";b.disabled=true}else{if(/disabled/i.test(u)){b.disabled=true}b.className+=" "+u}}if(!b.disabled){b.caldate=new Date(C);b.ttip="_";if(!this.multiple&&q&&l==H&&this.hiliteToday){b.className+=" selected";this.currentDateEl=b}if(C.getFullYear()==v&&C.getMonth()==E&&l==f){b.className+=" today";b.ttip+=Calendar._TT.PART_TODAY}if(s.indexOf(m.toString())!=-1){b.className+=b.otherMonth?" oweekend":" weekend"}}}if(!(z||this.showsOtherMonths)){k.className="emptyrow"}}this.title.innerHTML=Calendar._MN[D]+", "+n;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var f in this.multiple){var b=this.datesCells[f];var g=this.multiple[f];if(!g){continue}if(b){b.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(f){if(this.multiple){var g=f.print("%Y%m%d");var b=this.datesCells[g];if(b){var h=this.multiple[g];if(!h){Calendar.addClass(b,"selected");this.multiple[g]=f}else{Calendar.removeClass(b,"selected");delete this.multiple[g]}}}};Calendar.prototype.setDateToolTipHandler=function(b){this.getDateToolTip=b};Calendar.prototype.setDate=function(b){if(!b.equalsTo(this.date)){this._init(this.firstDayOfWeek,b)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(b){this._init(b,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(b){this.getDateStatus=b};Calendar.prototype.setRange=function(b,f){this.minYear=b;this.maxYear=f};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var b=this.element.parentNode;b.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(f){var b=this.element;b.parentNode.removeChild(b);f.appendChild(b)};Calendar._checkCalendar=function(f){var g=window._dynarch_popupCalendar;if(!g){return false}var b=Calendar.is_ie?Calendar.getElement(f):Calendar.getTargetElement(f);for(;b!=null&&b!=g.element;b=b.parentNode){}if(b==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(f)}};Calendar.prototype.show=function(){var k=this.table.getElementsByTagName("tr");for(var h=k.length;h>0;){var l=k[--h];Calendar.removeClass(l,"rowhilite");var g=l.getElementsByTagName("td");for(var f=g.length;f>0;){var b=g[--f];Calendar.removeClass(b,"hilite");Calendar.removeClass(b,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(b,g){var f=this.element.style;f.left=b+"px";f.top=g+"px";this.show()};Calendar.prototype.showAtElement=function(g,h){var b=this;var k=Calendar.getAbsolutePos(g);if(!h||typeof h!="string"){this.showAt(k.x,k.y+g.offsetHeight);return true}function f(o){if(o.x<0){o.x=0}if(o.y<0){o.y=0}var p=document.createElement("div");var n=p.style;n.position="absolute";n.right=n.bottom=n.width=n.height="0px";document.body.appendChild(p);var m=Calendar.getAbsolutePos(p);document.body.removeChild(p);if(Calendar.is_ie){m.y+=document.body.scrollTop;m.x+=document.body.scrollLeft}else{m.y+=window.scrollY;m.x+=window.scrollX}var l=o.x+o.width-m.x;if(l>0){o.x-=l}l=o.y+o.height-m.y;if(l>0){o.y-=l}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var l=b.element.offsetWidth;var n=b.element.offsetHeight;b.element.style.display="none";var m=h.substr(0,1);var o="l";if(h.length>1){o=h.substr(1,1)}switch(m){case"T":k.y-=n;break;case"B":k.y+=g.offsetHeight;break;case"C":k.y+=(g.offsetHeight-n)/2;break;case"t":k.y+=g.offsetHeight-n;break;case"b":break}switch(o){case"L":k.x-=l;break;case"R":k.x+=g.offsetWidth;break;case"C":k.x+=(g.offsetWidth-l)/2;break;case"l":k.x+=g.offsetWidth-l;break;case"r":break}k.width=l;k.height=n+40;b.monthsCombo.style.display="none";f(k);b.showAt(k.x,k.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10)}else{Calendar.continuation_for_the_fucking_khtml_browser()}};Calendar.prototype.setDateFormat=function(b){this.dateFormat=b};Calendar.prototype.setTtDateFormat=function(b){this.ttDateFormat=b};Calendar.prototype.parseDate=function(f,b){if(!b){b=this.dateFormat}this.setDate(Date.parseDate(f,b))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return}function f(p){var k=p.style.visibility;if(!k){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){k=document.defaultView.getComputedStyle(p,"").getPropertyValue("visibility")}else{k=""}}else{if(p.currentStyle){k=p.currentStyle.visibility}else{k=""}}}return k}var x=new Array("applet","iframe","select");var g=this.element;var b=Calendar.getAbsolutePos(g);var m=b.x;var h=g.offsetWidth+m;var w=b.y;var v=g.offsetHeight+w;for(var o=x.length;o>0;){var n=document.getElementsByTagName(x[--o]);var l=null;for(var r=n.length;r>0;){l=n[--r];b=Calendar.getAbsolutePos(l);var u=b.x;var t=l.offsetWidth+u;var s=b.y;var q=l.offsetHeight+s;if(this.hidden||(u>h)||(t<m)||(s>v)||(q<w)){if(!l.__msh_save_visibility){l.__msh_save_visibility=f(l)}l.style.visibility=l.__msh_save_visibility}else{if(!l.__msh_save_visibility){l.__msh_save_visibility=f(l)}l.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var f=this.firstDayOfWeek;var b=this.firstdayname;var h=Calendar._TT.WEEKEND;for(var g=0;g<7;++g){b.className="day name";var k=(g+f)%7;if(g){b.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[k]);b.navtype=100;b.calendar=this;b.fdow=k;Calendar._add_evs(b)}if(h.indexOf(k.toString())!=-1){Calendar.addClass(b,"weekend")}b.innerHTML=Calendar._SDN[(g+f)%7];b=b.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(o,f){var p=new Date();var q=0;var g=-1;var n=0;var s=o.split(/\W+/);var r=f.match(/%./g);var l=0,k=0;var u=0;var h=0;for(l=0;l<s.length;++l){if(!s[l]){continue}switch(r[l]){case"%d":case"%e":n=parseInt(s[l],10);break;case"%m":g=parseInt(s[l],10)-1;break;case"%Y":case"%y":q=parseInt(s[l],10);(q<100)&&(q+=(q>29)?1900:2000);break;case"%b":case"%B":for(k=0;k<12;++k){if(Calendar._MN[k].substr(0,s[l].length).toLowerCase()==s[l].toLowerCase()){g=k;break}}break;case"%H":case"%h":case"%k":case"%l":u=parseInt(s[l],10);break;case"%P":case"%p":if(/pm/i.test(s[l])&&u<12){u+=12}else{if(/am/i.test(s[l])&&u>=12){u-=12}}break;case"%i":h=parseInt(s[l],10);break}}if(isNaN(q)){q=p.getFullYear()}if(isNaN(g)){g=p.getMonth()}if(isNaN(n)){n=p.getDate()}if(isNaN(u)){u=p.getHours()}if(isNaN(h)){h=p.getMinutes()}if(q!=0&&g!=-1&&n!=0){return new Date(q,g,n,u,h,0)}q=0;g=-1;n=0;for(l=0;l<s.length;++l){if(s[l].search(/[a-zA-Z]+/)!=-1){var v=-1;for(k=0;k<12;++k){if(Calendar._MN[k].substr(0,s[l].length).toLowerCase()==s[l].toLowerCase()){v=k;break}}if(v!=-1){if(g!=-1){n=g+1}g=v}}else{if(parseInt(s[l],10)<=12&&g==-1){g=s[l]-1}else{if(parseInt(s[l],10)>31&&q==0){q=parseInt(s[l],10);(q<100)&&(q+=(q>29)?1900:2000)}else{if(n==0){n=s[l]}}}}}if(q==0){q=p.getFullYear()}if(g!=-1&&n!=0){return new Date(q,g,n,u,h,0)}return p};Date.prototype.getMonthDays=function(f){var b=this.getFullYear();if(typeof f=="undefined"){f=this.getMonth()}if(((0==(b%4))&&((0!=(b%100))||(0==(b%400))))&&f==1){return 29}else{return Date._MD[f]}};Date.prototype.getDayOfYear=function(){var b=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var g=new Date(this.getFullYear(),0,0,0,0,0);var f=b-g;return Math.floor(f/Date.DAY)};Date.prototype.getWeekNumber=function(){var g=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var f=g.getDay();g.setDate(g.getDate()-(f+6)%7+3);var b=g.valueOf();g.setMonth(0);g.setDate(4);return Math.round((b-g.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(b){return((this.getFullYear()==b.getFullYear())&&(this.getMonth()==b.getMonth())&&(this.getDate()==b.getDate())&&(this.getHours()==b.getHours())&&(this.getMinutes()==b.getMinutes()))};Date.prototype.setDateOnly=function(b){var f=new Date(b);this.setDate(1);this.setFullYear(f.getFullYear());this.setMonth(f.getMonth());this.setDate(f.getDate())};Date.prototype.print=function(p){var b=this.getMonth();var o=this.getDate();var q=this.getFullYear();var t=this.getWeekNumber();var u=this.getDay();var A={};var v=this.getHours();var f=(v>=12);var l=(f)?(v-12):v;var z=this.getDayOfYear();if(l==0){l=12}var g=this.getMinutes();var n=this.getSeconds();A["%a"]=Calendar._SDN[u];A["%A"]=Calendar._DN[u];A["%b"]=Calendar._SMN[b];A["%B"]=Calendar._MN[b];A["%C"]=1+Math.floor(q/100);A["%d"]=(o<10)?("0"+o):o;A["%e"]=o;A["%H"]=(v<10)?("0"+v):v;A["%h"]=(l<10)?("0"+l):l;A["%j"]=(z<100)?((z<10)?("00"+z):("0"+z)):z;A["%k"]=v;A["%l"]=l;A["%m"]=(b<9)?("0"+(1+b)):(1+b);A["%i"]=(g<10)?("0"+g):g;A["%n"]="\n";A["%p"]=f?"PM":"AM";A["%P"]=f?"pm":"am";A["%S"]=(n<10)?("0"+n):n;A["%s"]=A["%S"];A["%t"]="\t";A["%U"]=A["%W"]=A["%V"]=(t<10)?("0"+t):t;A["%u"]=u+1;A["%w"]=u;A["%y"]=(""+q).substr(2,2);A["%Y"]=q;A["%%"]="%";var x=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return p.replace(x,function(m){return A[m]||m})}var r=p.match(x);for(var k=0;k<r.length;k++){var h=A[r[k]];if(h){x=new RegExp(r[k],"g");p=p.replace(x,h)}}return p};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(f){var b=new Date(this);b.__msh_oldSetFullYear(f);if(b.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(f)};window._dynarch_popupCalendar=null;Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.DRAG_TO_MOVE="Drag to move";Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";Calendar.setup=function(m){function l(n,o){if(typeof m[n]=="undefined"){m[n]=o}}l("inputField",null);l("displayArea",null);l("button",null);l("eventName","click");l("ifFormat","%Y/%m/%d");l("daFormat","%Y/%m/%d");l("singleClick",true);l("disableFunc",null);l("dateStatusFunc",m.disableFunc);l("dateText",null);l("firstDay",null);l("align","Br");l("range",[1900,2999]);l("weekNumbers",true);l("flat",null);l("flatCallback",null);l("onSelect",null);l("onClose",null);l("onUpdate",null);l("date",null);l("showsTime",false);l("timeFormat","24");l("electric",true);l("step",2);l("position",null);l("cache",false);l("showOthers",false);l("multiple",null);var g=["inputField","displayArea","button"];for(var f in g){if(typeof m[g[f]]=="string"){m[g[f]]=document.getElementById(m[g[f]])}}if(!(m.flat||m.multiple||m.inputField||m.displayArea||m.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function b(o){var n=o.params;var q=(o.dateClicked||n.electric);if(q&&n.inputField){n.inputField.value=o.date.print(n.ifFormat);if(typeof n.inputField.onchange=="function"){n.inputField.onchange()}}if(q&&n.displayArea){n.displayArea.innerHTML=o.date.print(n.daFormat)}if(q&&typeof n.onUpdate=="function"){n.onUpdate(o)}if(q&&n.flat){if(typeof n.flatCallback=="function"){n.flatCallback(o)}}if(q&&n.singleClick&&o.dateClicked){o.callCloseHandler()}}if(m.flat!=null){if(typeof m.flat=="string"){m.flat=document.getElementById(m.flat)}if(!m.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var k=new Calendar(m.firstDay,m.date,m.onSelect||b);k.showsOtherMonths=m.showOthers;k.showsTime=m.showsTime;k.time24=(m.timeFormat=="24");k.params=m;k.weekNumbers=m.weekNumbers;k.setRange(m.range[0],m.range[1]);k.setDateStatusHandler(m.dateStatusFunc);k.getDateText=m.dateText;if(m.ifFormat){k.setDateFormat(m.ifFormat)}if(m.inputField&&typeof m.inputField.value=="string"){k.parseDate(m.inputField.value)}k.create(m.flat);k.show();return false}var h=m.button||m.displayArea||m.inputField;h["on"+m.eventName]=function(){var n=m.inputField||m.displayArea;var p=m.inputField?m.ifFormat:m.daFormat;var t=false;var r=window.calendar;if(n){m.date=Date.parseDate(n.value||n.innerHTML,p)}if(!(r&&m.cache)){window.calendar=r=new Calendar(m.firstDay,m.date,m.onSelect||b,m.onClose||function(u){u.hide()});r.showsTime=m.showsTime;r.time24=(m.timeFormat=="24");r.weekNumbers=m.weekNumbers;t=true}else{if(m.date){r.setDate(m.date)}r.hide()}if(m.multiple){r.multiple={};for(var o=m.multiple.length;--o>=0;){var s=m.multiple[o];var q=s.print("%Y%m%d");r.multiple[q]=s}}r.showsOtherMonths=m.showOthers;r.yearStep=m.step;r.setRange(m.range[0],m.range[1]);r.params=m;r.setDateStatusHandler(m.dateStatusFunc);r.getDateText=m.dateText;r.setDateFormat(p);if(t){r.create()}r.refresh();if(!m.position){r.showAtElement(m.button||m.displayArea||m.inputField,m.align)}else{r.showAt(m.position[0],m.position[1])}return false};return k};if(typeof Effect=="undefined"){throw ("lightwindow.js requires including script.aculo.us' effects.js library!")}try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}var lightwindow=Class.create();lightwindow.prototype={element:null,contentToFetch:null,windowActive:false,dataEffects:[],dimensions:{cruft:null,container:null,viewport:{height:null,width:null,offsetTop:null,offsetLeft:null}},pagePosition:{x:0,y:0},pageDimensions:{width:null,height:null},preloadImage:[],preloadedImage:[],galleries:[],resizeTo:{height:null,heightPercent:null,width:null,widthPercent:null,fixedTop:null,fixedLeft:null},scrollbarOffset:18,navigationObservers:{previous:null,next:null},containerChange:{height:0,width:0},activeGallery:false,galleryLocation:{current:0,total:0},initialize:function(b){this.options=Object.extend({resizeSpeed:8,contentOffset:{height:20,width:20},dimensions:{image:{height:250,width:250},page:{height:250,width:250},inline:{height:250,width:250},media:{height:250,width:250},external:{height:250,width:250},titleHeight:25},classNames:{standard:"lightwindow",action:"lightwindow_action"},fileTypes:{page:["asp","aspx","cgi","cfm","htm","html","pl","php4","php3","php","php5","phtml","rhtml","shtml","txt","vbs","rb"],media:["aif","aiff","asf","avi","divx","m1v","m2a","m2v","m3u","mid","midi","mov","moov","movie","mp2","mp3","mpa","mpa","mpe","mpeg","mpg","mpg","mpga","pps","qt","rm","ram","swf","viv","vivo","wav"],image:["bmp","gif","jpg","png","tiff","jpeg"]},mimeTypes:{avi:"video/avi",aif:"audio/aiff",aiff:"audio/aiff",gif:"image/gif",bmp:"image/bmp",jpeg:"image/jpeg",m1v:"video/mpeg",m2a:"audio/mpeg",m2v:"video/mpeg",m3u:"audio/x-mpequrl",mid:"audio/x-midi",midi:"audio/x-midi",mjpg:"video/x-motion-jpeg",moov:"video/quicktime",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"audio/mpeg",mp3:"audio/mpeg3",mpa:"audio/mpeg",mpa:"video/mpeg",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"audio/mpeg",mpg:"video/mpeg",mpga:"audio/mpeg",pdf:"application/pdf",png:"image/png",pps:"application/mspowerpoint",qt:"video/quicktime",ram:"audio/x-pn-realaudio-plugin",rm:"application/vnd.rn-realmedia",swf:"application/x-shockwave-flash",tiff:"image/tiff",viv:"video/vivo",vivo:"video/vivo",wav:"audio/wav",wmv:"application/x-mplayer2"},classids:{mov:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",swf:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",wmv:"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"},codebases:{mov:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",swf:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",wmv:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"},viewportPadding:10,EOLASFix:"swf,wmv,fla,flv",overlay:{opacity:0.7,image:"/images/lightwindow/black.png",presetImage:"/images/lightwindow/black-70.png"},skin:{main:'<div id="lightwindow_container" ><div id="lightwindow_title_bar" ><div id="lightwindow_title_bar_inner" ><a id="lightwindow_title_bar_close_link" ></a></div></div><div id="lightwindow_stage" ><div id="lightwindow_contents" ></div><div id="lightwindow_navigation" ><a href="#" id="lightwindow_previous" ><span id="lightwindow_previous_title"></span></a><a href="#" id="lightwindow_next" ><span id="lightwindow_next_title"></span></a><iframe name="lightwindow_navigation_shim" id="lightwindow_navigation_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div><div id="lightwindow_galleries"><div id="lightwindow_galleries_tab_container" ><a href="#" id="lightwindow_galleries_tab" ><span id="lightwindow_galleries_tab_span" class="up" >Galleries</span></a></div><div id="lightwindow_galleries_list" ></div></div></div><div id="lightwindow_data_slide" ><div id="lightwindow_data_slide_inner" ><div id="lightwindow_data_details" ><div id="lightwindow_data_gallery_container" ><span id="lightwindow_data_gallery_current"></span> of <span id="lightwindow_data_gallery_total"></span></div><div id="lightwindow_data_author_container" >by <span id="lightwindow_data_author"></span></div></div><div id="lightwindow_data_caption" ></div></div></div><div id="lightwindow_title_bar"><div id="lightwindow_title_bar_innertitle"><span id="lightwindow_title_bar_title"></span></div></div></div>',loading:'<div id="lightwindow_loading" ><img src="/images/lightwindow/ajax-loading.gif" alt="loading" /><span>Loading or <a href="javascript: myLightWindow.deactivate();">Cancel</a></span><iframe name="lightwindow_loading_shim" id="lightwindow_loading_shim" src="javascript:false;" frameBorder="0" scrolling="no"></iframe></div>',iframe:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><body>{body_replace}</body></html>',gallery:{top:'<div class="lightwindow_galleries_list"><h1>{gallery_title_replace}</h1><ul>',middle:"<li>{gallery_link_replace}</li>",bottom:"</ul></div>"}},formMethod:"get",hideFlash:false,hideGalleryTab:true,showTitleBar:true,animationHandler:false,navigationHandler:false,transitionHandler:false,finalAnimationHandler:false,formHandler:false,galleryAnimationHandler:false,showGalleryCount:true},b||{});this.duration=((11-this.options.resizeSpeed)*0.15);this._setupLinks();this._getScroll();this._getPageDimensions();this._browserDimensions();this._addLightWindowMarkup(false);this._setupDimensions();this.buildGalleryList()},activate:function(f,b){this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(b);this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},deactivate:function(){this.windowActive=false;this.activeGallery=false;if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false)}this.animating=false;this.element=null;this._displayLightWindow("none","visible");this._clearWindowContents(false);var b=Effect.Queues.get("lightwindowAnimation").each(function(f){f.cancel()});this._prepareIE(false);this._setupDimensions();this._toggleTroubleElements("visible",false);this._monitorKeyboard(false)},createWindow:function(f,b){this._processLink($(f))},activateWindow:function(b){this.element=Object.extend({href:null,title:"",author:null,caption:null,rel:null,top:null,left:null,type:null,showImages:null,height:null,width:null,loadingAnimation:null,iframeEmbed:null,form:null},b||{});this.contentToFetch=this.element.href;this.windowType=this.element.type?this.element.type:this._fileType(this.element.href);this._clearWindowContents(true);this._addLoadingWindowMarkup();this._getScroll();this._browserDimensions();this._setupDimensions();this._toggleTroubleElements("hidden",false);this._displayLightWindow("block","hidden");this._setStatus(true);this._monitorKeyboard(true);this._prepareIE(true);this._loadWindow()},submitForm:function(b){if(this.options.formHandler){this.options.formHandler(b)}else{this._defaultFormHandler(b)}},openWindow:function(b){var b=$(b);this.windowActive=true;this._clearWindowContents(true);this._addLoadingWindowMarkup();this._setupWindowElements(b);this._setStatus(true);this._handleTransition()},navigateWindow:function(b){this._handleNavigation(false);if(b=="previous"){this.openWindow(this.navigationObservers.previous)}else{if(b=="next"){this.openWindow(this.navigationObservers.next)}}},buildGalleryList:function(){var b="";var f;for(i in this.galleries){if(typeof this.galleries[i]=="object"){b+=(this.options.skin.gallery.top).replace("{gallery_title_replace}",unescape(i));for(j in this.galleries[i]){if(typeof this.galleries[i][j]=="object"){f='<a href="#" id="lightwindow_gallery_'+i+"_"+j+'" >'+unescape(j)+"</a>";b+=(this.options.skin.gallery.middle).replace("{gallery_link_replace}",f)}}b+=this.options.skin.gallery.bottom}}new Insertion.Top("lightwindow_galleries_list",b);for(i in this.galleries){if(typeof this.galleries[i]=="object"){for(j in this.galleries[i]){if(typeof this.galleries[i][j]=="object"){Event.observe($("lightwindow_gallery_"+i+"_"+j),"click",this.openWindow.bind(this,this.galleries[i][j][0]),false);$("lightwindow_gallery_"+i+"_"+j).onclick=function(){return false}}}}}},_setupLinks:function(){var b=$$("."+this.options.classNames.standard);b.each(function(f){this._processLink(f)}.bind(this))},_processLink:function(g){if((this._fileType(g.getAttribute("href"))=="image"||this._fileType(g.getAttribute("href"))=="media")){if(gallery=this._getGalleryInfo(g.rel)){if(!this.galleries[gallery[0]]){this.galleries[gallery[0]]=new Array()}if(!this.galleries[gallery[0]][gallery[1]]){this.galleries[gallery[0]][gallery[1]]=new Array()}this.galleries[gallery[0]][gallery[1]].push(g)}}var f=g.getAttribute("href");if(f.indexOf("?")>-1){f=f.substring(0,f.indexOf("?"))}var b=f.substring(f.indexOf("#")+1);if($(b)){$(b).setStyle({display:"none"})}Event.observe(g,"click",this.activate.bindAsEventListener(this,g),false);g.onclick=function(){return false}},_setupActions:function(){var b=$$("#lightwindow_container ."+this.options.classNames.action);b.each(function(f){Event.observe(f,"click",this[f.getAttribute("rel")].bindAsEventListener(this,f),false);f.onclick=function(){return false}}.bind(this))},_addLightWindowMarkup:function(f){var g=Element.extend(document.createElement("div"));g.setAttribute("id","lightwindow_overlay");if(Prototype.Browser.Gecko){g.setStyle({opacity:this.options.overlay.opacity,backgroundImage:"url("+this.options.overlay.presetImage+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"})}else{g.setStyle({opacity:this.options.overlay.opacity,backgroundImage:"url("+this.options.overlay.image+")",backgroundRepeat:"repeat",height:this.pageDimensions.height+"px"})}var h=document.createElement("div");h.setAttribute("id","lightwindow");h.innerHTML=this.options.skin.main;var b=document.getElementsByTagName("body")[0];b.appendChild(g);b.appendChild(h);if($("lightwindow_title_bar_close_link")){Event.observe("lightwindow_title_bar_close_link","click",this.deactivate.bindAsEventListener(this));$("lightwindow_title_bar_close_link").onclick=function(){return false}}Event.observe($("lightwindow_previous"),"click",this.navigateWindow.bind(this,"previous"),false);$("lightwindow_previous").onclick=function(){return false};Event.observe($("lightwindow_next"),"click",this.navigateWindow.bind(this,"next"),false);$("lightwindow_next").onclick=function(){return false};if(!this.options.hideGalleryTab){Event.observe($("lightwindow_galleries_tab"),"click",this._handleGalleryAnimation.bind(this,true),false);$("lightwindow_galleries_tab").onclick=function(){return false}}if(Prototype.Browser.IE){Event.observe(document,"mousewheel",this._stopScrolling.bindAsEventListener(this),false)}else{Event.observe(window,"DOMMouseScroll",this._stopScrolling.bindAsEventListener(this),false)}g.onclick=function(){return false}},_addLoadingWindowMarkup:function(){$("lightwindow_contents").innerHTML+=this.options.skin.loading},_setupWindowElements:function(b){this.element=b;this.element.title=null?"":b.getAttribute("title");this.element.author=null?"":b.getAttribute("author");this.element.caption=null?"":b.getAttribute("caption");this.element.rel=null?"":b.getAttribute("rel");this.element.params=null?"":b.getAttribute("params");this.contentToFetch=this.element.href;this.windowType=this._getParameter("lightwindow_type")?this._getParameter("lightwindow_type"):this._fileType(this.contentToFetch)},_clearWindowContents:function(b){if($("lightwindow_media_primary")){try{$("lightwindow_media_primary").Stop()}catch(f){}Element.remove($("lightwindow_media_primary"))}if($("lightwindow_media_secondary")){try{$("lightwindow_media_secondary").Stop()}catch(f){}Element.remove($("lightwindow_media_secondary"))}this.activeGallery=false;this._handleNavigation(this.activeGallery);if(b){$("lightwindow_contents").innerHTML="";$("lightwindow_contents").setStyle({overflow:"hidden"});if(!this.windowActive){$("lightwindow_data_slide_inner").setStyle({display:"none"});$("lightwindow_title_bar_title").innerHTML=""}$("lightwindow_data_slide").setStyle({height:"auto"})}this.resizeTo.height=null;this.resizeTo.width=null},_setStatus:function(b){this.animating=b;if(b){Element.show("lightwindow_loading")}if(!(/MSIE 6./i.test(navigator.userAgent))){this._fixedWindow(b)}},_fixedWindow:function(b){if(b){if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"absolute",top:parseFloat($("lightwindow").getStyle("top"))+this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))+this.pagePosition.x+"px"})}else{$("lightwindow").setStyle({position:"absolute"})}}else{if(this.windowActive){this._getScroll();$("lightwindow").setStyle({position:"fixed",top:parseFloat($("lightwindow").getStyle("top"))-this.pagePosition.y+"px",left:parseFloat($("lightwindow").getStyle("left"))-this.pagePosition.x+"px"})}else{if($("lightwindow_iframe")){this._browserDimensions()}$("lightwindow").setStyle({position:"fixed",top:(parseFloat(this._getParameter("lightwindow_top"))?parseFloat(this._getParameter("lightwindow_top"))+"px":this.dimensions.viewport.height/2+"px"),left:(parseFloat(this._getParameter("lightwindow_left"))?parseFloat(this._getParameter("lightwindow_left"))+"px":this.dimensions.viewport.width/2+"px")})}}},_prepareIE:function(g){if(Prototype.Browser.IE){var f,k,h;if(g){var f="100%"}else{var f="auto"}var b=document.getElementsByTagName("body")[0];var l=document.getElementsByTagName("html")[0];l.style.height=b.style.height=f}},_stopScrolling:function(b){if(this.animating){if(b.preventDefault){b.preventDefault()}b.returnValue=false}},_getScroll:function(){if(typeof(window.pageYOffset)=="number"){this.pagePosition.x=window.pageXOffset;this.pagePosition.y=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){this.pagePosition.x=document.body.scrollLeft;this.pagePosition.y=document.body.scrollTop}else{if(document.documentElement){this.pagePosition.x=document.documentElement.scrollLeft;this.pagePosition.y=document.documentElement.scrollTop}}}},_setScroll:function(b,f){document.documentElement.scrollLeft=b;document.documentElement.scrollTop=f},_toggleTroubleElements:function(b,h){if(h){var g=$("lightwindow_contents").getElementsByTagName("select")}else{var g=document.getElementsByTagName("select")}for(var f=0;f<g.length;f++){g[f].style.visibility=b}if(!h){if(this.options.hideFlash){var l=document.getElementsByTagName("object");for(f=0;f!=l.length;f++){l[f].style.visibility=b}var k=document.getElementsByTagName("embed");for(f=0;f!=k.length;f++){k[f].style.visibility=b}}var m=document.getElementsByTagName("iframe");for(f=0;f!=m.length;f++){m[f].style.visibility=b}}},_getPageDimensions:function(){var g,b;if(window.innerHeight&&window.scrollMaxY){g=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){g=document.body.scrollWidth;b=document.body.scrollHeight}else{g=document.body.offsetWidth;b=document.body.offsetHeight}}var f,h;if(self.innerHeight){f=self.innerWidth;h=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){f=document.documentElement.clientWidth;h=document.documentElement.clientHeight}else{if(document.body){f=document.body.clientWidth;h=document.body.clientHeight}}}if(b<h){this.pageDimensions.height=h}else{this.pageDimensions.height=b}if(g<f){this.pageDimensions.width=f}else{this.pageDimensions.width=g}},_displayLightWindow:function(f,b){$("lightwindow_overlay").style.display=$("lightwindow").style.display=$("lightwindow_container").style.display=f;$("lightwindow_overlay").style.visibility=$("lightwindow").style.visibility=$("lightwindow_container").style.visibility=b},_setupDimensions:function(){var g,h;switch(this.windowType){case"page":g=this.options.dimensions.page.height;h=this.options.dimensions.page.width;break;case"image":g=this.options.dimensions.image.height;h=this.options.dimensions.image.width;break;case"media":g=this.options.dimensions.media.height;h=this.options.dimensions.media.width;break;case"external":g=this.options.dimensions.external.height;h=this.options.dimensions.external.width;break;case"inline":g=this.options.dimensions.inline.height;h=this.options.dimensions.inline.width;break;default:g=this.options.dimensions.page.height;h=this.options.dimensions.page.width;break}var b=this._getParameter("lightwindow_top")?parseFloat(this._getParameter("lightwindow_top"))+this.pagePosition.y:this.dimensions.viewport.height/2+this.pagePosition.y;var f=this._getParameter("lightwindow_left")?parseFloat(this._getParameter("lightwindow_left"))+this.pagePosition.x:this.dimensions.viewport.width/2+this.pagePosition.x;$("lightwindow").setStyle({top:b+"px",left:f+"px"});$("lightwindow_container").setStyle({height:g+"px",width:h+"px",left:-(h/2)+"px",top:-(g/2)+"px"});$("lightwindow_contents").setStyle({height:g+"px",width:h+"px"})},_fileType:function(b){var k=new RegExp("[^.].("+this.options.fileTypes.image.join("|")+")s*$","i");if(k.test(b)){return"image"}if(b.indexOf("#")>-1&&(document.domain==this._getDomain(b))){return"inline"}if(b.indexOf("?")>-1){b=b.substring(0,b.indexOf("?"))}var f="unknown";var g=new RegExp("[^.].("+this.options.fileTypes.page.join("|")+")s*$","i");var h=new RegExp("[^.].("+this.options.fileTypes.media.join("|")+")s*$","i");if(document.domain!=this._getDomain(b)){f="external"}if(h.test(b)){f="media"}if(f=="external"||f=="media"){return f}if(g.test(b)||b.substr((b.length-1),b.length)=="/"){f="page"}return f},_fileExtension:function(g){if(g.indexOf("?")>-1){g=g.substring(0,g.indexOf("?"))}var f="";for(var b=(g.length-1);b>-1;b--){if(g.charAt(b)=="."){return f}f=g.charAt(b)+f}},_monitorKeyboard:function(b){if(b){document.onkeydown=this._eventKeypress.bind(this)}else{document.onkeydown=""}},_eventKeypress:function(f){if(f==null){var b=event.keyCode}else{var b=f.which}switch(b){case 27:this.deactivate();break;case 13:return;default:break}if(this.animating){return false}switch(String.fromCharCode(b).toLowerCase()){case"p":if(this.navigationObservers.previous){this.navigateWindow("previous")}break;case"n":if(this.navigationObservers.next){this.navigateWindow("next")}break;default:break}},_getGalleryInfo:function(b){if(!b){return false}if(b.indexOf("[")>-1){return new Array(escape(b.substring(0,b.indexOf("["))),escape(b.substring(b.indexOf("[")+1,b.indexOf("]"))))}else{return false}},_getDomain:function(k){var m=k.indexOf("//");var f=m+2;var h=k.substring(f,k.length);var b=h.indexOf("/");var l=h.substring(0,b);if(l.indexOf(":")>-1){var g=l.indexOf(":");l=l.substring(0,g)}return l},_getParameter:function(n,h){if(!this.element){return false}if(n=="lightwindow_top"&&this.element.top){return unescape(this.element.top)}else{if(n=="lightwindow_left"&&this.element.left){return unescape(this.element.left)}else{if(n=="lightwindow_type"&&this.element.type){return unescape(this.element.type)}else{if(n=="lightwindow_show_images"&&this.element.showImages){return unescape(this.element.showImages)}else{if(n=="lightwindow_height"&&this.element.height){return unescape(this.element.height)}else{if(n=="lightwindow_width"&&this.element.width){return unescape(this.element.width)}else{if(n=="lightwindow_loading_animation"&&this.element.loadingAnimation){return unescape(this.element.loadingAnimation)}else{if(n=="lightwindow_iframe_embed"&&this.element.iframeEmbed){return unescape(this.element.iframeEmbed)}else{if(n=="lightwindow_form"&&this.element.form){return unescape(this.element.form)}else{if(!h){if(this.element.params){h=this.element.params}else{return}}var l;var k=h.split(",");var g=n+"=";var m=g.length;for(var f=0;f<k.length;f++){if(k[f].substr(0,m)==g){var b=k[f].split("=");l=b[1];break}}if(!l){return false}else{return unescape(l)}}}}}}}}}}},_browserDimensions:function(){if(Prototype.Browser.IE){this.dimensions.viewport.height=document.documentElement.clientHeight;this.dimensions.viewport.width=document.documentElement.clientWidth}else{this.dimensions.viewport.height=window.innerHeight;this.dimensions.viewport.width=document.width||document.body.offsetWidth}},_getScrollerWidth:function(){var k=Element.extend(document.createElement("div"));k.setAttribute("id","lightwindow_scroll_div");k.setStyle({position:"absolute",top:"-10000px",left:"-10000px",width:"100px",height:"100px",overflow:"hidden"});var g=Element.extend(document.createElement("div"));g.setAttribute("id","lightwindow_content_scroll_div");g.setStyle({width:"100%",height:"200px"});k.appendChild(g);var f=document.getElementsByTagName("body")[0];f.appendChild(k);var h=$("lightwindow_content_scroll_div").offsetWidth;k.style.overflow="auto";var b=$("lightwindow_content_scroll_div").offsetWidth;Element.remove($("lightwindow_scroll_div"));this.scrollbarOffset=h-b},_addParamToObject:function(f,g,b,k){var h=document.createElement("param");h.setAttribute("value",g);h.setAttribute("name",f);if(k){h.setAttribute("id",k)}b.appendChild(h);return b},_outerHTML:function(b){if(Prototype.Browser.IE){return b.outerHTML}else{var g=b.cloneNode(true);var f=document.createElement("div");f.appendChild(g);return f.innerHTML}},_convertToMarkup:function(g,f){var b=this._outerHTML(g).replace("</"+f+">","");if(Prototype.Browser.IE){for(var h=0;h<g.childNodes.length;h++){b+=this._outerHTML(g.childNodes[h])}b+="</"+f+">"}return b},_appendObject:function(g,f,b){if(Prototype.Browser.IE){b.innerHTML+=this._convertToMarkup(g,f);if(this.options.EOLASFix.indexOf(this._fileType(this.element.href))>-1){var k=document.getElementsByTagName("object");for(var h=0;h<k.length;h++){if(k[h].getAttribute("data")){k[h].removeAttribute("data")}k[h].outerHTML=k[h].outerHTML;k[h].style.visibility="visible"}}}else{b.appendChild(g)}},_appendIframe:function(b){var f=document.createElement("iframe");f.setAttribute("id","lightwindow_iframe");f.setAttribute("name","lightwindow_iframe");f.setAttribute("src","about:blank");f.setAttribute("height","100%");f.setAttribute("width","100%");f.setAttribute("frameborder","0");f.setAttribute("marginwidth","0");f.setAttribute("marginheight","0");f.setAttribute("scrolling",b);this._appendObject(f,"iframe",$("lightwindow_contents"))},_writeToIframe:function(f){var b=this.options.skin.iframe;b=b.replace("{body_replace}",f);if($("lightwindow_iframe").contentWindow){$("lightwindow_iframe").contentWindow.document.open();$("lightwindow_iframe").contentWindow.document.write(b);$("lightwindow_iframe").contentWindow.document.close()}else{$("lightwindow_iframe").contentDocument.open();$("lightwindow_iframe").contentDocument.write(b);$("lightwindow_iframe").contentDocument.close()}},_loadWindow:function(){switch(this.windowType){case"image":var k=0;var b=[];this.checkImage=[];this.resizeTo.height=this.resizeTo.width=0;this.imageCount=this._getParameter("lightwindow_show_images")?parseInt(this._getParameter("lightwindow_show_images")):1;if(gallery=this._getGalleryInfo(this.element.rel)){for(k=0;k<this.galleries[gallery[0]][gallery[1]].length;k++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][k].href)>-1){break}}if(this.galleries[gallery[0]][gallery[1]][k-this.imageCount]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][k-this.imageCount]}else{this.navigationObservers.previous=false}if(this.galleries[gallery[0]][gallery[1]][k+this.imageCount]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][k+this.imageCount]}else{this.navigationObservers.next=false}this.activeGallery=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false}for(var g=k;g<(k+this.imageCount);g++){if(gallery&&this.galleries[gallery[0]][gallery[1]][g]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][g].href;this.galleryLocation={current:(g+1)/this.imageCount,total:(this.galleries[gallery[0]][gallery[1]].length)/this.imageCount};if(!this.galleries[gallery[0]][gallery[1]][g+this.imageCount]){$("lightwindow_next").setStyle({display:"none"})}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][g+this.imageCount].title}if(!this.galleries[gallery[0]][gallery[1]][g-this.imageCount]){$("lightwindow_previous").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][g-this.imageCount].title}}b[g]=document.createElement("img");b[g].setAttribute("id","lightwindow_image_"+g);b[g].setAttribute("border","0");b[g].setAttribute("src",this.contentToFetch);$("lightwindow_contents").appendChild(b[g]);this.checkImage[g]=new PeriodicalExecuter(function(m){if(!(typeof $("lightwindow_image_"+m).naturalWidth!="undefined"&&$("lightwindow_image_"+m).naturalWidth==0)){this.checkImage[m].stop();var l=$("lightwindow_image_"+m).getHeight();if(l>this.resizeTo.height){this.resizeTo.height=l}this.resizeTo.width+=$("lightwindow_image_"+m).getWidth();this.imageCount--;$("lightwindow_image_"+m).setStyle({height:"100%"});if(this.imageCount==0){this._processWindow()}}}.bind(this,g),1)}break;case"media":var k=0;this.resizeTo.height=this.resizeTo.width=0;if(gallery=this._getGalleryInfo(this.element.rel)){for(k=0;k<this.galleries[gallery[0]][gallery[1]].length;k++){if(this.contentToFetch.indexOf(this.galleries[gallery[0]][gallery[1]][k].href)>-1){break}}if(this.galleries[gallery[0]][gallery[1]][k-1]){this.navigationObservers.previous=this.galleries[gallery[0]][gallery[1]][k-1]}else{this.navigationObservers.previous=false}if(this.galleries[gallery[0]][gallery[1]][k+1]){this.navigationObservers.next=this.galleries[gallery[0]][gallery[1]][k+1]}else{this.navigationObservers.next=false}this.activeGallery=true}else{this.navigationObservers.previous=false;this.navigationObservers.next=false;this.activeGallery=false}if(gallery&&this.galleries[gallery[0]][gallery[1]][k]){this.contentToFetch=this.galleries[gallery[0]][gallery[1]][k].href;this.galleryLocation={current:k+1,total:this.galleries[gallery[0]][gallery[1]].length};if(!this.galleries[gallery[0]][gallery[1]][k+1]){$("lightwindow_next").setStyle({display:"none"})}else{$("lightwindow_next").setStyle({display:"block"});$("lightwindow_next_title").innerHTML=this.galleries[gallery[0]][gallery[1]][k+1].title}if(!this.galleries[gallery[0]][gallery[1]][k-1]){$("lightwindow_previous").setStyle({display:"none"})}else{$("lightwindow_previous").setStyle({display:"block"});$("lightwindow_previous_title").innerHTML=this.galleries[gallery[0]][gallery[1]][k-1].title}}if(this._getParameter("lightwindow_iframe_embed")){this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width}else{this.resizeTo.height=this._getParameter("lightwindow_height");this.resizeTo.width=this._getParameter("lightwindow_width")}this._processWindow();break;case"external":this._appendIframe("auto");this.resizeTo.height=this.dimensions.viewport.height;this.resizeTo.width=this.dimensions.viewport.width;this._processWindow();break;case"page":var f=new Ajax.Request(this.contentToFetch,{method:"get",parameters:"",onComplete:function(l){$("lightwindow_contents").innerHTML+=l.responseText;this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.options.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.options.contentOffset.width);this._processWindow()}.bind(this)});break;case"inline":var h=this.contentToFetch;if(h.indexOf("?")>-1){h=h.substring(0,h.indexOf("?"))}h=h.substring(h.indexOf("#")+1);new Insertion.Top($("lightwindow_contents"),$(h).innerHTML);this.resizeTo.height=$("lightwindow_contents").scrollHeight+(this.options.contentOffset.height);this.resizeTo.width=$("lightwindow_contents").scrollWidth+(this.options.contentOffset.width);this._toggleTroubleElements("hidden",true);this._processWindow();break;default:throw ("Page Type could not be determined, please amend this lightwindow URL "+this.contentToFetch);break}},_resizeWindowToFit:function(){if(this.resizeTo.height+this.dimensions.cruft.height>this.dimensions.viewport.height){var b=this.resizeTo.height/this.resizeTo.width;this.resizeTo.height=this.dimensions.viewport.height-this.dimensions.cruft.height-(2*this.options.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.width=this.resizeTo.height/b;$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px"})}}if(this.resizeTo.width+this.dimensions.cruft.width>this.dimensions.viewport.width){var f=this.resizeTo.width/this.resizeTo.height;this.resizeTo.width=this.dimensions.viewport.width-2*this.dimensions.cruft.width-(2*this.options.viewportPadding);if(this.windowType=="image"||(this.windowType=="media"&&!this._getParameter("lightwindow_iframe_embed"))){this.resizeTo.height=this.resizeTo.width/f;$("lightwindow_data_slide_inner").setStyle({height:this.resizeTo.height+"px"})}}},_presetWindowSize:function(){if(this._getParameter("lightwindow_height")){this.resizeTo.height=parseFloat(this._getParameter("lightwindow_height"))}if(this._getParameter("lightwindow_width")){this.resizeTo.width=parseFloat(this._getParameter("lightwindow_width"))}},_processWindow:function(){this.dimensions.dataEffects=[];if(this.element.caption||this.element.author||(this.activeGallery&&this.options.showGalleryCount)){if(this.element.caption){$("lightwindow_data_caption").innerHTML=this.element.caption;$("lightwindow_data_caption").setStyle({display:"block"})}else{$("lightwindow_data_caption").setStyle({display:"none"})}if(this.element.author){$("lightwindow_data_author").innerHTML=this.element.author;$("lightwindow_data_author_container").setStyle({display:"block"})}else{$("lightwindow_data_details").setStyle({display:"none"});$("lightwindow_data_author_container").setStyle({display:"none"})}if(this.activeGallery&&this.options.showGalleryCount){$("lightwindow_data_gallery_current").innerHTML=this.galleryLocation.current;$("lightwindow_data_gallery_total").innerHTML=this.galleryLocation.total;$("lightwindow_data_gallery_container").setStyle({display:"block"})}else{$("lightwindow_data_gallery_container").setStyle({display:"none"})}$("lightwindow_data_slide_inner").setStyle({width:this.resizeTo.width+"px",height:"auto",visibility:"visible",display:"block"});$("lightwindow_data_slide").setStyle({height:$("lightwindow_data_slide").getHeight()+"px",width:"1px",overflow:"hidden",display:"block"})}else{$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});$("lightwindow_data_slide_inner").setStyle({display:"none",visibility:"hidden",width:this.resizeTo.width+"px",height:"0px"})}if(this.element.title!="null"){$("lightwindow_title_bar_title").innerHTML=this.element.title}else{$("lightwindow_title_bar_title").innerHTML=""}var f={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};$("lightwindow_container").setStyle({height:"auto",width:$("lightwindow_container").getWidth()+this.options.contentOffset.width-(this.windowActive?this.options.contentOffset.width:0)+"px"});var b={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.containerChange={height:f.height-b.height,width:f.width-b.width};this.dimensions.container={height:$("lightwindow_container").getHeight(),width:$("lightwindow_container").getWidth()};this.dimensions.cruft={height:this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.options.contentOffset.height,width:this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.options.contentOffset.width};this._presetWindowSize();this._resizeWindowToFit();if(!this.windowActive){$("lightwindow_container").setStyle({left:-(this.dimensions.container.width/2)+"px",top:-(this.dimensions.container.height/2)+"px"})}$("lightwindow_container").setStyle({height:this.dimensions.container.height+"px",width:this.dimensions.container.width+"px"});this._displayLightWindow("block","visible");this._animateLightWindow()},_animateLightWindow:function(){if(this.options.animationHandler){this.options.animationHandler().bind(this)}else{this._defaultAnimationHandler()}},_handleNavigation:function(b){if(this.options.navigationHandler){this.options.navigationHandler().bind(this,b)}else{this._defaultDisplayNavigation(b)}},_handleTransition:function(){if(this.options.transitionHandler){this.options.transitionHandler().bind(this)}else{this._defaultTransitionHandler()}},_handleFinalWindowAnimation:function(b){if(this.options.finalAnimationHandler){this.options.finalAnimationHandler().bind(this,b)}else{this._defaultfinalWindowAnimationHandler(b)}},_handleGalleryAnimation:function(b){if(this.options.galleryAnimationHandler){this.options.galleryAnimationHandler().bind(this,b)}else{this._defaultGalleryAnimationHandler(b)}},_defaultDisplayNavigation:function(b){if(b){$("lightwindow_navigation").setStyle({display:"block",height:$("lightwindow_contents").getHeight()+"px",width:"100%",marginTop:this.options.dimensions.titleHeight+"px"})}else{$("lightwindow_navigation").setStyle({display:"none",height:"auto",width:"auto"})}},_defaultAnimationHandler:function(){if(this.element.caption||this.element.author||(this.activeGallery&&this.options.showGalleryCount)){$("lightwindow_data_slide").setStyle({display:"none",width:"auto"});this.dimensions.dataEffects.push(new Effect.SlideDown("lightwindow_data_slide",{sync:true}),new Effect.Appear("lightwindow_data_slide",{sync:true,from:0,to:1}))}$("lightwindow_title_bar_inner").setStyle({height:"0px",marginTop:this.options.dimensions.titleHeight+"px"});this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:this.options.dimensions.titleHeight+"px",marginTop:"0px"}}),new Effect.Appear("lightwindow_title_bar_inner",{sync:true,from:0,to:1}));if(!this.options.hideGalleryTab){this._handleGalleryAnimation(false);if($("lightwindow_galleries_tab_container").getHeight()==0){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"20px",marginTop:"0px"}}));$("lightwindow_galleries").setStyle({width:"0px"})}}var b=false;var f=this.dimensions.container.width-$("lightwindow_contents").getWidth()+this.resizeTo.width+this.options.contentOffset.width;if(f!=$("lightwindow_container").getWidth()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.width/$("lightwindow_contents").getWidth()),{scaleFrom:100*($("lightwindow_contents").getWidth()/($("lightwindow_contents").getWidth()+(this.options.contentOffset.width))),sync:true,scaleY:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(f/(this.dimensions.container.width)),{sync:true,scaleY:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,delay:0.25,queue:{position:"end",scope:"lightwindowAnimation"}})}f=this.dimensions.container.height-$("lightwindow_contents").getHeight()+this.resizeTo.height+this.options.contentOffset.height;if(f!=$("lightwindow_container").getHeight()){new Effect.Parallel([new Effect.Scale("lightwindow_contents",100*(this.resizeTo.height/$("lightwindow_contents").getHeight()),{scaleFrom:100*($("lightwindow_contents").getHeight()/($("lightwindow_contents").getHeight()+(this.options.contentOffset.height))),sync:true,scaleX:false,scaleContent:false}),new Effect.Scale("lightwindow_container",100*(f/(this.dimensions.container.height)),{sync:true,scaleX:false,scaleFromCenter:true,scaleContent:false})],{duration:this.duration,afterFinish:function(){if(this.dimensions.dataEffects.length>0){if(!this.options.hideGalleryTab){$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"})}new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}});b=true}if(!b&&this.dimensions.dataEffects.length>0){new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,beforeStart:function(){if(!this.options.hideGalleryTab){$("lightwindow_galleries").setStyle({width:this.resizeTo.width+"px"})}if(this.containerChange.height!=0||this.containerChange.width!=0){new Effect.MoveBy("lightwindow_container",this.containerChange.height,this.containerChange.width,{transition:Effect.Transitions.sinoidal})}}.bind(this),afterFinish:function(){this._finishWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultfinalWindowAnimationHandler:function(b){if(this.windowType=="media"||this._getParameter("lightwindow_loading_animation")){Element.hide("lightwindow_loading");this._handleNavigation(this.activeGallery);this._setStatus(false)}else{Effect.Fade("lightwindow_loading",{duration:0.75,delay:1,afterFinish:function(){if(this.windowType!="image"&&this.windowType!="media"&&this.windowType!="external"){$("lightwindow_contents").setStyle({overflow:"auto"})}this._handleNavigation(this.activeGallery);this._defaultGalleryAnimationHandler();this._setStatus(false)}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultGalleryAnimationHandler:function(f){if(this.activeGallery){$("lightwindow_galleries").setStyle({display:"block",marginBottom:$("lightwindow_data_slide").getHeight()+this.options.contentOffset.height/2+"px"});$("lightwindow_navigation").setStyle({height:$("lightwindow_contents").getHeight()-20+"px"})}else{$("lightwindow_galleries").setStyle({display:"none"});$("lightwindow_galleries_tab_container").setStyle({height:"0px",marginTop:"20px"});$("lightwindow_galleries_list").setStyle({height:"0px"});return false}if(f){if($("lightwindow_galleries_list").getHeight()==0){var b=$("lightwindow_contents").getHeight()*0.8;$("lightwindow_galleries_tab_span").className="down"}else{var b=0;$("lightwindow_galleries_tab_span").className="up"}new Effect.Morph("lightwindow_galleries_list",{duration:this.duration,transition:Effect.Transitions.sinoidal,style:{height:b+"px"},beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})},queue:{position:"end",scope:"lightwindowAnimation"}})}},_defaultTransitionHandler:function(){this.dimensions.dataEffects=[];if($("lightwindow_data_slide").getStyle("display")!="none"){this.dimensions.dataEffects.push(new Effect.SlideUp("lightwindow_data_slide",{sync:true}),new Effect.Fade("lightwindow_data_slide",{sync:true,from:1,to:0}))}if(!this.options.hideGalleryTab){if($("lightwindow_galleries").getHeight()!=0&&!this.options.hideGalleryTab){this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_tab_container",{sync:true,style:{height:"0px",marginTop:"20px"}}))}if($("lightwindow_galleries_list").getHeight()!=0){$("lightwindow_galleries_tab_span").className="up";this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_galleries_list",{sync:true,style:{height:"0px"},transition:Effect.Transitions.sinoidal,beforeStart:function(){$("lightwindow_galleries_list").setStyle({overflow:"hidden"})},afterFinish:function(){$("lightwindow_galleries_list").setStyle({overflow:"auto"})}}))}}this.dimensions.dataEffects.push(new Effect.Morph("lightwindow_title_bar_inner",{sync:true,style:{height:"0px",marginTop:this.options.dimensions.titleHeight+"px"}}),new Effect.Fade("lightwindow_title_bar_inner",{sync:true,from:1,to:0}));new Effect.Parallel(this.dimensions.dataEffects,{duration:this.duration,afterFinish:function(){this._loadWindow()}.bind(this),queue:{position:"end",scope:"lightwindowAnimation"}})},_defaultFormHandler:function(h){var f=Event.element(h).parentNode;var g=Form.serialize(this._getParameter("lightwindow_form",f.getAttribute("params")));if(this.options.formMethod=="post"){var b=new Ajax.Request(f.href,{method:"post",postBody:g,onComplete:this.openWindow.bind(this,f)})}else{if(this.options.formMethod=="get"){var b=new Ajax.Request(f.href,{method:"get",parameters:g,onComplete:this.openWindow.bind(this,f)})}}},_finishWindow:function(){if(this.windowType=="external"){$("lightwindow_iframe").setAttribute("src",this.element.href);this._handleFinalWindowAnimation(1)}else{if(this.windowType=="media"){var f=document.createElement("object");f.setAttribute("classid",this.options.classids[this._fileExtension(this.contentToFetch)]);f.setAttribute("codebase",this.options.codebases[this._fileExtension(this.contentToFetch)]);f.setAttribute("id","lightwindow_media_primary");f.setAttribute("name","lightwindow_media_primary");f.setAttribute("width",this.resizeTo.width);f.setAttribute("height",this.resizeTo.height);f=this._addParamToObject("movie",this.contentToFetch,f);f=this._addParamToObject("src",this.contentToFetch,f);f=this._addParamToObject("controller","true",f);f=this._addParamToObject("wmode","transparent",f);f=this._addParamToObject("cache","false",f);f=this._addParamToObject("quality","high",f);if(!Prototype.Browser.IE){var b=document.createElement("object");b.setAttribute("type",this.options.mimeTypes[this._fileExtension(this.contentToFetch)]);b.setAttribute("data",this.contentToFetch);b.setAttribute("id","lightwindow_media_secondary");b.setAttribute("name","lightwindow_media_secondary");b.setAttribute("width",this.resizeTo.width);b.setAttribute("height",this.resizeTo.height);b=this._addParamToObject("controller","true",b);b=this._addParamToObject("wmode","transparent",b);b=this._addParamToObject("cache","false",b);b=this._addParamToObject("quality","high",b);f.appendChild(b)}if(this._getParameter("lightwindow_iframe_embed")){this._appendIframe("no");this._writeToIframe(this._convertToMarkup(f,"object"))}else{this._appendObject(f,"object",$("lightwindow_contents"))}this._handleFinalWindowAnimation(0)}else{this._handleFinalWindowAnimation(0)}}this._setupActions()}};Event.observe(window,"load",lightwindowInit,false);var myLightWindow=null;function lightwindowInit(){myLightWindow=new lightwindow()}if(!this.JSON){JSON=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||"null")}return"["+a.join(",")+"]"}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}"}}return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")}}}()}var dropdownSet=Class.create();dropdownSet.prototype={initialize:function(){this.data={fields:[]}},newDD:function(f,b){this.data.fields.push({name:b,value:f,set:0})},get:function(f,b){el=this.data.fields.detect(function(g){return g.value==f});return el[b]},set:function(f,g,b){this.data.fields.each(function(k,h){if(k.value==f){k[g]=b}})},empty:function(){this.data={fields:[]}}};function fncAddDropDown(listDS,node,selected){eval(listDS).data.fields.each(function(el){if(selected==el.value){op=Builder.node("option",{value:el.value,selected:"selected"},el.name)}else{op=Builder.node("option",{value:el.value},el.name)}$(node).appendChild(op)});$(node).value=selected}var statesDS=new dropdownSet();var stateData=statesDS;var lststatelablId;var txtcitylablId;var imgload;var txt_CityId;var lstStateId;var selStateId;var countryId;var lstCountry;function getStateList(f,k,h,b){if(arguments.length>4){imgload=arguments[4];if(arguments.length>5){lststatelablId=arguments[5]}if(arguments.length>6){txtcitylablId=arguments[6]}if(arguments.length>7){lstCountry=arguments[7];if(document.getElementById(lstCountry)){document.getElementById(lstCountry).value=f}}}else{imgload="";lststatelablId="";txtcitylablId=""}document.getElementById(k).style.display="none";if(f==""){document.getElementById(k).value="";if(document.getElementById(lststatelablId)){document.getElementById(lststatelablId).style.display="none"}if(document.getElementById(txtcitylablId)){document.getElementById(txtcitylablId).style.display="none"}if(document.getElementById(b)){document.getElementById(b).style.display="none"}}countryId=f;lstStateId=k;selStateId=h;txt_CityId=b;if(document.getElementById(b)&&selStateId==""){if(document.getElementById(txtcitylablId)){document.getElementById(txtcitylablId).style.display="none"}document.getElementById(b).style.display="none";document.getElementById(b).value=""}if(countryId!=""){if(countryId!=-1){if(document.getElementById(imgload)){document.getElementById(imgload).style.display="block"}var g=new Ajax.Request("/json/"+countryId+"_stateslist.txt",{method:"get",onComplete:popStates,asynchronous:false})}}}function popStates(b){document.getElementById(lstStateId).options.length=1;stateData.initialize();var f=JSON.parse(b.responseText);if(f){f.each(function(h,g){stateData.newDD(h.name,h.name)})}fncAddDropDown(stateData,lstStateId,selStateId);if(document.getElementById(lststatelablId)){document.getElementById(lststatelablId).style.display="block"}if(document.getElementById(lstStateId)){document.getElementById(lstStateId).style.display="block"}if(document.getElementById(imgload)){document.getElementById(imgload).style.display="none"}if(document.getElementById(txt_CityId)&&selStateId!=""){if(document.getElementById(txtcitylablId)){document.getElementById(txtcitylablId).style.display="block"}document.getElementById(txt_CityId).style.display="block"}}var statesDS1=new dropdownSet();var stateData1=statesDS1;var lststatelablId1;var txtcitylablId1;var imgload1;var txtCityId1;var lstStateId1;var selStateId1;var countryId1;var lstCountry1;function getStateList1(g,l,k,b){if(arguments.length>4){imgload1=arguments[4];if(arguments.length>5){lststatelablId1=arguments[5]}if(arguments.length>6){txtcitylablId1=arguments[6]}if(arguments.length>7){lstCountry1=arguments[7];if(document.getElementById(lstCountry1)){document.getElementById(lstCountry1).value=g}}}else{imgload1="";lststatelablId1="";txtcitylablId1=""}countryId1=g;lstStateId1=l;selStateId1=k;txtCityId1=b;document.getElementById(lstStateId1).style.display="none";if(g==""){document.getElementById(lstStateId1).value="";if(document.getElementById(lststatelablId1)){document.getElementById(lststatelablId1).style.display="none"}if(document.getElementById(txtcitylablId1)){document.getElementById(txtcitylablId1).style.display="none"}if(document.getElementById(b)){document.getElementById(b).style.display="none"}}if(document.getElementById(txtCityId1)&&selStateId1==""){if(document.getElementById(txtcitylablId1)){document.getElementById(txtcitylablId1).style.display="none"}document.getElementById(txtCityId1).style.display="none";document.getElementById(txtCityId1).value=""}if(countryId1!=""){if(countryId1!=-1){if(document.getElementById(imgload1)){document.getElementById(imgload1).style.display="block"}var f="/json/"+countryId1+"_stateslist.txt";var h=new Ajax.Request(f,{method:"get",onComplete:popStates1,asynchronous:false})}}}function popStates1(b){document.getElementById(lstStateId1).options.length=1;stateData1.initialize();var f=JSON.parse(b.responseText);if(f){f.each(function(h,g){stateData1.newDD(h.name,h.name)})}fncAddDropDown(stateData1,lstStateId1,selStateId1);if(document.getElementById(lststatelablId1)){document.getElementById(lststatelablId1).style.display="block"}if(document.getElementById(lstStateId1)){document.getElementById(lstStateId1).style.display="block"}if(document.getElementById(imgload1)){document.getElementById(imgload1).style.display="none"}if(document.getElementById(txtCityId1)&&selStateId1!=""){if(document.getElementById(txtcitylablId1)){document.getElementById(txtcitylablId1).style.display="block"}document.getElementById(txtCityId1).style.display="block"}}var statesDS2=new dropdownSet();var stateData2=statesDS2;var lststatelablId2;var txtcitylablId2;var imgload2;var txtCityId2;var lstStateId2;var selStateId2;var countryId2;var lstCountry2;function getStateList2(g,l,k,b){if(arguments.length>4){imgload2=arguments[4];if(arguments.length>5){lststatelablId2=arguments[5]}if(arguments.length>6){txtcitylablId2=arguments[6]}if(arguments.length>7){lstCountry2=arguments[7];if(document.getElementById(lstCountry2)){document.getElementById(lstCountry2).value=g}}}else{imgload2="";lststatelablId2="";txtcitylablId2=""}countryId2=g;lstStateId2=l;selStateId2=k;txtCityId2=b;document.getElementById(lstStateId2).style.display="none";if(countryId2==""){document.getElementById(lstStateId2).value="";if(document.getElementById(lststatelablId2)){document.getElementById(lststatelablId2).style.display="none"}if(document.getElementById(txtcitylablId2)){document.getElementById(txtcitylablId2).style.display="none"}if(document.getElementById(txtCityId2)){document.getElementById(txtCityId2).style.display="none"}}if(document.getElementById(txtCityId2)&&selStateId2==""){if(document.getElementById(txtcitylablId2)){document.getElementById(txtcitylablId2).style.display="none"}document.getElementById(txtCityId2).style.display="none";document.getElementById(txtCityId2).value=""}if(countryId2!=""){if(countryId2!=-1){if(document.getElementById(imgload2)){document.getElementById(imgload2).style.display="block"}var f="/json/"+countryId2+"_stateslist.txt";var h=new Ajax.Request(f,{method:"get",onComplete:popStates2,asynchronous:false})}}}function popStates2(b){document.getElementById(lstStateId2).options.length=1;stateData2.initialize();var f=JSON.parse(b.responseText);if(f){f.each(function(h,g){stateData2.newDD(h.name,h.name)})}fncAddDropDown(stateData2,lstStateId2,selStateId2);if(document.getElementById(lststatelablId2)){document.getElementById(lststatelablId2).style.display="block"}if(document.getElementById(lstStateId2)){document.getElementById(lstStateId2).style.display="block"}if(document.getElementById(imgload2)){document.getElementById(imgload2).style.display="none"}if(document.getElementById(txtCityId2)&&selStateId2!=""){if(document.getElementById(txtcitylablId2)){document.getElementById(txtcitylablId2).style.display="block"}document.getElementById(txtCityId2).style.display="block"}}function functionclear_dropdown(f){if(trim(f)!=""){var b=f.split("|");document.getElementById(b[0]).value=document.getElementById(b[1]).value}}function callCity(l,b,f,n,m,h,p){if(typeof p=="undefined"){p=""}if(document.getElementById(h)){document.getElementById(h).value="";document.getElementById(h).style.display="block"}if(l==""){if(document.getElementById(n)){document.getElementById(n).style.display="none"}if(p!=""&&document.getElementById(p)){document.getElementById(p).style.display="none"}}else{if(document.getElementById(n)){document.getElementById(n).style.display="block"}if(p!=""&&document.getElementById(p)){document.getElementById(p).style.display="block"}var o="";if(document.getElementById(m)){o=document.getElementById(m).value}var g=new Array("json",true,"countryName",o,"stateName",l);var k=b+urlParams(g)+"/";f.script=k}}function copyGeodropdowns(isSame,srcgeodrop,destgeodrop){var bill=new Array("lstBillCountryId","lstBillStateId","lstBillCityId");var home=new Array("lstHomeCountryId","lstHomeStateId","lstHomeCityId");var ship=new Array("lstShipCountryId","lstShipStateId","lstShipCityId");var srcSelect=eval(srcgeodrop);var destSelect=eval(destgeodrop);if(isSame){document.getElementById(destSelect[0]).value=document.getElementById(srcSelect[0]).value;document.getElementById(destSelect[0]).onchange();document.getElementById(destSelect[1]).value=document.getElementById(srcSelect[1]).value;document.getElementById(destSelect[1]).onchange();document.getElementById(destSelect[2]).value=document.getElementById(srcSelect[2]).value}}if(typeof(bsn)=="undefined"){_b=bsn={}}if(typeof(_b.Autosuggest)=="undefined"){_b.Autosuggest={}}else{alert("Autosuggest is already set!")}_b.AutoSuggest=function(l,h){if(!document.getElementById){return 0}this.fld=_b.DOM.gE(l);if(!this.fld){return 0}this.sInp="";this.nInpC=0;this.aSug=[];this.iHigh=0;this.oP=h?h:{};var b,f={minchars:2,meth:"get",varname:"input",className:"autosuggest",timeout:5000,delay:0,offsety:-5,shownoresults:true,noresults:"No results!",maxheight:250,cache:true,maxentries:25,loadingImg:""};for(b in f){if(typeof(this.oP[b])!=typeof(f[b])){this.oP[b]=f[b]}}var g=this;this.fld.onkeypress=function(k){return g.onKeyPress(k)};this.fld.onkeyup=function(k){return g.onKeyUp(k)};this.fld.setAttribute("autocomplete","off")};_b.AutoSuggest.prototype.onKeyPress=function(k){var h=(window.event)?window.event.keyCode:k.keyCode;var g=13;var f=9;var l=27;var b=1;switch(h){case g:this.setHighlightedValue();b=0;break;case l:this.clearSuggestions();break}return b};_b.AutoSuggest.prototype.onKeyUp=function(k){var g=(window.event)?window.event.keyCode:k.keyCode;var f=38;var h=40;var b=1;if((document.getElementById("txtexFirstName")!=null&&document.getElementById("txtexFirstName").value!="")&&(document.getElementById("txtInstructor")!=null&&document.getElementById("txtInstructor").value=="")){functionclear()}switch(g){case f:this.changeHighlight(g);b=0;break;case h:this.changeHighlight(g);b=0;break;default:var l=this;var m=this.fld.value;clearTimeout(this.ajgetSugg);this.ajgetSugg=setTimeout(function(){l.getSuggestions(m)},400)}return b};_b.AutoSuggest.prototype.getSuggestions=function(n){if(n==this.sInp){return 0}n=trim(n);_b.DOM.remE(this.idAs);this.sInp=n;if(n.length<this.oP.minchars){this.aSug=[];this.nInpC=n.length;return 0}var h=this.nInpC;this.nInpC=n.length?n.length:0;var f=this.aSug.length;if(this.nInpC>h&&f&&f<this.oP.maxentries&&this.oP.cache){var b=[];for(var k=0;k<f;k++){if(this.aSug[k].value.substr(0,n.length).toLowerCase()==n.toLowerCase()){b.push(this.aSug[k])}}this.aSug=b;this.createList(this.aSug);return false}else{var m=this;var g=this.sInp;clearTimeout(this.ajID);this.ajID=setTimeout(function(){m.doAjaxRequest(g)},this.oP.delay)}return false};_b.AutoSuggest.prototype.doAjaxRequest=function(g){if(g!=trim(this.fld.value)){return false}var m=this;if(typeof(this.oP.script)=="function"){var h=this.oP.script(encodeURIComponent(this.sInp))}else{var h=this.oP.script+urlParams(new Array(this.oP.varname,encodeURIComponent(this.sInp)))}if(!h){return false}var f=this.oP.meth;var g=this.sInp;var b=function(n){m.setSuggestions(n,g)};var k=function(){alert("only alphanumeric,space and single quote characters expected")};if(this.oP.loadingImg!=""&&document.getElementById(this.oP.loadingImg)){document.getElementById(this.oP.loadingImg).style.display="block"}var l=new _b.Ajax();l.makeRequest(h,f,b,k,this.oP,this)};_b.AutoSuggest.prototype.filterInput=function(b){re=/\$|,|@|#|~|`|\%|\*|\^|\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\'|\"|\<|\>|\?|\||\\|\!|\$|\./g;return b.replace(re,"")};_b.AutoSuggest.prototype.setSuggestions=function(req,input){if(input!=trim(this.fld.value)){return false}this.aSug=[];if(this.oP.json){if(req.responseText!=""){var jsondata=eval("("+req.responseText+")");for(var i=0;i<jsondata.results.length;i++){this.aSug.push({instructorId:jsondata.results[i].id,value:jsondata.results[i].value,firstname:jsondata.results[i].firstname,lastname:jsondata.results[i].lastname,email:jsondata.results[i].email,wsPrice:jsondata.results[i].wsPrice,username:jsondata.results[i].username})}}}else{var xml=req.responseXML;var results=xml.getElementsByTagName("results")[0].childNodes;for(var i=0;i<results.length;i++){if(results[i].hasChildNodes()){var content=results[i].childNodes[0].nodeValue;var data=content.split("|");this.aSug.push({id:results[i].getAttribute("id"),value:data[0],firstname:data[1],lastname:data[2],email:data[3],wsPrice:data[4],username:data[5]})}}}this.idAs="as_"+this.fld.id;this.createList(this.aSug);if(this.oP.loadingImg!=""&&document.getElementById(this.oP.loadingImg)){document.getElementById(this.oP.loadingImg).style.display="none"}};_b.AutoSuggest.prototype.createList=function(b){var t=this;_b.DOM.remE(this.idAs);this.killTimeout();if(b.length==0&&this.oP.shownoresults){functionclear();return false}if(b.length==0&&!this.oP.shownoresults){return false}var q=_b.DOM.cE("div",{id:this.idAs,className:this.oP.className});var g=_b.DOM.cE("div",{className:"as_corner"});var l=_b.DOM.cE("div",{className:"as_bar"});var v=_b.DOM.cE("div",{className:"as_header"});v.appendChild(g);v.appendChild(l);q.appendChild(v);var p=_b.DOM.cE("ul",{id:"as_ul"});for(var w=0;w<b.length;w++){var C=b[w].value;var s=C.toLowerCase().indexOf(this.sInp.toLowerCase());var n=C.substring(0,s)+"<em>"+C.substring(s,s+this.sInp.length)+"</em>"+C.substring(s+this.sInp.length);var u=_b.DOM.cE("span",{},n,true);if(b[w].info!=""){var y=_b.DOM.cE("br",{});u.appendChild(y);var m=_b.DOM.cE("small",{},b[w].info);u.appendChild(m)}var z=_b.DOM.cE("a",{href:"#"});var h=_b.DOM.cE("span",{className:"tl"}," ");var f=_b.DOM.cE("span",{className:"tr"}," ");z.appendChild(h);z.appendChild(f);z.appendChild(u);z.name=w+1;z.onclick=function(){t.setHighlightedValue();return false};z.onmouseover=function(){t.setHighlight(this.name)};var o=_b.DOM.cE("li",{},z);p.appendChild(o)}if(b.length==0&&this.oP.shownoresults){var o=_b.DOM.cE("li",{className:"as_warning"},this.oP.noresults);p.appendChild(o);functionclear()}q.appendChild(p);var x=_b.DOM.cE("div",{className:"as_corner"});var A=_b.DOM.cE("div",{className:"as_bar"});var r=_b.DOM.cE("div",{className:"as_footer"});r.appendChild(x);r.appendChild(A);q.appendChild(r);var k=_b.DOM.getPos(this.fld);q.style.left=k.x+"px";q.style.top=(k.y+this.fld.offsetHeight+this.oP.offsety)+"px";q.style.width=this.fld.offsetWidth+"px";q.onmouseover=function(){t.killTimeout()};q.onmouseout=function(){t.resetTimeout()};document.getElementsByTagName("body")[0].appendChild(q);this.iHigh=0;var t=this;this.toID=setTimeout(function(){t.clearSuggestions()},this.oP.timeout)};_b.AutoSuggest.prototype.changeHighlight=function(b){var f=_b.DOM.gE("as_ul");if(!f){return false}var g;if(b==40){g=this.iHigh+1}else{if(b==38){g=this.iHigh-1}}if(g>f.childNodes.length){g=f.childNodes.length}if(g<1){g=1}this.setHighlight(g)};_b.AutoSuggest.prototype.setHighlight=function(f){var b=_b.DOM.gE("as_ul");if(!b){return false}if(this.iHigh>0){this.clearHighlight()}this.iHigh=Number(f);b.childNodes[this.iHigh-1].className="as_highlight";this.killTimeout()};_b.AutoSuggest.prototype.clearHighlight=function(){var b=_b.DOM.gE("as_ul");if(!b){return false}if(this.iHigh>0){b.childNodes[this.iHigh-1].className="";this.iHigh=0}};_b.AutoSuggest.prototype.setHighlightedValue=function(){if(this.iHigh){this.sInp=this.fld.value=this.aSug[this.iHigh-1].value;this.fld.focus();if(this.fld.selectionStart){this.fld.setSelectionRange(this.sInp.length,this.sInp.length)}this.clearSuggestions();if(typeof(this.oP.callback)=="function"){this.oP.callback(this.aSug[this.iHigh-1])}}};_b.AutoSuggest.prototype.killTimeout=function(){clearTimeout(this.toID)};_b.AutoSuggest.prototype.resetTimeout=function(){clearTimeout(this.toID);var b=this;this.toID=setTimeout(function(){b.clearSuggestions()},1000)};_b.AutoSuggest.prototype.clearSuggestions=function(){this.killTimeout();var b=_b.DOM.gE(this.idAs);var g=this;if(b){var f=new _b.Fader(b,1,0,250,function(){_b.DOM.remE(g.idAs)})}};if(typeof(_b.Ajax)=="undefined"){_b.Ajax={}}_b.Ajax=function(){this.req={};this.isIE=false};_b.Ajax.prototype.makeRequest=function(g,n,l,f,p,k){var m=k.fld.id;if(n!="POST"){n="GET"}this.onComplete=l;this.onError=f;var b=this;var o=1;if(m.toLowerCase().indexOf("city")!=-1){var h=k.sInp.search("[^A-Za-z0-9' ]");if(trim(k.sInp.value).length>0&&h>=0){o=0}}else{o=1}if(o){if(window.XMLHttpRequest){var g=g+"/";this.req=new XMLHttpRequest();this.req.onreadystatechange=function(){b.processReqChange(p)};this.req.open("GET",g,true);this.req.setRequestHeader("X-Requested-With","XMLHttpRequest");this.req.send(null)}else{if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP");if(this.req){this.req.onreadystatechange=function(){b.processReqChange(p)};this.req.open(n,g,true);this.req.setRequestHeader("X-Requested-With","XMLHttpRequest");this.req.send()}}}}else{this.onError();if(p.loadingImg!=""&&document.getElementById(p.loadingImg)){document.getElementById(p.loadingImg).style.display="none"}}};_b.Ajax.prototype.processReqChange=function(b){if(this.req.readyState==4){if(this.req.status==200){this.onComplete(this.req)}else{this.onError();if(b.loadingImg!=""&&document.getElementById(b.loadingImg)){document.getElementById(b.loadingImg).style.display="none"}}}};if(typeof(_b.DOM)=="undefined"){_b.DOM={}}_b.DOM.cE=function(l,f,b,k){var m=document.createElement(l);if(!m){return 0}for(var g in f){m[g]=f[g]}var h=typeof(b);if(h=="string"&&!k){m.appendChild(document.createTextNode(b))}else{if(h=="string"&&k){m.innerHTML=b}else{if(h=="object"){m.appendChild(b)}}}return m};_b.DOM.gE=function(g){var b=typeof(g);if(b=="undefined"){return 0}else{if(b=="string"){var f=document.getElementById(g);if(!f){return 0}else{if(typeof(f.appendChild)!="undefined"){return f}else{return 0}}}else{if(typeof(g.appendChild)!="undefined"){return g}else{return 0}}}};_b.DOM.remE=function(b){var f=this.gE(b);if(!f){return 0}else{if(f.parentNode.removeChild(f)){return true}else{return 0}}};_b.DOM.getPos=function(g){var g=this.gE(g);var f=g;var h=0;if(f.offsetParent){while(f.offsetParent){h+=f.offsetLeft;f=f.offsetParent}}else{if(f.x){h+=f.x}}var f=g;var b=0;if(f.offsetParent){while(f.offsetParent){b+=f.offsetTop;f=f.offsetParent}}else{if(f.y){b+=f.y}}return{x:h,y:b}};if(typeof(_b.Fader)=="undefined"){_b.Fader={}}_b.Fader=function(f,l,k,b,h){if(!f){return 0}this.e=f;this.from=l;this.to=k;this.cb=h;this.nDur=b;this.nInt=50;this.nTime=0;var g=this;this.nID=setInterval(function(){g._fade()},this.nInt)};_b.Fader.prototype._fade=function(){this.nTime+=this.nInt;var b=Math.round(this._tween(this.nTime,this.from,this.to,this.nDur)*100);var g=b/100;if(this.e.filters){try{this.e.filters.item("DXImageTransform.Microsoft.Alpha").opacity=b}catch(f){this.e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+b+")"}}else{this.e.style.opacity=g}if(this.nTime==this.nDur){clearInterval(this.nID);if(this.cb!=undefined){this.cb()}}};_b.Fader.prototype._tween=function(g,f,k,h){return f+((k-f)*(g/h))};