﻿/* SWFObject v1.5.1: SWFObject is(c) 2007 Geoff Stearns : under the MIT License: */
if(typeof deconcept=="undefined") var deconcept={}; if(typeof deconcept.util=="undefined") deconcept.util={}; if(typeof deconcept.SWFObjectUtil=="undefined") deconcept.SWFObjectUtil={};
deconcept.SWFObject=function(swf,id,w,h,ver,c,quality,xiRedirectUrl,redirectUrl,detectKey){
    if(!document.getElementById){return; } this.DETECT_KEY=detectKey ? detectKey : 'detectflash'; this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY); this.params={}; this.variables={}; this.attributes=[]; if(swf){this.setAttribute('swf',swf); } if(id){this.setAttribute('id',id); } if(w){this.setAttribute('width',w); } if(h){this.setAttribute('height',h); } if(ver){this.setAttribute('version',new deconcept.PlayerVersion(ver.toString().split("."))); } this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(); if(!window.opera && document.all && this.installedVer.major > 7){
        if(!deconcept.unloadSet){
            deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){}; __flash_savedUnloadHandler=function(){}; window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs); }
            window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload); deconcept.unloadSet=true;
        }
    } if(c){this.addParam('bgcolor',c); } var q=quality ? quality : 'high'; this.addParam('quality',q); this.setAttribute('useExpressInstall',false); this.setAttribute('doExpressInstall',false); var xir=(xiRedirectUrl) ? xiRedirectUrl : window.location; this.setAttribute('xiRedirectUrl',xir); this.setAttribute('redirectUrl',''); if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl); }
}
deconcept.SWFObject.prototype={useExpressInstall: function(path){this.xiSWFPath=!path ? "expressinstall.swf" : path; this.setAttribute('useExpressInstall',true); },setAttribute: function(name,value){this.attributes[name]=value; },getAttribute: function(name){return this.attributes[name] || ""; },addParam: function(name,value){this.params[name]=value; },getParams: function(){return this.params; },addVariable: function(name,value){this.variables[name]=value; },getVariable: function(name){return this.variables[name] || ""; },getVariables: function(){return this.variables; },getVariablePairs: function(){var variablePairs=[]; var key; var variables=this.getVariables(); for(key in variables){variablePairs[variablePairs.length]=key + "=" + variables[key]; } return variablePairs; },getSWFHTML: function(){var swfNode=""; if(navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn"); this.setAttribute('swf',this.xiSWFPath); } swfNode='<embed type="application/x-shockwave-flash" src="' + this.getAttribute('swf') + '" width="' + this.getAttribute('width') + '" height="' + this.getAttribute('height') + '" style="' +(this.getAttribute('style') || "") + '"'; swfNode +=' id="' + this.getAttribute('id') + '" name="' + this.getAttribute('id') + '" '; var params=this.getParams(); for(var key in params){swfNode +=[key] + '="' + params[key] + '" '; } var pairs=this.getVariablePairs().join("&"); if(pairs.length > 0){swfNode +='flashvars="' + pairs + '"'; } swfNode +='/>'; } else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX"); this.setAttribute('swf',this.xiSWFPath); } swfNode='<object id="' + this.getAttribute('id') + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.getAttribute('width') + '" height="' + this.getAttribute('height') + '" style="' +(this.getAttribute('style') || "") + '">'; swfNode +='<param name="movie" value="' + this.getAttribute('swf') + '" />'; var params=this.getParams(); for(var key in params){swfNode +='<param name="' + key + '" value="' + params[key] + '" />'; } var pairs=this.getVariablePairs().join("&"); if(pairs.length > 0){swfNode +='<param name="flashvars" value="' + pairs + '" />'; } swfNode +="</object>"; } return swfNode; },write: function(elementId){if(this.getAttribute('useExpressInstall')){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]); if(this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true); this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl'))); document.title=document.title.slice(0,47) + " - Flash Player Installation"; this.addVariable("MMdoctitle",document.title); } } if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){var n=(typeof elementId=='string') ? document.getElementById(elementId) : elementId; n.innerHTML=this.getSWFHTML(); return true; } else{if(this.getAttribute('redirectUrl') !=""){document.location.replace(this.getAttribute('redirectUrl')); } } return false; } }
deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]); if(navigator.plugins && navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"]; if(x && x.description){PlayerVersion=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split(".")); } } else if(navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >=0){var axo=1; var counter=3; while(axo){try{counter++; axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + counter); PlayerVersion=new deconcept.PlayerVersion([counter,0,0]); } catch(e){axo=null; } } } else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); } catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); PlayerVersion=new deconcept.PlayerVersion([6,0,21]); axo.AllowScriptAccess="always"; } catch(e){if(PlayerVersion.major==6){return PlayerVersion; } } try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(e){} } if(axo !=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); } } return PlayerVersion; }
deconcept.PlayerVersion=function(arrVersion){this.major=arrVersion[0] !=null ? parseInt(arrVersion[0]) : 0; this.minor=arrVersion[1] !=null ? parseInt(arrVersion[1]) : 0; this.rev=arrVersion[2] !=null ? parseInt(arrVersion[2]) : 0; }
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major < fv.major) return false; if(this.major > fv.major) return true; if(this.minor < fv.minor) return false; if(this.minor > fv.minor) return true; if(this.rev < fv.rev) return false; return true; }
deconcept.util={getRequestParameter: function(param){var q=document.location.search || document.location.hash; if(param==null){return q; } if(q){var pairs=q.substring(1).split("&"); for(var i=0; i < pairs.length; i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=") + 1)); } } } return ""; } }
deconcept.SWFObjectUtil.cleanupSWFs=function(){var objects=document.getElementsByTagName("OBJECT"); for(var i=objects.length - 1; i >=0; i--){objects[i].style.display='none'; for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[i][x]=function(){}; } } } }
if(!document.getElementById && document.all){document.getElementById=function(id){return document.all[id]; } } var getQueryParamValue=deconcept.util.getRequestParameter; var FlashObject=deconcept.SWFObject; var SWFObject=deconcept.SWFObject;
/* SWF OBJECT END */
function GoChk(oX,isMandetory,sDiv,sType){
    var bMand=false;
    try{if(isMandetory=="Y"){if(oX.value==""){bMand=true; } } } catch(e){}
    try{
        switch(sType){
            case "EMAIL":
                if(bMand){
                    GoHighlight(oX,sDiv);
                } else{
                    if(!IsEmail(oX.value)){GoHighlight(oX,sDiv); } else{GoReset(oX,sDiv); }
                } break;
            default:
                if(bMand){GoHighlight(oX,sDiv); } else{GoReset(oX,sDiv); } break;
        }
    }
    catch(e){}
}
function displayLoading(){try{var oVal=document.getElementById('dvLoading'); oVal.style.display="block"; oVal.style.visibility="visible";} catch(e){}}
function hideLoading(){try{var oVal=document.getElementById('dvLoading'); oVal.style.display="none"; oVal.style.visibility="hidden";} catch(e){}}
function hideParent(oX){try{var oVal=document.getElementById(oX.id); oVal.parent.style.display='none';} catch(e){}}
function ShowControl(sDiv){try{var oVal=document.getElementById(sDiv); if(oVal.style.display=='none'){oVal.style.display='block'; return false; } else{oVal.style.display='none'; return true; }} catch(e){return true; }}
function HideControl(oX){
    try{
        //var oVal=document.getElementById(oX.id);
        //oVal.parent.style.display='none';
    }
    catch(e){}
}
function checkRange(oX,minVal,maxVal,sDiv){
    var oVal=document.getElementById(oX.id).value.replace(/,/,'');
    if((oVal < minVal) ||(oVal > maxVal)){
        alert("Amount requested should be between " + minVal + " and " + maxVal + ".");
        GoHighlight(oX,sDiv); oX.focus(); GoResetLoanDur();
    } else{
        GoResetLoanDur(); GoReset(oX,sDiv);
    }
    CurrencyFormatted(oX); ChkLoanDuration(oX);
}
function GoResetLoanDur(){var oY=document.getElementById(vlstDuration); oY.selectedIndex=0;}
function ChkLoanDuration(oX){
    if (document.getElementById(oX.id).value.length==0) {return;}
    var oY=document.getElementById(vlstDuration);
    if(oX.value !=""){
        var bReFill=false;
        var sVal=oX.value.replace(/,/,'');
        var iVal=parseInt(sVal);
        var sLoanLogic=sLoanServerLogic;
        var arrX=sLoanLogic.split("|");
        var iArrLength=arrX.length - 1;
        var arrMonths=new Array(iArrLength); var arrMin=new Array(iArrLength); var arrMax=new Array(iArrLength);
        var iRem=0;
        if(oY.options.length!=iArrLength+2){oY.options.length=0; var newOpt=new Option("Please select",""); oY.options[0]=newOpt; bReFill=true;}
        if(arrX.length > 0){
            for(var i=0; i <=iArrLength; i++){
                var sTemp=arrX[i].split(":"); arrMonths[i]=sTemp[0];
                var sT2=sTemp[1].split("~"); arrMin[i]=sT2[0]; arrMax[i]=sT2[1];
                if(bReFill){var newOpt=new Option(arrMonths[i] + " months",arrMonths[i]); oY.options[i+1]=newOpt;}
            }
        }
        try{for(var i=0; i <=iArrLength; i++){if((iVal >=arrMin[i]) &&(iVal <=arrMax[i])){} else{oY.remove(parseInt((i+1)-iRem)); iRem=iRem + 1;}}} catch(e){}
    } else{
        try{for(var i=1; i <=oY.options.length-1; i++){iRem=iRem + 1; oY.remove((i+1)-iRem);}
        } catch(e){}
    }
}
function deleteEntry(){if(confirm("Are you sure you want to delete this entry?")==true){return true; } else{return false; } }
function GoChkSelect(oX,sDiv){var oVal=document.getElementById(oX.id).value; if((oVal=='') ||(oVal=='0')){GoHighlight(oX,sDiv);}}
function GoChkSelectEmp(oX,sDiv){var oVal=document.getElementById(oX.id).value; if((oVal=='') ||(oVal=='0') ||(oVal=='4') ||(oVal=='5')){hidediv(sDiv);} else{showdiv(sDiv);}}
function GoAgree(oX,sBtn){if(oX.checked==true){document.getElementById(sBtn).disabled=false;} else{document.getElementById(sBtn).disabled=true;}}
function GoResStatus(oX,sDiv){var oVal=document.getElementById(oX.id).value; if((oVal=='1') ||(oVal=='2')){showdiv(sDiv);} else{hidediv(sDiv);}}
function hidediv(id){if(document.getElementById){document.getElementById(id).style.display='none'; } else{if(document.layers){document.id.display='none'; } else{document.all.id.style.display='none'; } } }
function showdiv(id){if(document.getElementById){document.getElementById(id).style.display='block'; } else{if(document.layers){document.id.display='block'; } else{document.all.id.style.display='block'; } } }
function GoHighlight(oX,sDiv){document.getElementById(oX.id).style.borderColor='#cc0000'; var oText=document.getElementById(sDiv); oText.style.color='#cc0000';}
function GoReset(oX,sDiv){document.getElementById(oX.id).style.borderColor=''; var oText=document.getElementById(sDiv); oText.style.color='';}
function ChkValue(oX,sDiv){var oSelect=document.getElementById(oX.id); if(oSelect.value==""){oSelect.style.borderColor='#cc0000'; document.getElementById(sDiv).style.color='#cc0000';} else{oSelect.style.borderColor=''; document.getElementById(sDiv).style.color='';}}
function IsEmail(sX){if(sX==""){return false;} var filter=/^([\w-&\+]+(?:\.[\w-&\+]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; if(filter.test(sX)) return true; else return false;}
function GoPutData(oX,oY){document.getElementById(oY).value=oX.value; }
function GoPutDataCheckbox(oX,oY){
    var output=''; var ChkLst=document.getElementById(oX.id); var checkBox=ChkLst.getElementsByTagName('input'); var label=ChkLst.getElementsByTagName('label'); var counter=0;
    for(var i=0; i < checkBox.length; i++){if(checkBox[i].checked){output +=label[i].innerHTML + '|';}} document.getElementById(oY).value=output;
}
function GoPutCheckList(oX,oY){
    var lstGroup=document.getElementById(oX); var sValue='';
    for(var iCount=0; iCount < lstGroup.cells.length; iCount++){if(lstGroup.cells[iCount].childNodes[0].checked==true){sValue +=lstGroup.cells[iCount].childNodes[0].value + '|';}}
    document.getElementById(oY).value=sValue;
    return false;
}
function SameAddr(oX){
    var oChk=document.getElementById(oX.id); var oAddr=document.getElementById(vtxtAddress); var oMailAddr=document.getElementById(vtxtMailAddr);
    if(oChk.checked==true){oMailAddr.value=oAddr.value; oMailAddr.disabled=true;} else{oMailAddr.disabled=false;}
    return false;
}
function IsAlpNum(e){
    var key; var validChars=" -.(){}[]/?!@#$%^&*_+=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    if(window.event){key=e.keyCode; } else if(e.which){key=e.which; }
    switch(e.keyCode){case 9: case 37: case 38: case 39: case 40: return true; }
    if(validChars.indexOf(String.fromCharCode(key))==-1){return false; }
    return true;
}
function IsNumber(e){
    var validNum="0123456789"; var key; if(window.event){key=e.keyCode; } else if(e.which){key=e.which; }
    switch(e.keyCode){case 9: case 37: case 38: case 39: case 40: return true; }
    if(validNum.indexOf(String.fromCharCode(key))==-1){return false; }
    return true;
}
function IsNum(e){
    var validChars="0123456789."; var key; if(window.event){key=e.keyCode; } else if(e.which){key=e.which; }
    switch(e.keyCode){case 9: case 37: case 38: case 39: case 40: return true; }
    if(validChars.indexOf(String.fromCharCode(key))==-1){return false; }
    return true;
}
function IsCurrency(sText){
    var ValidChars="0123456789."; var IsNumber=true; var Char;
    for(i=0; i < sText.length && IsNumber==true; i++){Char=sText.charAt(i); if(ValidChars.indexOf(Char)==-1){IsNumber=false; } }
    return IsNumber;
}
function CurrencyFormatted(obj){
    var amount=obj.value;
    amount=amount.replace(/,/g,'');
    var i=parseFloat(amount);
    if(isNaN(i)){i=0.00; }
    var minus='';
    if(i < 0){minus='-'; }
    i=Math.abs(i); i=parseInt((i + .005) * 100); i=i / 100;
    s=new String(i);
    if(s.indexOf('.') < 0){s +='.00';}
    if(s.indexOf('.')==(s.length - 2)){s +='0'; }
    s=minus + s;
    if(s==0){obj.value=""; } else{obj.value=CommaFormatted(s); }
}
function CommaFormatted(amount){
    var delimiter=",";
    var a=amount.split('.',2)
    var d=a[1];
    var i=parseInt(a[0]);
    if(isNaN(i)){return ''; }
    var minus='';
    if(i < 0){minus='-'; }
    i=Math.abs(i);
    var n=new String(i);
    var a=[];
    while(n.length > 3){var nn=n.substr(n.length - 3); a.unshift(nn); n=n.substr(0,n.length - 3); }
    if(n.length > 0){a.unshift(n); }
    n=a.join(delimiter);
    if(d.length < 1){amount=n; } else{amount=n; }
    amount=minus + amount;
    return amount;
}

function GoCheckResStat(oX,dvAnRentP,dvAnRentTxt){
    if(oX.options[oX.selectedIndex].text !="Tenant"){
        document.getElementById(dvAnRentP).className="cHide"; document.getElementById(dvAnRentTxt).className="cHide";
    } else{
        document.getElementById(dvAnRentP).className="cShow"; document.getElementById(dvAnRentTxt).className="cShow";
    }
}
function GoAlertHowLong(oX){if(oX.value==1){alert("You have you to be resident in UAE for more than 6 months to apply."); oX.focus(); }}
function GoAlertMinSal(oX,vSal,sDiv){var sControlVal=oX.value.replace(',',''); var vMinSal=vSal.replace(',','');  if(parseFloat(sControlVal) < parseFloat(vMinSal)){alert("The minimum monthly salary for a loan application is AED " + vSal + "."); oX.focus(); GoHighlight(oX,sDiv);} else{GoReset(oX,sDiv);}}
function IsRightType(e,sType){var key; var keychar; if(window.event) key=window.event.keyCode; else if(e) key=e.which; else return true; keychar=String.fromCharCode(key); var sType; switch(sType){case "NUM": validChars="0123456789"; break; case "CUR": validChars="0123456789,."; break; case "ALN": validChars=" '-,.;:(){}[]\|/?!@#$%^&*_+=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + '"'; break; case "TEL": validChars="+-0123456789"; break; } if((key==null) ||(key==0) ||(key==8) ||(key==9) ||(key==13) ||(key==27)) return true; else if(((validChars).indexOf(keychar) > -1)) return true; else return false; }
function ValContact(){
    var oX=document.getElementById(vcboForList);
    if(oX.selectedIndex==""){oX.focus(); alert("Please select a value from the list."); return false; }
    oX=document.getElementById(vtxtFName); if(oX.value==""){oX.focus(); alert("Please specify First Name."); return false; }
    oX=document.getElementById(vtxtSName); if(oX.value==""){oX.focus(); alert("Please specify Surname."); return false; }
    oX=document.getElementById(vtxtContactEmail); if(oX.value==""){oX.focus(); alert("Please specify email address."); return false; } else{if(IsEmail(oX.value)==false){alert('Please specify a valid email address.'); return false; } }
    oX=document.getElementById(vtxtTelephone); if(oX.value==""){oX.focus(); alert("Please specify contact number."); return false; }
    return true;
}
function SetDateFormat(objX){var sDate=objX.value; if(sDate.length > 0){sDate=parseDate(sDate);} else{return;} if(sDate==null){alert('Date format doesn\'t match any recognized formats!'); } else{objX.value=formatDate(sDate,'dd-NNN-yyyy');}}
function GoResetText(sID){var oText=document.getElementById(sID); oText.value='';}
function GoResetDropDown(sDD,sHD,sValue){var oDD=document.getElementById(sDD); var oHD=document.getElementById(sHD); oDD.value=''; oHD.value=sValue;}
function ShowDropDownImage(){var oImg=document.getElementById('imgClinic'); oImg.style.visibility=(oImg.style.visibility=='visible')?'hidden':'visible';}
function GoDis(sX){var oX=document.getElementById(sX); oX.className='cHideObj'; return true;}
function resetPosition(object,args){var tb=object._element; var xposition=getLeft(tb); var yposition=getTop(tb); var ex=object._completionListElement; if(ex){ex.style.left=xposition; ex.style.top=yposition+20;}} 
function getLeft(e){var offset=e.offsetLeft; if(e.offsetParent!=null) offset+=getLeft(e.offsetParent); return offset;}
function getTop(e){var offset=e.offsetTop;if(e.offsetParent!=null) offset+=getTop(e.offsetParent);return offset;}