String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
String.prototype.removeHTML = function() { return this.replace(/<\S[^>]*>/g, ''); };
String.prototype.repeat = function(times) { return (new Array(times + 1)).join(this); };
String.prototype.formatAsMoney = function(){
mnt=this;
mnt -= 0;
mnt = (Math.round(mnt*100))/100;
return (mnt == Math.floor(mnt)) ? mnt + '.00'
: ( (mnt*10 == Math.floor(mnt*10)) ?
mnt + '0' : mnt);
};
function loadscript(url) {
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.src = url;
head.appendChild(script);
}
function isisAutoCompleteGetSelected(table){
for(i=0;i
=0){
isisToggleSelect(parseInt(listtable.style.left),parseInt(listtable.style.top), parseInt(listtable.offsetWidth), parseInt(listtable.offsetHeight));
listtable.parentNode.removeChild(listtable);
return false;
}else{
return true;
}
break;
default:
return true;
break;
}
}
function isisToggleDisplay(fid){
field=document.getElementById(fid);
field.style.display=field.style.display=="block"?"none":"block";
}
function isisShowAutoCompleteList(e, field, list){
var tid=field.id+'list';
listtable=document.getElementById(tid);
switch(e.keyCode){
case 13:
//return
if(listtable){
isisToggleSelect(parseInt(listtable.style.left),parseInt(listtable.style.top), parseInt(listtable.offsetWidth), parseInt(listtable.offsetHeight));
listtable.parentNode.removeChild(listtable);
return false;
}
break;
case 27:
//escape
if(listtable){
isisToggleSelect(parseInt(listtable.style.left),parseInt(listtable.style.top), parseInt(listtable.offsetWidth), parseInt(listtable.offsetHeight));
listtable.parentNode.removeChild(listtable);
}
break;
case 40:
//down
if(listtable){
selected=isisAutoCompleteGetSelected(listtable);
if(selected>=0&&selected0&&selected<=listtable.rows.length){
listtable.rows[selected].style.backgroundColor='';
listtable.rows[selected-1].style.backgroundColor='buttonhighlight';
field.value=listtable.rows[selected-1].cells[0].innerHTML;
}else{
listtable.rows[0].style.backgroundColor='buttonhighlight';
field.value=listtable.rows[0].cells[0].innerHTML;
}
}
break;
default:
results=0;
pos=isisGetPos(field);
if(listtable){
isisToggleSelect(parseInt(listtable.style.left),parseInt(listtable.style.top), parseInt(listtable.offsetWidth), parseInt(listtable.offsetHeight));
listtable.parentNode.removeChild(listtable);
}
if(field.value.length==0)return;
listtable=document.createElement('table');
listtable.style.zIndex=9;
listtable.appendChild(document.createElement("tbody"));
listtable.id=tid;
listtable.className='isisAutoCompleteList';
listtable.style.position='absolute';
document.body.appendChild(listtable);
listtable.style.top=pos.y+parseInt(field.offsetHeight)+'px';
listtable.style.left=pos.x+'px';
for (i in list) {
if(list[i].substr(0, field.value.length).toLowerCase()==field.value.toLowerCase()){
results++;
tr=listtable.insertRow(-1);
td=tr.insertCell(-1);
td.className='gspbodyusual';
td.id='s'+i;
td.innerHTML=list[i];
}
}
if(results<=0){
listtable.parentNode.removeChild(listtable);
}else{
isisToggleSelect(parseInt(listtable.style.left),parseInt(listtable.style.top), parseInt(listtable.offsetWidth), parseInt(listtable.offsetHeight));
}
break;
}
return true;
}
function isisIsValidEmail(address){
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
return filter.test(address.trim());
}
function isisIsNumeric(strString){
if (isNaN(strString*1)){
return false;
}else{
return true;
}
}
function isisIsValidDate(sdate){
if(sdate.length>0){
if('UK'=='UK'){
format='$3/$1/$5';
}else{
format='$1/$3/$5';
}
sdate=sdate.replace(/(\d+)(\/|-|.)(\d+)(\/|-|.)(\d+)/, format);
this.date = new Date(sdate);
if(isNaN(this.date)){
return false;
}else{
return true;
}
}
}
function isisGetSelectedString(box){
var ret=':';
for (var i=0; ix && selxy && selyx && selxy && selyx && selxy && sely\n";
html += "\n";
html += "\n";
html += "\n";
html += "