function showErrorMsg(_1){
document.getElementById("message").innerHTML=_1;
return false;
}
var ytooltip=null;
function yshowErrorMsg(_2,_3){
if(ytooltip==null){
ytooltip=document.createElement("div");
ytooltip.id="ytooltip";
ytooltip.className="ytooltip";
ytooltip.style.position="absolute";
var _4=document.createElement("div");
_4.className="top";
var _5=document.createElement("div");
_5.className="middle";
var _6=document.createElement("div");
_6.style.width="200px";
var _7=document.createTextNode(_3);
_6.appendChild(_7);
_5.appendChild(_6);
var _8=document.createElement("div");
_8.className="bottom";
ytooltip.appendChild(_4);
ytooltip.appendChild(_5);
ytooltip.appendChild(_8);
ytooltip.style.filter="alpha(opacity:90)";
ytooltip.style.KHTMLOpacity="0.90";
ytooltip.style.MozOpacity="0.90";
ytooltip.style.opacity="0.90";
ytooltip.onmousedown=imageViewMouseDown;
ytooltip.onmouseup=imageViewMouseUp;
ytooltip.onclick=function(){
var _9=ytooltip.originalPosition;
var _a=getPosition(ytooltip);
if(_9.x==_a.x&&_9.y==_a.y){
ytooltip.style.display="none";
}
};
document.getElementsByTagName("body")[0].appendChild(ytooltip);
}
if(_3){
setFocus(_2);
ytooltip.firstChild.nextSibling.firstChild.firstChild.nodeValue=_3;
var _b=document.getElementById(_2);
var _c=getPosition(_b);
ytooltip.style.top=(_c.y+_c.h-3)+"px";
ytooltip.style.left=(_c.x-1)+"px";
ytooltip.style.display="block";
}else{
ytooltip.style.display="none";
}
}
function setFocus(_d){
if(typeof _d=="string"){
_d=document.getElementById(_d);
}
if(!_d){
return;
}
try{
_d.focus();
}
catch(e){
}
if(typeof _d.select!="undefined"){
_d.select();
}
}
function yrejectEvent(e){
if(e){
if(e.stopPropogation){
e.stopPropogation();
}
if(e.preventDefault){
e.preventDefault();
}
}else{
if(window.event){
if(window.event.cancelBubble){
window.event.cancelBubble=true;
}
if(window.event.returnValue){
window.eventReturnValue=false;
}
}
}
this.blur();
return false;
}
function ysetOptions(_f,_10,_11,_12,_13,_14){
var _15=(_f.etype)?_f.etype:"";
if(_15=="c"){
CRCode.buildSelectPreloaded(_f,_11,_12,_10,_14,_13);
}else{
if(_15=="c2"){
var len=_11.length;
var i=0;
_f.options.length=0;
_f.ylist=_12?[null].concat(_11):_11;
if(_12){
_f.options[i++]=new Option(_13?_13:"","",false,false);
}
var _18=0;
while(_18<len){
var e=_11[_18++];
var _1a=false;
if(typeof _10!="undefined"&&e.code==_10){
_1a=true;
}
var _1b=e.desc;
if(_14==1){
_1b=e.code;
}else{
if(_14==2){
_1b=e.code+" "+e.desc;
}
}
_f.options[i++]=new Option(_1b,e.code,false,_1a);
}
}else{
if(_15=="xc"||_15=="xc2"){
var len=_11.length;
var i=0;
_f.options=new Array();
if(_12){
_f.options[i++]={"text":(_13?_13:""),"value":""};
}
var _18=0;
var _1c="";
while(_18<len){
var e=_11[_18++];
var _1b="";
var _1d="";
if(_15=="xc"){
_1b=e.description;
_1d=e.codeId;
}
if(_15=="xc2"){
_1b=e.desc;
_1d=e.code;
}
if(_14==1){
_1b=_1d;
}else{
if(_14==2){
_1b=_1d+" "+_1b;
}
}
_f.options[i++]={"text":_1b,"value":_1d};
if(_10&&_1d==_10){
_1c=_1b;
}
}
_f.value=_1c;
_f.evalue=_10;
}
}
}
}
function ysetProtect(_1e,_1f){
var _20;
if(typeof _1e=="string"){
_20=_1e;
_1e=document.getElementById(_20);
}else{
_20=_1e.id;
}
if(!_1e){
alert("ElementId: '"+_20+"' not defined in HTML");
return;
}
_1e.protect=_1f?true:false;
}
function ysetType(_21,_22,_23,_24){
var _25;
if(typeof _22=="string"){
_25=_22;
_22=document.getElementById(_25);
}else{
_25=_22.id;
}
if(!_22){
alert("ElementId: '"+_25+"' not defined in HTML");
return;
}
if(_21=="r"){
var i=1;
while(true){
_22.etype=_21;
_22.ktype=_23?_23:0;
_22.protect=_24?true:false;
_22=document.getElementById(_25+(i++));
if(!_22){
break;
}
}
}else{
_22.etype=_21;
_22.ktype=_23?_23:0;
_22.protect=_24?true:false;
if(_21=="c"||_21=="c2"){
_22.setOptions=function(_27,_28,_29,_2a){
ysetOptions(this,null,_27,_28,_29,_2a);
};
}
if(_21=="d"||_21=="D"||_21=="t"||_21=="T"){
_22.onblur=yonBlurDate;
_22.onchange=yonBlurDate;
var _2b=_22.id;
var _2c=document.getElementById(_2b+"Button");
var al=(_21=="d"||_21=="t")?"Br":"Tr";
Calendar.setup({inputField:_22,button:_2c,ifFormat:(_21=="t"||_21=="T")?"%e/%m/%Y %H:%M":"%e/%m/%Y",showsTime:(_21=="t"||_21=="T"),singleClick:(_21=="d"||_21=="D"),step:1,timeFormat:"24",date:null,align:al});
if(_2c!=null){
YEvent.addBound(_2c,"onclick");
}else{
YEvent.addBound(_22,"onclick");
}
}else{
if(_21=="e"){
setTimeout(function(){
getIframeWindow(_22.id).document.designMode="On";
},10);
var _2e=document.getElementById(_22.id+"Ta");
if(!_2e){
alert("Missing textarea: "+_22.id+"Ta");
return;
}
_2e.style.height=(_22.height-6)+"px";
_2e.style.width=(_22.width-4)+"px";
}else{
if(_21=="n"||_21=="n0"||_21=="N0"||_21=="n2"||_21=="N2"){
_22.onblur=yonBlurNumber;
}else{
if(_21=="s"||_21=="S"){
if(_21=="S"){
_22.style.textTransform="uppercase";
}
if(_22.maxLength&&_22.size&&_22.maxLength>_22.size){
var div=document.createElement("div");
document.body.appendChild(div);
div.style.position="absolute";
div.style.visibility="hidden";
div.style.left=-1000;
div.style.top=-1000;
ycopyStyleProperty(_22,div,"fontSize","font-size");
ycopyStyleProperty(_22,div,"fontStyle","font-style");
ycopyStyleProperty(_22,div,"fontWeight","font-weight");
ycopyStyleProperty(_22,div,"fontFamily","font-family");
ycopyStyleProperty(_22,div,"lineHeight","line-height");
ycopyStyleProperty(_22,div,"textTransform","text-transform");
ycopyStyleProperty(_22,div,"letterSpacing","letter-spacing");
_22.sizingDiv=div;
}
}else{
if(_21=="u"){
_22.onblur=yonBlurDuration;
}else{
if(_21=="z"){
_22.style.textTransform="uppercase";
_22.onblur=yonBlurZip;
}
}
}
}
}
}
}
return _22;
}
function yreplaceWithSelect(_30,_31){
var _32;
if(typeof _30=="string"){
_32=_30;
_30=document.getElementById(_32);
}else{
_32=_30.id;
}
var _33=document.createElement("select");
_33.id=_32;
_33.name=_32;
_33.size=0;
_33.style.width=_31+"px";
_30.parentNode.replaceChild(_33,_30);
}
function yonBlurDate(){
var _34=this;
var _35=ygetValue(_34);
var _36=(_35==null&&_34.value.trim()!="");
if(_36){
styleInput(_34,_36);
}else{
ysetValue2(_34,_35);
}
}
function yonBlurDuration(){
var _37=this;
var _38=ygetValue(_37);
if(isNaN(_38)){
return;
}
ysetValue2(_37,_38);
}
function yonBlurNumber(){
var _39=this;
var _3a=ygetValue(_39);
var _3b=(isNaN(_3a)&&_39.value.trim()!="");
if(_3b){
styleInput(_39,_3b);
}else{
ysetValue2(_39,_3a);
}
}
function yonBlurZip(){
var _3c=this;
var _3d=ygetValue(_3c);
if(!_3d){
return;
}
ysetValue2(_3c,_3d);
}
function styleInput(_3e,_3f){
if(_3f){
_3e.style.backgroundColor="#ff9999";
}else{
_3e.style.backgroundColor="";
}
}
function ysetValue(_40,_41,_42,_43,_44,_45){
var _46;
if(typeof _40=="string"){
_46=_40;
_40=document.getElementById(_46);
}else{
_46=_40.id;
}
if(!_40){
alert("ElementId: '"+_46+"' not defined in HTML");
return;
}
var _47=_40.etype;
var _48=_40.ktype;
if(typeof mode=="undefined"){
return alert("Global variable mode not defined");
}
var _49=(_40.protect||mode=="D"||mode=="G"||((mode=="A"||mode=="Y")&&_48==2)||(mode=="C"&&_48>0));
if(_47=="r"){
var i=1;
var _4b=_40;
while(true){
if(_49){
if(mode=="G"){
_4b.onclick=yrejectEvent;
}else{
_4b.disabled=true;
}
}else{
_4b.readOnly=false;
_4b.disabled=false;
}
_4b=document.getElementById(_46+(i++));
if(!_4b){
break;
}
}
}else{
if(!_49||mode=="D"){
if(_47=="xb"||_47=="xc"||_47=="xc2"){
_40.parentNode.replaceChild(_40.oldElem,_40);
_40=_40.oldElem;
_47=_40.etype;
}
}
if(_49){
if(_47=="e"){
var _4c=getIframeWindow(_40.id);
_4c.document.designMode="Off";
}
if(mode=="D"){
_40.disabled=true;
}else{
_40.readOnly=true;
_40.onclickSave=_40.onclick?_40.onclick:"*NULL";
_40.onfocusSave=_40.onfocus?_40.onfocus:"*NULL";
_40.onclick=yrejectEvent;
_40.onfocus=yrejectEvent;
_40.disabled=false;
if(_40.className=="fieldCell"){
_40.className="fieldCell2";
}else{
if(_40.className=="fieldCell-cb"){
_40.className="fieldCell2-cb";
}
}
var _4d;
if(_47=="b"){
}else{
if(_47=="c"||_47=="c2"){
if(_40.inputElem){
_4d=_40.inputElem;
}else{
_4d=document.createElement("input");
_4d.className="fieldCell2";
if(_47=="c"){
_4d.etype="xc";
}else{
if(_47=="c2"){
_4d.etype="xc2";
}
}
_4d.ktype=_40.ktype;
_4d.protect=_40.protect;
_4d.id=_40.id;
_4d.name=_40.name;
_4d.options=_40.options;
_4d.readOnly=true;
_4d.onclick=yrejectEvent;
_4d.onfocus=yrejectEvent;
_4d.style.width=(parseInt(_40.style.width)-8)+"px";
_4d.oldElem=_40;
_40.inputElem=_4d;
}
_40.parentNode.replaceChild(_4d,_40);
_40=_4d;
}
}
}
if(_47=="d"||_47=="D"||_47=="t"||_47=="T"){
var _4e=document.getElementById(_46+"Button");
if(_4e){
_4e.style.display="none";
}
}
if(_47=="s"||_47=="S"||_47=="n"){
var _4e=document.getElementById(_46+"FindButton");
if(_4e){
_4e.style.display="none";
}
}
}else{
if(_40.className=="fieldCell2"){
_40.className="fieldCell";
}else{
if(_40.className=="fieldCell2-cb"){
_40.className="fieldCell-cb";
}
}
_40.readOnly=false;
_40.disabled=false;
if(_40.onclickSave){
_40.onclick=_40.onclickSave=="*NULL"?null:_40.onclickSave;
}
if(_40.onfocusSave){
_40.onfocus=_40.onfocusSave=="*NULL"?null:_40.onfocusSave;
}
if(_47=="d"||_47=="D"||_47=="t"||_47=="T"){
var _4e=document.getElementById(_46+"Button");
if(_4e){
_4e.style.display="inline";
}
}
if(_47=="s"||_47=="S"||_47=="n"){
var _4e=document.getElementById(_46+"FindButton");
if(_4e){
_4e.style.display="inline";
}
}
}
}
_45=_45?_45:0;
ysetValue2(_40,_41,_42,_43,_45,_44);
}
function ysetValue2(_4f,_50,_51,_52,_53,_54){
var _55;
if(typeof _4f=="string"){
_55=_4f;
_4f=document.getElementById(_55);
}else{
_55=_4f.id;
}
if(!_4f){
alert("Element not found: "+_55);
return;
}
var _56=(_4f.etype)?_4f.etype:"";
if(_56==""){
alert("Element type missing: "+_55);
return;
}
if(_56=="b"){
_4f.checked=(_50==true);
return;
}else{
if(_56=="c"||_56=="c2"||_56=="xc"||_56=="xc2"){
if(!_51){
if(_56=="c"||_56=="c2"){
if(_50 instanceof Array){
for(var i=0,n=_50.length;i<n;i++){
_50["s"+_50[i]]=true;
}
for(var i=0,n=_4f.options.length;i<n;i++){
if(_50["s"+_4f.options[i].value]){
_4f.options[i].selected=true;
}else{
_4f.options[i].selected=false;
}
}
return;
}
if(_50==null){
_4f.selectedIndex=-1;
return;
}
for(var i=0,n=_4f.options.length;i<n;i++){
if(_4f.options[i].value==_50){
_4f.options[i].selected=true;
}else{
_4f.options[i].selected=false;
}
}
return;
}else{
if(_56=="xc"||_56=="xc2"){
var _59="";
for(var i=0,n=_4f.options.length;i<n;i++){
if(_4f.options[i].value==_50){
_59=_4f.options[i].text;
break;
}
}
_4f.value=_59;
_4f.evalue=_50;
return;
}
}
}
ysetOptions(_4f,_50,_51,_52,_54,_53);
return;
}else{
if(_56=="e"){
var _5a=document.getElementById(_4f.id+"Ta");
if(_50.startsWith("<")){
_4f.style.position="static";
_4f.style.top="0";
_4f.style.left="0";
_5a.style.display="none";
var _5b=getIframeWindow(_4f.id);
_5b.document.open("text/html","replace");
_5b.document.write(_50);
_5b.document.close();
}else{
_4f.style.position="absolute";
_4f.style.top="-9999px";
_4f.style.left="-9999px";
_5a.style.display="block";
_5a.value=_50;
}
return;
}else{
if(_56=="r"){
if(!_50){
return;
}
if(_4f.value==_50){
_4f.checked=true;
return;
}
var i=1;
while(true){
_4f=document.getElementById(_55+i);
if(!_4f){
return;
}
if(_4f.value==_50){
_4f.checked=true;
return;
}
i++;
}
}
}
}
}
var _59;
if(_56=="s"||_56=="S"){
if(_4f.maxLength&&_4f.maxLength>0&&_50&&_50.length>_4f.maxLength){
_50=_50.substring(0,_4f.maxLength);
}
}
if(_56=="d"||_56=="D"){
_59=formatDate2(_50);
}else{
if(_56=="t"||_56=="T"){
_59=formatTimestamp2(_50);
}else{
if(_56=="u"){
_59=formatDuration(_50);
}else{
if(_56=="n"){
_59=(_50==null)?"":""+_50;
}else{
if(_56=="n0"){
_59=formatNumber(_50,0,false);
}else{
if(_56=="N0"){
_59=formatNumber(_50,0,true);
}else{
if(_56=="n2"){
_59=formatNumber(_50,2,false);
}else{
if(_56=="N2"){
_59=formatNumber(_50,2,true);
}else{
if(_56=="s"){
_59=_50;
}else{
if(_56=="S"){
_59=(_50==null||typeof _50=="undefined")?"":_50.toString().toUpperCase();
}else{
if(_56=="z"){
_59=_50.strip().toUpperCase();
if(_59.length==7){
_59=_59.substr(0,4)+" "+_59.substr(4,3);
}else{
if(_59.length==6){
_59=_59.substr(0,3)+" "+_59.substr(3,3);
}
}
}
}
}
}
}
}
}
}
}
}
}
if(typeof _4f.value!="undefined"){
_4f.value=_59;
}else{
_4f.innerHTML=_59;
}
if(_56=="s"||_56=="S"){
if(_4f.sizingDiv){
var div=_4f.sizingDiv;
div.innerHTML=_59;
if(Math.max(div.offsetWidth,div.clientWidth)>Math.max(_4f.offsetWidth,_4f.clientWidth)){
_4f.title=_59;
}else{
_4f.title="";
}
}
}
if(_56=="d"||_56=="D"||_56=="t"||_56=="T"||_56=="n"||_56=="n0"||_56=="N0"||_56=="n2"||_56=="N2"){
styleInput(_4f,false);
}
}
function ygetValue(_5d){
var _5e;
if(typeof _5d=="string"){
_5e=_5d;
_5d=document.getElementById(_5e);
}else{
_5e=_5d.id;
}
if(!_5d){
alert("Element not found: "+_5e);
return;
}
var _5f=(_5d.etype)?_5d.etype:"";
if(_5f==""){
alert("Element type missing: "+_5e);
return;
}
if(_5f=="b"){
return _5d.checked?1:0;
}
if(_5f=="xb"){
return _5d.evalue;
}
if(_5f=="c"||_5f=="c2"){
if(_5d.multiple){
var _60=[];
var _61=_5d.options;
for(var i=0,n=_61.length;i<n;i++){
var _64=_61[i];
if(_64.selected){
_60.push(_64.value);
}
}
return _60;
}
var _65=parseInt(_5d.selectedIndex);
if(_65<0){
return "";
}
return _5d.options[_65].value;
}
if(_5f=="xc"||_5f=="xc2"){
return _5d.evalue;
}
if(_5f=="d"||_5f=="D"){
return parseUserDate(_5d.value.trim());
}
if(_5f=="e"){
if(_5d.style.position=="static"){
var _66=getIframeWindow(_5d.id);
var _67="<html>"+_66.document.documentElement.innerHTML+"</html>";
_67=setUTF8(_67);
return _67;
}else{
var _68=document.getElementById(_5d.id+"Ta");
return _68.value;
}
}
if(_5f=="t"||_5f=="T"){
return parseUserTimestamp(_5d.value.trim());
}
if(_5f=="u"){
return parseUserDuration(_5d.value.trim());
}
if(_5f.substring(0,1).toLowerCase()=="n"){
return parseUserNumber(_5d.value.trim());
}
if(_5f=="r"){
if(_5d.checked){
return _5d.value;
}
var i=1;
while(true){
_5d=document.getElementById(_5e+i);
if(!_5d){
return "";
}
if(_5d.checked){
return _5d.value;
}
i++;
}
}
if(_5f=="s"){
if(typeof _5d.value!="undefined"){
return _5d.value.trim();
}else{
return _5d.innerHTML.trim();
}
}
if(_5f=="S"){
if(typeof _5d.value!="undefined"){
return _5d.value.trim().toUpperCase();
}else{
return _5d.innerHTML.trim().toUpperCase();
}
}
if(_5f=="z"){
var zip=_5d.value.strip().toUpperCase();
if(zip.length==7){
zip=zip.substr(0,4)+" "+zip.substr(4,3);
}else{
if(zip.length==6){
zip=zip.substr(0,3)+" "+zip.substr(3,3);
}
}
return zip;
}
}
function getIndices(_6a){
var _6b;
if(typeof _6a=="string"){
_6b=_6a;
_6a=document.getElementById(_6b);
}else{
_6b=_6a.id;
}
if(!_6a){
alert("Element not found: "+_6b);
return;
}
var _6c=[];
var _6d=_6a.options;
for(var i=0,n=_6d.length;i<n;i++){
var _70=_6d[i];
if(_70.selected){
_6c.push(i);
}
}
return _6c;
}
function ygetObject(_71){
var _72;
if(typeof _71=="string"){
_72=_71;
_71=document.getElementById(_72);
}else{
_72=_71.id;
}
var _73=(_71.etype)?_71.etype:"";
if(_73=="c"||_73=="c2"){
if(_71.multiple){
var _74=[];
var _75=_71.options;
for(var i=0,n=_75.length;i<n;i++){
var _78=_75[i];
if(_78.selected){
_74.push(_71.ylist[i]);
}
}
return _74;
}
var _79=parseInt(_71.selectedIndex);
if(_79<0){
return null;
}
return _71.ylist[_79];
}
alert("Element does not support ygetObject(): "+_72);
return;
}
function ygetText(_7a){
return getText(_7a);
}
function getText(_7b){
var _7c;
if(typeof _7b=="string"){
_7c=_7b;
_7b=document.getElementById(_7c);
}else{
_7c=_7b.id;
}
if(!_7b){
alert("Element not found: "+_7c);
return;
}
var _7d=(_7b.etype)?_7b.etype:"";
if(_7d==""){
alert("Element type missing: "+_7c);
return;
}
if(_7d=="b"){
return _7b.checked?"true":"false";
}
if(_7d=="c"||_7d=="c2"){
if(_7b.multiple){
var _7e=[];
var _7f=_7b.options;
for(var i=0,n=_7f.length;i<n;i++){
var _82=_7f[i];
if(_82.selected){
_7e.push(_82.text);
}
}
return _7e;
}
var _83=parseInt(_7b.selectedIndex);
if(_83<0){
return "";
}
return _7b.options[_83].text;
}
if(_7d=="d"||_7d=="D"||_7d=="t"||_7d=="T"||_7d=="u"){
return _7b.value.trim();
}
if(_7d.substring(0,1).toLowerCase()=="n"){
return _7b.value.trim();
}
if(_7d=="r"){
if(_7b.checked){
return _7b.value;
}
var i=1;
while(true){
_7b=document.getElementById(_7c+i);
if(!_7b){
return "";
}
if(_7b.checked){
return _7b.value;
}
i++;
}
}
if(_7d=="s"){
return _7b.value.trim();
}
if(_7d=="S"){
return _7b.value.trim().toUpperCase();
}
}
var callContext;
function callAction(){
var _84=yopen("crCallSchedule.html","callSchedule","status,resizable","10,10,705,550");
_84.focus();
}
var message;
var messageStandAlone=false;
function dialAction(_85,_86){
var _87=dialAction2(_85,_86);
if(!_87){
return;
}
messageStandAlone=true;
var _88=yopen("messageRecord.html","messageRecord","status,resizable","10,10,705,550");
_88.focus();
}
function dialAction2(_89,_8a){
if(_8a==null||typeof _8a=="undefined"){
var id=_89.id;
var _8c=id.indexOf("DialTo");
if(_8c==-1){
alert("ID of dial button must end with 'DialTo'");
return false;
}
var id2=id.substring(0,_8c);
var _8e=document.getElementById(id2);
if(!_8e){
alert("Element "+id2+" not found");
return false;
}
_8a=ygetValue(id2);
}
_8a=_8a.replace(/\W/g,"");
if(_8a==null||_8a.length==0){
alert("Phone number is blank");
return false;
}
location.href="sip:"+_8a;
return true;
if(_8a.substring(0,1)!="+"){
if(_8a.substring(0,2)=="00"){
_8a="+"+_8a.substr(2);
}else{
if(_8a.substring(0,1)=="0"){
_8a="+353"+_8a.substr(1);
}else{
_8a="+3531"+_8a;
}
}
}
var _8f=new ActiveXObject("Skype4COM.Skype");
var _90=_8f.PlaceCall(_8a);
return true;
}
function emailActionOld(_91,_92){
if(_92==null||typeof _92=="undefined"){
var id=_91.id;
var _94=id.indexOf("MailTo");
if(_94==-1){
alert("ID of email button must end with 'MailTo'");
return;
}
var id2=id.substring(0,_94);
var _96=document.getElementById(id2);
if(!_96){
alert("Element "+id2+" not found");
return;
}
_92=ygetValue(id2);
}
if(_92==null||_92.length==0){
alert("Email address is blank");
return;
}
location.href="mailto:"+_92;
}
var emailWindow;
var editorMode="email";
var emailMsg;
function emailAction(_97){
if(emailMsg.getRecipients()==""){
alert("Email address is blank");
return;
}
if(!_97){
_97="Sir or Madam";
}
var _98="templates/adHoc.html";
var doc=AjaxDoc.get(_98);
if(!doc.found){
alert(_98+" not found");
return;
}
html=doc.html;
var _9a=homeWindow.getProperty("userFirstName")+" "+homeWindow.getProperty("userSurname");
var _9b=homeWindow.getProperty("userTitle");
var hr=homeWindow.getProperty("userHr");
var _9d=["firstname","username","usertitle","userphone","usermobile","useremail","userlogo","usersignature"];
var _9e=[_97,_9a,_9b,hr.getWorkPhone(),hr.getWorkMobile(),hr.getWorkEmail(),hr.getLogo(),hr.getSignature()];
html=YParser.merge(html,_9d,_9e);
emailMsg.setHtml(html);
emailWindow=yopen("editor.html","emailRecord","status,resizable","150,100,705,550");
emailWindow.focus();
}
function ycheckEmailAddress(_9f){
if(_9f==""){
return true;
}
var _a0=/^([a-zA-Z0-9_'.%-])+@([a-zA-Z0-9_.%-])+\.([a-zA-Z]){2,6}$/;
var _a1=_9f.split(/\s*[,;]\s*/);
for(var i=0,n=_a1.length;i<n;i++){
if(!_a0.test(_a1[i])){
return false;
}
}
return true;
}
function textAction(_a4,_a5,_a6,_a7){
if(_a5==null||typeof _a5=="undefined"){
var id=_a4.id;
var _a9=id.indexOf("TextTo");
if(_a9==-1){
alert("ID of text message button must end with 'TextTo'");
return null;
}
var id2=id.substring(0,_a9);
var _ab=document.getElementById(id2);
if(!_ab){
alert("Element "+id2+" not found");
return null;
}
_a5=ygetValue(id2);
}
if(!homeWindow){
alert("homeWindow not defined");
return null;
}
_a5=String(_a5).trim();
var _ac=homeWindow.getSystemValue("sms-ccd");
if(_a5.startsWith("+")){
_a5=_a5.substr(1);
}else{
if(_a5.startsWith("00")){
_a5=_a5.substr(2);
}else{
if(_a5.startsWith("0")){
_a5=_a5.substr(1);
}
_a5=_ac+_a5;
}
}
_a5=_a5.replace(/\D/g,"");
if(_a5==null||_a5.length==0||_a5==_ac){
alert("Mobile number is blank or invalid");
return null;
}
var url="http://api.clickatell.com/http/sendmsg";
var _ae=homeWindow.getSystemValue("sms-api");
var _af=homeWindow.getSystemValue("sms-uid");
var _b0=homeWindow.getSystemValue("sms-pwd");
if(_a6==null||typeof _a6=="undefined"){
_a6=prompt("Type text message to be sent to: "+_a5,"");
}
if(_a6==null){
return null;
}
var _b1="api_id="+_ae;
_b1+="&user="+_af;
_b1+="&password="+_b0;
_b1+="&to="+_a5;
if(_a7){
_b1+="&deliv_time="+_a7;
}
_b1+="&text="+_a6;
var _b2=createXMLHttpRequest();
_b2.open("POST",url,false);
_b2.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
var _b3="";
try{
_b2.send(_b1);
_b3=_b2.responseText;
}
catch(e){
alert("Server is not ready, please try again later ("+e.message+")");
return null;
}
return [_b3,_a6];
}
var smsWindow;
var smsMsg;
function textAction2(_b4,_b5,_b6){
if(_b5==null||typeof _b5=="undefined"){
var id=_b4.id;
var _b8=id.indexOf("TextTo");
if(_b8==-1){
alert("ID of text message button must end with 'TextTo'");
return;
}
var id2=id.substring(0,_b8);
var _ba=document.getElementById(id2);
if(!_ba){
alert("Element "+id2+" not found");
return;
}
_b5=""+ygetValue(id2);
if(!homeWindow){
alert("homeWindow not defined");
return;
}
}
var _bb=(""+_b5).trim();
var _bc=homeWindow.getSystemValue("sms-ccd");
if(_bb.startsWith("+")){
_bb=_bb.substr(1);
}else{
if(_bb.startsWith("00")){
_bb=_bb.substr(2);
}else{
if(_bb.startsWith("0")){
_bb=_bb.substr(1);
}
_bb=_bc+_bb;
}
}
_bb=_bb.replace(/\D/g,"");
if(_bb==null||_bb.length==0||_bb==_bc){
alert("Mobile number is blank or invalid");
return;
}
smsMsg.setRecipients(_b5);
if(typeof _b6!="undefined"){
smsMsg.setNarrative(_b6);
}
smsWindow=yopen("smsPrompt.html","smsRecord","status,resizable","150,100,500,300");
smsWindow.focus();
}
function webAction(_bd,url){
if(url==null||typeof url=="undefined"){
var id=_bd.id;
var _c0=id.indexOf("WebTo");
if(_c0==-1){
alert("ID of map button must end with 'WebTo'");
return;
}
var id2=id.substring(0,_c0);
var _c2=document.getElementById(id2);
if(!_c2){
alert("Element "+id2+" not found");
return;
}
var url=ygetValue(id2);
}
if(url==null||url==""){
alert("Website address is blank");
return;
}
if(!url.startsWith("http")){
url="http://"+url;
}
var _c3=window.open(url,"web");
}
var dragging=false;
var imageBox=null;
function imageViewMouseMove(evt){
evt=(evt)?evt:event;
if(!dragging){
return;
}
if(!imageBox){
return;
}
imageBox.style.left=(evt.clientX-imageBox.offsetX)+"px";
imageBox.style.top=(evt.clientY-imageBox.offsetY)+"px";
evt.cancelBubble=true;
return false;
}
function getDraggableElement(_c5){
if(_c5.currentStyle){
if(_c5.currentStyle.position=="absolute"){
return _c5;
}
}else{
if(window.getComputedStyle){
var _c6=document.defaultView.getComputedStyle(_c5,null);
if(_c6&&_c6.getPropertyValue("position")=="absolute"){
return _c5;
}
}
}
if(_c5.offsetParent){
return getDraggableElement(_c5.offsetParent);
}
return null;
}
function imageViewMouseDown(evt){
evt=(evt)?evt:event;
if(!dragging){
dragging=true;
imageBox=(evt.target)?evt.target:evt.srcElement;
imageBox=getDraggableElement(imageBox);
var _c8=getPosition(imageBox);
imageBox.originalPosition=_c8;
imageBox.offsetX=evt.clientX-_c8.x;
imageBox.offsetY=evt.clientY-_c8.y;
document.onmousemove=imageViewMouseMove;
return;
}
}
function imageViewMouseUp(){
if(dragging){
dragging=false;
}
if(!imageBox){
return;
}
}
function imageViewAction(_c9,_ca){
if(_ca==null||typeof _ca=="undefined"){
var id=_c9.id;
var _cc=id.indexOf("ImageView");
if(_cc==-1){
alert("ID of image view button must end with 'ImageView'");
return;
}
var id2=id.substring(0,_cc);
var _ce=document.getElementById(id2);
if(!_ce){
alert("Element "+id2+" not found");
return;
}
_ca=ygetValue(id2);
}
if(_ca==null||_ca.length==0){
alert("Image name is blank");
return;
}
var pos=getPosition(_c9);
var box=document.getElementById("imageBox");
if(!box){
alert("Element imageBox not found");
return;
}
box.style.left=(pos.x+_c9.offsetWidth+2)+"px";
box.style.top=(pos.y+2)+"px";
box.style.zIndex=99;
box.style.display="block";
var _d1=document.getElementById("imageBoxImage");
_d1.src=_ca;
_d1.alt="Click to close, drag to move";
_d1.onclick=function(){
var box=document.getElementById("imageBox");
var _d3=box.originalPosition;
var _d4=getPosition(box);
if(_d3.x==_d4.x&&_d3.y==_d4.y){
box.style.display="none";
}
};
}
function docViewAction(_d5,_d6){
if(_d6==null||typeof _d6=="undefined"){
var id=_d5.id;
var _d8=id.indexOf("DocView");
if(_d8==-1){
alert("ID of document view button must end with 'DocView'");
return;
}
var id2=id.substring(0,_d8);
var _da=document.getElementById(id2);
if(!_da){
alert("Element "+id2+" not found");
return;
}
_d6=ygetValue(id2);
}
if(_d6==null||_d6.length==0){
alert("Document name is blank");
return;
}
var _db=window.open("","doc","status,scrollbars,resizable,height=550,width=705,left=100,top=50");
_db.focus();
_db.location.replace(encodeURI(_d6+"?"+new Date().getTime()));
}
var mapCallback;
var mapLat;
var mapLng;
var mapZoom;
var mapPostCode;
var mapText;
function mapAction(_dc,_dd,_de,_df){
mapPostCode="";
if(_dc){
mapPostCode=_dc;
}
mapCallback=null;
if(_df){
mapCallback=_df;
}
var _e0=_dd.split(/,\s*/);
mapLat=null;
mapLng=null;
if(_e0.length>=2){
mapLat=_e0[0];
mapLng=_e0[1];
}
mapZoom=null;
if(_e0.length>=3){
mapZoom=_e0[2];
}
mapText="";
if(_de){
mapText=_de;
}
var _e1=yopen("simpleMap.html","simpleMap","status,resizable","100,50,1020,680");
}
function getMapLink(_e2,_e3,_e4){
var _e5=_e2.split(/,\s*/);
if(_e5.length<2){
return "";
}
mapLat=null;
mapLng=null;
if(_e5.length>=2){
mapLat=_e5[0];
mapLng=_e5[1];
}
mapZoom="15";
if(_e5.length>=3){
mapZoom=_e5[2];
}
mapText="";
if(_e3){
mapText="("+encodeURI(_e3)+")";
}
var _e6="http://maps.google.com/?ie=UTF8&q="+mapLat+","+mapLng+mapText+"&z="+mapZoom+"&om=1";
if(typeof _e4=="undefined"){
_e4=_e6;
}
var _e7="<A href=\""+_e6+"\"><FONT color=#800080>"+_e4+"</FONT></A>";
return _e7;
}

