(function($){
AA.Utils.updateFormAction=function(_2,_3,_4,_5){
var _6="";
try{
if(_5){
var _7=$(_2).find("input[name=_mgnlaction]");
if(_7.length){
_6=contextPath_js+"/do"+_7.attr("value");
}else{
_6=_2;
}
}else{
if($(_2).length){
_6=$(_2).attr("action");
}else{
_6=_2;
}
}
}
catch(e){
_6=_2;
}
if(!_3){
return AA.Utils.appendParams(_6,_4);
}
if(_5&&_5==true){
_6=AA.Utils.appendParams(_6,"Ajax?method="+_3+(_4?_4:""));
}else{
_6=AA.Utils.appendParams(_6,"?method="+_3+(_4?_4:""));
}
return _6;
};
AA.Utils.appendParams=function(_8,_9){
return _8.replace(/(#.*)?$/,(_9?_9:"")+"$1");
};
AA.Utils.resetFormAction=function(_a,_b){
_a.attr("action",_b);
};
AA.Utils.jsonCall=function(_c,fn,_e,_f,_10){
if(!_c){
return;
}
_10&&AA.Throbber.waitON();
var _11=function(_12){
fn(_12);
_10&&AA.Throbber.waitOFF();
};
var _13={url:_c,success:_11,dataFilter:function(_14,_15){
try{
window.eval("var result = "+_14);
}
catch(e){
result="";
}
return result;
}};
$.ajax(_13);
};
AA.Utils.addError=function(_16,_17){
while(_16[0].tagName.toLowerCase()!="li"){
_16=_16.parent();
}
_16.addClass(AA.Config.classNames["errorField_Quotation"]);
if(_17){
window.formValidation.removeErrors();
if(AA.Config.formFields[_17].feedback){
window.formValidation.handleErrors(null,AA.Config.formFields[_17].feedback);
}
}
};
AA.Utils.removeError=function(_18,_19){
while(_18[0].tagName!="LI"){
_18=_18.parent();
}
_18.removeClass(AA.Config.classNames["errorField_Quotation"]);
if(_19){
window.formValidation.removeErrors();
}
};
AA.Utils.jsonAjax=function(_1a,_1b){
if(!_1a){
return;
}
_1b.throbber&&AA.Throbber.waitON();
var _1c=function(_1d){
_1b.onComplete(_1d);
_1b.throbber&&AA.Throbber.waitOFF();
};
var _1e={url:_1a,success:_1c,type:_1b.method||"post",error:AA.Utils.onFailureAjax};
$.ajax(_1e);
};
AA.Utils.resetSelect=function(_1f){
if(!_1f){
return;
}
_1f.empty();
var _20=$("<option></option>");
_20.attr("value","");
_20.attr("title","");
_20.html(AA.Config.msg["choose"]);
_20.appendTo(_1f);
};
AA.Utils.submitForm=function(_21,ev,fn,_24){
if(!_21){
return;
}
AA.Throbber.waitON();
var _25=function(_26){
fn(_26);
AA.Throbber.waitOFF();
};
var _27={success:_25,error:function(){
AA.Utils.onFailureAjax();
if(_24){
_24();
}
}};
if(_21.attr("method")=="get"){
_27.method="GET";
_27.url=_21.attr("action");
$.ajax(_27);
}else{
_27.method="POST";
_27.url=_21.attr("action");
_27.data=_21.serialize()+"&ajax=on";
$.ajax(_27);
}
};
AA.Utils.toggleExplanationLink=function(_28){
var _29=$(_28).parent();
while(_29.tagName.toLowerCase()!="tr"){
_29=_29.parent();
}
var img=_28.parent().getPrevious().first().first();
if(_29.hasClass("opened")){
_29.removeClass("opened");
_29.find(".explanation").each(function(_2b,el){
el.addClass(AA.Config.classNames["hide"]);
});
img.src=img.src.replace("open","close");
}else{
_29.addClass("opened");
_29.find(".explanation").each(function(_2d,el){
el.removeClass(AA.Config.classNames["hide"]);
});
img.src=img.src.replace("close","open");
}
};
AA.Utils.ajaxSearchAddress=function(_2f,_30,_31,_32){
var _33=$(_30).attr("value");
var _34=$(_2f).attr("value");
var _35=function(_36){
try{
if(_36.streetname!=undefined){
$(_31).attr("value",_36.streetname);
}else{
$(_31).attr("value","");
}
if(_36.suburb!=undefined){
$(_32).attr("value",_36.suburb);
}else{
$(_32).attr("value","");
}
}
catch(ex){
}
};
var _37="&streetNumber="+_33+"&postCode="+_34;
var url=AA.Utils.updateFormAction(contextPath_action+"/processSchadeAjax","searchAddress",_37,false);
AA.Utils.jsonCall(url,_35,"post",null,false);
};
AA.Utils.eventEnterKey=function(_39,_3a,_3b){
if(_3a.keyCode=="13"){
_3a.stopImmediatePropagation();
if(_3b){
var _3c=$(_39.form).find("input[name=method]");
if(_3c.attr("type")=="hidden"){
_3c.attr("value",_3b);
}else{
_39.form.setProperty("action",_39.form.getProperty("action")+"?method="+_3b);
}
}
_39.form.submit();
}
};
})(jQuery);
(function($){
window.divWait=$("<div></div>");
window.divWait.attr("id","divWait");
window.divWait.css({"position":"absolute","display":"none","border":"0px solid black","width":"35px","height":"40px","background":"url('"+contextPath_js+"/img/loading-cur.gif') bottom right no-repeat","z-index":"1111"});
$(window).ready(function(){
$(document).mousemove(loadingCursor);
});
function loadingCursor(_3e){
try{
if(!$(document.body)){
return;
}
if(!$.contains(document.body,window.divWait[0])){
window.divWait.appendTo(document.body);
}
this.pos={x:"",y:""};
this.mp=window.getMousePos(_3e);
this.bp=window.getBodyPos();
this.pos.y=(this.mp.y+this.bp.y);
this.pos.x=(this.mp.x+this.bp.x);
window.divWait.css({"left":this.pos.x-5,"top":this.pos.y-5});
}
catch(e){
}
};
window.getMousePos=function(e){
if(!e){
e=window.event;
}
var pos={"x":e.clientX,"y":e.clientY};
return pos;
};
window.getBodyPos=function(){
var pos={"x":0,"y":0};
if((typeof (window.pageYOffset)=="number")||(typeof (window.pageXOffset)=="number")){
pos.x=window.pageXOffset;
pos.y=window.pageYOffset;
}else{
if((document.documentElement)&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
pos.x=document.documentElement.scrollLeft;
pos.y=document.documentElement.scrollTop;
}else{
if((document.body)&&(document.body.scrollLeft||document.body.scrollTop)){
pos.x=document.body.scrollLeft;
pos.y=document.body.scrollTop;
}
}
}
return pos;
};
AA.Throbber.waitON=function(){
window.divWait.css("display","block");
};
AA.Throbber.waitOFF=function(){
window.divWait.css("display","none");
};
})(jQuery);
(function($){
var _43={};
$.extend(_43,{option:{textObj:null,suggestObj:null,offsetX:0,offsetY:0,classSuggestDiv:"",classSuggest:"element",classSuggestParent:"suggest",classSuggestOver:"elementOver",suggestList:{}},initialize:function(_44){
if(_44.textObj){
_43.option.textObj=$(_44.textObj).length?$(_44.textObj):$("#"+_44.textObj);
}
if(_44.offsetX){
_43.option.offsetX=_44.offsetX;
}
if(_44.offsetY){
_43.option.offsetY=_44.offsetY;
}
if(_44.classSuggestDiv){
_43.option.classSuggestDiv=_44.classSuggestDiv;
}
if(_44.classSuggest){
_43.option.classSuggest=_44.classSuggest;
}
if(_44.classSuggestParent){
_43.option.classSuggestParent=_44.classSuggestParent;
}
if(_44.suggestList){
_43.option.suggestList=_44.suggestList;
}
_43.option.suggestObj=$("<div></div>");
_43.option.suggestObj.addClass(_43.option.classSuggestParent);
_43.option.suggestObj.insertAfter(_43.option.textObj);
_43.option.suggestObj.css({position:"relative",top:_43.option.offsetY,left:_43.option.offsetX});
_43.hideObj(_43.option.suggestObj);
_43.option.textObj.attr("autocomplete","off");
_43.attachEvent();
},hideObj:function(obj){
obj.css({visibility:"hidden",display:"none"});
},showObj:function(obj){
obj.css({visibility:"visible",display:"block"});
},setLabel:function(ev,el){
ev.stopImmediatePropagation();
_43.option.textObj.attr("value",el.innerHTML);
_43.hideObj(_43.option.suggestObj);
},hideSuggest:function(ev){
_43.option.suggestObj.fadeOut(200);
},setOverClass:function(ev,el){
el=$(el);
ev.stopImmediatePropagation();
if(el.hasClass(_43.option.classSuggestOver)){
el.removeClass(_43.option.classSuggestOver);
}else{
el.addClass(_43.option.classSuggestOver);
}
},createSuggest:function(ev){
try{
ev.stopImmediatePropagation();
var _4d=$(ev.target);
var st="";
var i=0;
$(_43.option.suggestList).each(function(_50,el){
if(_43.option.textObj.attr("value")==""){
return;
}
if(el.toLowerCase().indexOf(_43.option.textObj.attr("value").toLowerCase())==0){
st+="<div class='"+_43.option.classSuggest+"' id='_"+i+"'>"+el+"</div>";
}
i++;
});
if(st==""){
_43.hideObj(_43.option.suggestObj);
}else{
_43.showObj(_43.option.suggestObj);
}
_43.option.suggestObj.html("<div class='"+_43.option.classSuggestDiv+"'>"+st+"</div>");
_43.option.suggestObj.find("div."+_43.option.classSuggest).each(function(_52,el){
$(el).click(function(){
_43.setLabel(ev,el);
});
$(el).mouseover(function(){
_43.setOverClass(ev,el);
});
$(el).mouseout(function(){
_43.setOverClass(ev,el);
});
});
}
catch(ex){
Logger.writeLog(ex.message);
}
},attachEvent:function(){
_43.option.textObj.keyup(_43.createSuggest);
_43.option.textObj.blur(_43.hideSuggest);
}});
$.extend(AA.Utils,{textSuggest:_43});
})(jQuery);
(function($){
var _55={};
$.extend(_55,{objectTextArea:null,arrayObjectTextArea:{},maxLenght:"300",lenght:0,initialize:function(_56){
if(_56.allTextArea){
_55.arrayObjectTextArea=$(_56.conteiner).find("textarea");
}
if(_56.obj){
_55.arrayObjectTextArea[0]=_56.obj;
}
if(_56.maxLenght){
_55.maxLenght=_56.maxLenght;
}
_55.arrayObjectTextArea.each(function(_57,el){
el=$(el);
if(el.attr("maxlenght")){
_55.maxLenght=el.attr("maxlenght");
}
_55.objectTextArea=el;
_55.attachEvent();
});
},attachEvent:function(){
_55.objectTextArea.keydown(checkMaxLenght);
},checkMaxLenght:function(ev){
try{
if(ev.code!="8"&&ev.code!="37"&&ev.code!="38"&&ev.code!="39"&&ev.code!="40"&&ev.code!="46"){
if(_55.objectTextArea.attr("value").length>=_55.maxLenght){
ev.stopImmediatePropagation();
}
}
}
catch(ex){
Logger.writeLog(ex);
}
}});
$.extend(AA.Utils,{textAreaControl:_55});
})(jQuery);
(function($){
var _5b={};
$.extend(_5b,{isLive:false,tooltip:null,option:{selectObj:null,offsetX:15,offsetY:0,classTitle:"",divTitle:"editionToolTip"+(new Date().getTime()),event:{move:"off"}},initialize:function(_5c){
if(!($.browser.msie&&$.browser.version=="6.0")){
return;
}
if(_5c.selectObj){
_5b.option.selectObj=$(_5c.selectObj);
}
if(_5c.offsetX){
_5b.option.offsetX=_5c.offsetX;
}
if(_5c.offsetY){
_5b.option.offsetY=_5c.offsetY;
}
if(_5c.classTitle){
_5b.option.classTitle=_5c.classTitle;
}
if(_5c.event.move){
_5b.option.event.move=_5c.event.move;
}
_5b.attachEvent();
},attachEvent:function(){
if(_5b.option.selectObj){
_5b.option.selectObj.mouseover(function(ev){
_5b.selectOnOver(ev,{obj:_5b.option.selectObj});
});
_5b.option.selectObj.mouseout(function(ev){
_5b.selectOut(ev,{obj:_5b.option.selectObj});
});
if(_5b.option.event.move=="on"){
_5b.option.selectObj.mousemove(function(ev){
_5b.selectOnMove(ev,{obj:el});
});
}
}else{
$("select").each(function(_60,el){
el.mouseover(function(ev){
_5b.selectOnOver(ev,{obj:el});
});
el.mouseout(function(ev){
_5b.selectOut(ev,{obj:el});
});
if(_5b.option.event.move=="on"){
el.mousemove(function(ev){
_5b.selectOnMove(ev,{obj:el});
});
}
});
}
},selectOnOver:function(ev,arr){
if(!_5b.isLive){
var _67=arr.obj.attr("selectedIndex");
var div=$("<div></div>");
div.attr("id",_5b.option.divTitle);
div.attr("class",_5b.option.classTitle);
div.css({"position":"absolute","left":(ev.clientX+_5b.option.offsetX)+"px","top":(ev.clientY+arr.obj.attr("offsetHeight")+_5b.option.offsetY)+"px"});
div.html(arr.obj.attr("options")[_67].title);
if(arr.obj.attr("options")[_67].title.trim()!=""){
div.appendTo($(document.body));
_5b.tooltip=div;
_5b.isLive=true;
}
}
},selectOnMove:function(ev,arr){
if(_5b.isLive){
$(_5b.option.divTitle).css({"position":"absolute","left":(ev.clientX+_5b.option.offsetX)+"px","top":(ev.clientY+arr.obj.attr("offsetHeight")+_5b.option.offsetY)+"px"});
}
},selectOut:function(ev,arr){
if($(_5b.tooltip)){
$(_5b.tooltip).remove();
_5b.isLive=false;
}
}});
$.extend(AA.Utils,{toolTipSelectIE6:_5b});
})(jQuery);
(function($){
function getCorrectSnippets(){
var _6e=$("#state")[0]||$("#mastate")[0]||$("#smstate")[0];
var _6f=$("#substate")[0]||$("#masubstate")[0]||$("#smsubstate")[0];
_6e=$(_6e);
_6f=$(_6f);
if(_6e&&_6f){
if(_6f.attr("value")==""){
if(AA.States[_6e.attr("value")]){
AA.States[_6e.attr("value")].init();
}
}else{
if(AA.States[_6f.attr("value")]){
AA.States[_6f.attr("value")].init();
}
}
}else{
}
};
$(document).ready(getCorrectSnippets);
})(jQuery);
$.extend(String,{clean:function(){
return this.replace(/\s{2,}/g," ").trim();
}});
