// liteAPI (c)2007-2010 by CodeWizard Grafix LLC - All rights reserved.

/* 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){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];}

/* Ajax is adapted from the miniajax code and reverted back to not be used with prototype */
function collect(a,f){var n=[];for(var i=0;i<a.length;i++){var v=f(a[i]);if(v!=null)n.push(v)}return n};
ajax={};
ajax.x=function(){try{return new ActiveXObject('Msxml2.XMLHTTP')}catch(e){try{return new ActiveXObject('Microsoft.XMLHTTP')}catch(e){return new XMLHttpRequest()}}};
ajax.send=function(u,f,m,a){var x=ajax.x();x.open(m,u,true);x.onreadystatechange=function(){if(x.readyState==4)f(x.responseText)};if(m=='POST')x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.send(a)};
ajax.sendxml=function(u,f,m,a){var x=ajax.x();x.open(m,u,true);x.onreadystatechange=function(){if(x.readyState==4)f(x.responseXML)};if(m=='POST')x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.send(a)};
ajax.get=function(url,func){ajax.send(url,func,'GET')};
ajax.getxml=function(url,func){ajax.sendxml(url,func,'GET')};
ajax.gets=function(url){var x=ajax.x();x.open('GET',url,false);x.send(null);return x.responseText};
ajax.post=function(url,func,args){ajax.send(url,func,'POST',args)};
ajax.postxml=function(url,func,args){ajax.sendxml(url,func,'POST',args)};
ajax.update=function(url,elm){var e=$(elm);var f=function(r){e.innerHTML=r};ajax.get(url,f)};
ajax.submit=function(url,elm,frm){var e=$(elm);var f=function(r){e.innerHTML=r};ajax.post(url,f,ajax.serialize(frm))};

function gotoUrl(c){window.location=c;}
function newWin(u){window.open(u,'_win');}


