// CodeThatGrid/Table unit
// Version: 1.2.2 (8.06.04.1)
// Script must be registered in order to be used on your sites.
// Copyright (c) 2003-2004 by CodeThat.Com
// http://www.codethat.com/

function getObj(id){
return window.document.getElementById(id);};function changeCSS(obj,css){if(Def(getObj(obj)))CT_css(obj,css);};function changeStyleParam(obj,param,value){if(Def(obj)&&obj.constructor==String)obj=getObj(obj);if(Def(obj))switch(param){case "textAlign":obj.style.textAlign=value;break;case "fontWeight":obj.style.fontWeight=value;break;case "fontStyle":obj.style.fontStyle=value;break;case "textDecoration":obj.style.textDecoration=value;break;};};function arrayFrom(str,separator){if(Undef(separator))separator=";";var arr=[];while(str.indexOf(separator)>-1){arr[arr.length]=trimStr(str.slice(0,str.indexOf(separator)));str=trimStr(str.slice(str.indexOf(separator)+1));}arr[arr.length]=trimStr(str);
return arr;};function repeatStr(str,count){var HTML=str;for(i=1;i<count;i++)HTML+=str;
return HTML;};function trimStr(str){if(Undef(str)||str=="")
return "";symbol=[" ","\n","\r","\t"];while(symbol.indexOf(str.charAt(0))!=-1)str=str.slice(1);while(symbol.indexOf(str.charAt(str.length-1))!=-1)str=str.slice(0,str.length-1);
return str;};function getFormat(str){if(str.indexOf("\n")>-1){str=str.slice(str.lastIndexOf("\n"));var re=/b?i?u?l?e?r?/;if(re.test(str)){var style={bold:false,italic:false,underline:false,align:""};if(str.indexOf("b")>-1)style.bold=true;if(str.indexOf("i")>-1)style.italic=true;if(str.indexOf("u")>-1)style.underline=true;if(str.indexOf("l")>-1)style.align="align=\"left\"";if(str.indexOf("r")>-1)style.align="align=\"right\"";if(str.indexOf("e")>-1)style.align="align=\"center\"";
return style;}else{
return null;};}else{
return null;};};function changeContent(obj,content){if(Def(obj)&&obj.constructor==String)obj=getObj(obj);if(Def(obj)){obj.innerHTML=content=content.replace(new RegExp("_STYLE_"),"style=\"width:"+obj.clientWidth+"px;height:"+obj.clientHeight+"px;\"");};};{var a=Array.prototype;a.indexOf=function(element){for(z=0;z<this.length;z++)if(element==this[z])
return z;
return-1;};a.setValue=function(arr){this.length=0;for(z=0;z<arr.length;z++)this[z]=arr[z];};};function makeCssClass(style){var cssClass="",obj=null;if(Def(style)&&style.constructor!=String){var attr=["border-width","border-color","border-style","background-color","background-image","background-repeat","color","font-family","font-style","font-weight","font-size","text-align","text-decoration","vertical-align","padding","cursor"];for(z=0;z<attr.length;z++){obj=eval("style."+attr[z].replace(new RegExp("-"),""));if(Def(obj))cssClass+=attr[z]+":"+obj+";";};};
return cssClass;};function makeControl(control){var HTML="",img=null;if(Def(control)&&control.constructor==String){HTML=control;}else{if(Def(control.img)){var img=new Image();img.src=control.img.src;img.width=control.img.width;img.height=control.img.height;img.alt=control.img.alt;img.border=0;};HTML=makeImgTag(img)+(Def(control.text)?" "+control.text:"");};
return HTML;};function makeImgTag(img){var HTML="",obj=null;if(Def(img)){var attr=["src","width","height","border","alt","id"];if(Undef(img.alt))img.alt=alt;for(z=0;z<attr.length;z++){obj=eval("img."+attr[z]);if(Def(obj))HTML+=attr[z]+"=\""+obj+"\" ";};HTML="<img "+HTML+">";};
return HTML;};function makeNameUnique(name){
return name+Math.floor(Math.random()*1000000);};var DEFAULT_RESULT="<BR>";function compare(op1,op2){if(Undef(op1)&&Undef(op2))
return 0;else if(Undef(op1))
return 1;else if(Undef(op2))
return-1;if(op1.constructor==String){op1=op1.toUpperCase();op2=op2.toUpperCase();}if(op1>op2)
return 1;else if(op1<op2)
return-1;else return 0;};function compareImage(op1,op2){if(Undef(op1)&&Undef(op2))
return 0;else if(Undef(op1))
return 1;else if(Undef(op2))
return-1;op1=op1.src;op2=op2.src;if(op1>op2)
return 1;else if(op1<op2)
return-1;else return 0;};function parseURL(urlVal){
return urlVal;};function formatURL(urlObj,target){if(Undef(urlObj))
return DEFAULT_RESULT;if(Def(target))
return "<a href=\""+urlObj+"\" target=\""+target+"\">"+urlObj+"</a>";else return "<a href=\""+urlObj+"\">"+urlObj+"</a>";};function parseEmail(emailVal){
return emailVal;};function formatEmail(emailObj){if(Undef(emailObj))
return DEFAULT_RESULT;
return "<a href=\"mailto:"+emailObj+"\">"+emailObj+"</a>";};function parseHTML(htmlVal){
return htmlVal.replace(/script>/ig,">");};function formatHTML(htmlObj){if(Undef(htmlObj))
return DEFAULT_RESULT;
return htmlObj;};function parseImage(imgDef){var img=new Image();if(Def(imgDef)){img.src=imgDef.src;img.width=imgDef.width;img.height=imgDef.height;}else{img.src="";img.width=0;img.height=0;}
return img;};function formatImage(imgObj){if(Undef(imgObj))
return DEFAULT_RESULT;if(imgObj.width>0&&imgObj.height>0)
return "<img src=\""+imgObj.src+"\" width=\""+imgObj.width+"\" height=\""+imgObj.height+"\" border=\"0\">";else return DEFAULT_RESULT;};function parseString(strVal){if(Undef(strVal))
return strVal;
return strVal.replace(/<[^>]+>/ig,"")+"";};function formatString(strObj){if(Undef(strObj))
return DEFAULT_RESULT;
return strObj;};function parseNumber(numVal){if(Undef(numVal))
return numVal;numVal=numVal.replace(/,/g,'.');
return new Number(numVal);};function formatNumber(numObj){if(Undef(numObj))
return DEFAULT_RESULT;
return new String(numObj);};function parseCurrency(curVal){if(Undef(curVal))
return curVal;curVal=curVal.replace(/,/g,'.');
return new Number(curVal.replace(/[^0-9\-\/.]/g,''));};function formatCurrency(curObj,format){if(Undef(curObj))
return DEFAULT_RESULT;
return curObj+" "+format;};function parseDate(dateVal,format){if(Undef(dateVal))
return dateVal;var dateArr=["","","","","",""];if(dateVal==null)
return null;if(format.length!=dateVal.length)
return null;for(z=0;z<format.length;z++){switch(format.charAt(z)){case "d":dateArr[0]+=dateVal.charAt(z);break;case "m":dateArr[1]+=dateVal.charAt(z);break;case "y":dateArr[2]+=dateVal.charAt(z);break;case "h":dateArr[3]+=dateVal.charAt(z);break;case "i":dateArr[4]+=dateVal.charAt(z);break;case "s":dateArr[5]+=dateVal.charAt(z);break;}};for(z=0;z<dateArr.length;z++){if(isNaN(dateArr[z]))
return null;dateArr[z]=new Number(dateArr[z]);};if(dateArr[0]<1||dateArr[0]>31){
return null;}if(dateArr[2]<100){dateArr[2]+=1900;if(dateArr[2]<1950)dateArr[2]+=100;}if(dateArr[3]>24){
return null;}if(dateArr[5]>60){
return null;}if(dateArr[0]==31&&(dateArr[1]==2||dateArr[1]==4||dateArr[1]==6||dateArr[1]==9||dateArr[1]==11)){
return null;}if(dateArr[0]==29&&dateArr[1]==2&&dateArr[2]%4!=0){
return null;}
return new Date(dateArr[2],dateArr[1]-1,dateArr[0],dateArr[3],dateArr[4],dateArr[5]);};function formatDate(dateObj,format){if(Undef(dateObj))
return DEFAULT_RESULT;if(dateObj.constructor!=Date)
return DEFAULT_RESULT;var dateArr=[new String(dateObj.getDate()),new String(dateObj.getMonth()+1),new String(dateObj.getFullYear()),new String(dateObj.getHours()),new String(dateObj.getMinutes()),new String(dateObj.getSeconds())],formatArr=["","","","","",""];for(z=0;z<format.length;z++){switch(format.charAt(z)){case "d":formatArr[0]+=format.charAt(z);break;case "m":formatArr[1]+=format.charAt(z);break;case "y":formatArr[2]+=format.charAt(z);break;case "h":formatArr[3]+=format.charAt(z);break;case "i":formatArr[4]+=format.charAt(z);break;case "s":formatArr[5]+=format.charAt(z);break;}}for(z=0;z<dateArr.length;z++){if(formatArr[z]!=""){if(formatArr[z].length<dateArr[z].length)dateArr[z]=dateArr[z].slice(dateArr[z].length-formatArr[z].length,dateArr[z].length);while(dateArr[z].length<formatArr[z].length)dateArr[z]="0"+dateArr[z];format=format.replace(new RegExp(formatArr[z]),dateArr[z]);}}
return format;};