/* Standard Helpers */
function $(){var es=new Array();for(var i=0;i<arguments.length;i++){var e=arguments[i];if(typeof e=='string')e=document.getElementById(e);if(arguments.length==1)return e;es.push(e);}return es;}
function addEvent(e,et,fn){if(typeof e=='string')e=$(e);if(e.addEventListener){e.addEventListener(et,fn,false);}else if(e.attachEvent){e.attachEvent('on'+et,fn);}}
function $byclass(sc,n,t){var ce=new Array();if(n==null)n=document;if(t==null)t='*';var e=n.getElementsByTagName(t);var el=e.length;var p=new RegExp('(^|\\\\s)'+sc+'(\\\\s|$)');for(i=0,j=0;i<el;i++){if(p.test(e[i].className)){ce[j]=e[i];j++;}}return ce;}
function toggle(e){if(typeof e=='string')e=$(e);if(e.style.display!='none'){e.style.display='none';}else{e.style.display='';}}
function $size(e){if(typeof e=='string'){e=$(e);}return[e.offsetWidth,e.offsetHeight];}
function $pos(e){if(typeof e=='string'){e=$(e);}var cl=ct=0;if(e.offsetParent){do{cl+=e.offsetLeft;ct+=e.offsetTop;}while(e=e.offsetParent);}return [cl,ct];}
function winSize(){var w=h=0;if(self.innerWidth){w=self.innerWidth;h=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientWidth){w=document.documentElement.clientWidth;h=document.documentElement.clientHeight;}else if(document.body){w=document.body.clientWidth;h=document.body.clientHeight;}return[w,h];}
function scrollOffset(){var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body,l=document.all?iebody.scrollLeft:pageXOffset,t=document.all?iebody.scrollTop:pageYOffset;return [l,t];}
function pageSize(){var xw=yw=0;if(window.innerHeight&&window.scrollMaxY){yw=window.innerHeight+window.scrollMaxY;xw=window.innerWidth+window.scrollMaxX;}else if(document.body.scrollHeight>document.body.offsetHeight){yw=document.body.scrollHeight;xw=document.body.scrollWidth;}else{yw=document.body.offsetHeight;xw=document.body.offsetWidth;}return [xw,yw];}
function setOpacity(id,o){var e=$(id).style;e.o=(o/100);e.opacity=(o/100);e.MozOpacity=(o/100);e.KhtmlOpacity=(o/100);e.filter="alpha(opacity="+o+")"; } 
function fadeIn(e,o){if(o<=100){setOpacity(e,o);o+=10;setTimeout("fadeIn('"+e+"',"+o+")", 50);}}
function fadeOut(e,o){if(o>=0){setOpacity(e,o);o-=10;setTimeout("fadeOut('"+e+"',"+o+")", 50);}}
function getCookie(n){var s=document.cookie.indexOf(n+"="),l=s+n.length+1;if((!s)&&(n!=document.cookie.substring(0,n.length))){return null;}if(s==-1)return null;var e=document.cookie.indexOf(';',l);if(e==-1)e=document.cookie.length;return unescape(document.cookie.substring(l,e));}
function setCookie(n,v,e,p,d,s){var t=new Date();t.setTime(t.getTime());if(e){e=e*1000*60*60*24;}var ed=new Date(t.getTime()+(e));document.cookie = n+'='+escape(v ) +((e)?';expires='+ed.toGMTString():'')+((p)?';path='+p:'')+((d)?';domain='+d:'')+((s)?';secure':'');}
function deleteCookie(n,p,d){if(getCookie(n))document.cookie=n+'='+((p)?';path='+p:'')+((d)?';domain='+d:'')+';expires=Thu, 01-Jan-1970 00:00:01 GMT';}
function AddTooltip(o,d,c){var p=$pos(o),ps=$size(o);var b=document.createElement('div');b.id='_popup'+(Math.random()*131071.333);b.style.visibility='hidden';b.style.position='absolute';b.style.left=(p[0]+ps[0])+'px';b.style.top=(p[1]+ps[1])+'px';b.setAttribute('class', c);b.innerHTML='<div style="text-align: right;"><img src="images/close.png" style="cursor: pointer;" onClick="HideTooltip(\''+b.id+'\')"></div>'+d;document.body.appendChild(b);addEvent(o,'click',function(){$(b.id).style.visibility='visible';});}
function HideTooltip(o){$(o).style.visibility='hidden';}
function DataTable(){var rCount,cCount,tableClass=null,hCount=false,headerClass=null,cellClass=null,headers=new Array(),cells=new Array(),bColor='#ddd',cWidth=new Array();this.Init=function(rc,cc,h){rCount=rc;cCount=cc;hCount=h;var r,c;for(c=0;c<cc;c++){headers[c]=null;}for(r=0;r<rc;r++){cells[r]=new Array();for(c=0;c<cc;c++){cells[r][c]='&nbsp;';}}},this.SetColWidth=function(c,w){cWidth[c]=w;},this.SetBorderColor=function(c){bColor=c;},this.SetHeader=function(c,t){headers[c]=t;},this.SetCell=function(r,c,t){cells[r][c]=t;},this.SetCellClass=function(t){cellClass=t;},this.SetHeaderClass=function(t){headerClass=t;},this.SetTableClass=function(t){tableClass=t;},this.Render=function(o){var d='',c,r,i;if(typeof o=='string')o=$(o);d='<table class="'+tableClass+'" border="0" cellspacing="1" cellpadding="0" bgColor="'+bColor+'">';if(hCount==true){d+='<tr>';for(c=0;c<cCount;c++){d+='<td width="'+cWidth[c]+'" class="'+headerClass+'">'+headers[c]+'</td>';}}d+='</tr>';for(r=0;r<rCount;r++){d+='<tr>';for(c=0;c<cCount;c++){d+='<td width="'+cWidth[c]+'" class="'+cellClass+'">'+cells[r][c]+'</td>';}d+='</tr>';}d+='</table>';o.innerHTML=d;}}
function popupWindow(u,w,h){window.open(u,'_'+u,'width='+w+',height='+h+',scrollbars');}
function gotoUrl(u){window.location=u;}
