/*
 *	@Author Jaimon Mathew www.jaimon.co.uk
*/
(function(){function p(){return document.body.offsetWidth?document.body.offsetWidth:window.innerWidth}function q(c,b){if(!ge$(c+":scroller")){var a=ge$(c),h=a.parentNode,e=a.nextSibling,g=document.createElement("div");g.id=c+":scroller";g.style.cssText="height:auto;overflow-x:auto;overflow-y:auto;width:auto;";g.onscroll=scrollHeader;g.appendChild(a);a=document.createElement("div");a.id=c+":scroller:fx:OuterDiv";a.style.cssText="position:relative;width:auto;overflow:hidden;overflow-x:hidden;padding:0px;margin:0px;";
a.innerHTML='<div id="'+c+':scroller:fx" style="position:relative;width:9999px;padding:0px;margin-left:0px;"><font size="3" color="red">Please wait while loading the table..</font></div>';var d=null;if(b>0){d=document.createElement("div");d.id=c+":scroller:fxcol";d.style.cssText="width:0px;height:auto;display:block;float:left;overflow:hidden;";d.innerHTML="<div id='"+c+":scroller:fxCH' style='width:100%;overflow:hidden;'>&nbsp;</div><div id='"+c+":scroller:fxCB' style='width:100%;overflow:hidden;'>&nbsp;</div>"}if(e){d&&
h.insertBefore(d,e);h.insertBefore(a,e);h.insertBefore(g,e)}else{d&&h.appendChild(d);h.appendChild(a);h.appendChild(g)}}}var m=false,f=[];this.ge$=function(c){return document.getElementById(c)};this.scrollHeader=function(c){if(!m){c=c?c:window.event;c=c.target?c.target:c.srcElement;if(c.nodeType==3)c=c.parentNode;var b=c.id.replace(":scroller",""),a=ge$(b+":scroller:fx");c=ge$(b+":scroller");a.style.left=0-c.scrollLeft+"px";if(b=ge$(b+"_CFB")){a=parseInt(b.getAttribute("dmt"));b.style.marginTop=0-
(c.scrollTop+a)+"px"}}};this.fxheader=function(){if(!m){m=true;for(var c=false,b=0;b<f.length;b++){var a=ge$(f[b].tid),h=f[b].swidth+"";if(h.indexOf("%")>=0){c=true;var e=ge$(f[b].tid+":scroller:fx");e.style.width="0px";h=parseInt(h);h=p()*h/100;e.style.width="9999px"}a.style.width=h-18+"px";e=ge$(f[b].tid+":scroller:fx");e.style.marginLeft="0px";e.style.display="";var g=e.childNodes,d;for(d=0;d<g.length;d++)e.removeChild(g[d]);var i=a.cloneNode(false);i.id=f[b].tid+"__cN";i.style.width=a.offsetWidth+
"px";i.style.marginTop="0px";i.style.marginLeft="0px";g=document.createElement("thead");g.style.padding="0px";g.style.margin="0px";for(d=0;d<f[b].noOfRows;d++){var j=a.rows[d].cloneNode(true);g.appendChild(j)}i.appendChild(g);e.appendChild(i);var l;if(f[b].noOfCols>0){l=i.cloneNode(true);l.id=f[b].tid+"_CFH"}for(d=g=0;d<f[b].noOfRows;d++){j=i.rows[d].cells;var n,o=a.rows[d].cells,k;if(l){n=l.rows[d].cells;for(k=0;k<j.length;k++)j[k].style.width=n[k].style.width=o[k].offsetWidth-3+"px"}else for(k=
0;k<j.length;k++)j[k].style.width=o[k].offsetWidth-3+"px";g+=a.rows[d].offsetHeight}a.style.marginTop="-"+g+"px";i=f[b].sheight;if(a.offsetHeight<i)i=a.offsetHeight+18;j=0;if(f[b].noOfCols>0){for(d=0;d<f[b].noOfCols;d++)j+=a.rows[0].cells[d].offsetWidth;a.style.marginLeft="-"+j+"px";a.style.display="block";e.style.marginLeft="-"+j+"px";ge$(f[b].tid+":scroller:fxcol").style.width=j+"px";d=ge$(f[b].tid+":scroller:fxCH");e=ge$(f[b].tid+":scroller:fxCB");d.innerHTML="";e.innerHTML="";d.appendChild(l);
d.style.height=g+"px";e.style.height=i-g+"px";a=a.cloneNode(true);a.id=f[b].tid+"_CFB";a.style.marginLeft="0px";a.setAttribute("dmt",g);e.appendChild(a)}h=parseInt(h)-j+"px";ge$(f[b].tid+":scroller").style.height=i-g+"px";ge$(f[b].tid+":scroller").style.width=h;ge$(f[b].tid+":scroller:fx:OuterDiv").style.height=g+"px";ge$(f[b].tid+":scroller:fx:OuterDiv").style.width=h}if(c)window.onresize=fxheader;window.onresize=fxheader;m=false}};this.fxheaderInit=function(c,b,a,h){var e={};e.tid=c;e.sheight=b;
e.swidth=ge$(c).width;e.noOfRows=a;e.noOfCols=h;q(c,h);f[f.length]=e}})();