function UCWords(str){arrStr=str.split(" ");var strOut='';for(i=0;i<arrStr.length;i++){firstChar=arrStr[i].substring(0,1);remainChar=arrStr[i].substring(1);firstChar=firstChar.toUpperCase();remainChar=remainChar.toLowerCase();strOut+=firstChar+remainChar+' ';}return strOut.substring(0,strOut.length-1);}String.prototype.parseJSON=function(){try{return!(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(this.replace(/"(\\.|[^"\\])*"/g,'')))&&eval('('+this+')');}catch(e){return false;}};function urlencode(str){return encodeURI(str).replace(/%2B/g,'+').replace(/%20/g,'+').replace(/\*/g,'%2A').replace(/\//g,'%2F').replace(/@/g,'%40');}function resetForm(formId){$('#'+formId).each(function(){this.reset();});}function storeCookie(cookieName,value){if(document.cookie!=document.cookie){index=document.cookie.indexOf(cookieName);}else{index=-1;}if(index==-1){document.cookie=cookieName+"="+value+"; expires=Monday, 04-Apr-2020 05:00:00 GMT";}}function readCookie(cookieName){if(document.cookie){var index=document.cookie.indexOf(cookieName);if(index!=-1){cstart=(document.cookie.indexOf("=",index)+1);cend=document.cookie.indexOf(";",index);if(cend==-1){cend=document.cookie.length;}value=document.cookie.substring(cstart,cend);return value;}}return false;}function popup(url,width,height){var newWin;var left=(screen.width-width)/2;var top=(screen.height-height)/2;if(newWin==null||newWin.closed){var props="titlebar,toolmar=no,resizable,scrollbars=yes,left="+left+",top="+top+",width="+width+",height="+height;newWin=window.open(url,"newWin",props);newWin.focus();}else{newWin.close();var props="titlebar,toolbar=no,resizable,scrollbars=yes,left="+left+",top="+top+",width="+width+",height="+height;newWin=window.open(url,"newWin",props);newWin.focus();}}function roundNumber(num,decimalCount){var temp=""+num;temp=temp*Math.pow(10,decimalCount);return eval(Math.round(temp)/Math.pow(10,decimalCount));}function calculateLoan(principleValue,interestValue,loanDuration){var principle,interest,years,interestRate,interestAmount,paymentTotal,monthly,temp,loanAmount;principle=eval(principleValue);interest=eval(interestValue);years=eval(loanDuration);interestRate=interest/100;interestAmount=principle*interestRate*years;paymentTotal=principle+interestAmount;monthly=paymentTotal/(years*12);temp=""+roundNumber(monthly,2);loanAmount=(temp==Math.floor(temp))?temp+'.00':((temp*10==Math.floor(temp*10))?temp+'0':temp);return loanAmount;}