/*ONDOMREADY EVENT OBJECT*/var ondomready={add:function(b){if(ondomready.loaded){return b()}var e=ondomready.observers;if(!e){e=ondomready.observers=[]}e[e.length]=b;if(ondomready.callback){return}ondomready.callback=function(){if(ondomready.loaded){return}ondomready.loaded=true;if(ondomready.timer){clearInterval(ondomready.timer);ondomready.timer=null}var j=ondomready.observers;for(var f=0,h=j.length;f<h;f++){var g=j[f];j[f]=null;g()}ondomready.callback=ondomready.observers=null};var d=!!(window.attachEvent&&!window.opera);var a=navigator.userAgent.indexOf("AppleWebKit/")>-1;if(window.addEventListener){document.addEventListener("DOMContentLoaded",ondomready.callback,false);window.addEventListener("load",ondomready.callback,false)}if(document.readyState&&a){ondomready.timer=setInterval(function(){var f=document.readyState;if(f=="loaded"||f=="complete"){ondomready.callback()}},50)}else{if(document.readyState&&d){var c=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script type="text/javascript" defer="defer" src="'+c+'" onreadystatechange="if (this.readyState == \'complete\') ondomready.callback();"><\/script>')}else{if(window.attachEvent){window.attachEvent("onload",ondomready.callback)}else{var b=window.onload;window.onload=function(){ondomready.callback();if(b){b()}}}}}}};
/*ATTACH EVENT METHOD*/function addEvent(c,b,a){if(b.toLowerCase()=="domready"){ondomready.add(a)}else{if(c.addEventListener){c.addEventListener(b,a,false);EventCache.add(c,b,a)}else{if(c.attachEvent){c["e"+b+a]=a;c[b+a]=function(){c["e"+b+a](window.event)};c.attachEvent("on"+b,c[b+a]);EventCache.add(c,b,a)}else{c["on"+b]=c["e"+b+a]}}}}var EventCache=function(){var a=[];return{listEvents:a,add:function(b,d,c){a.push(arguments)},flush:function(){var b,c;for(b=a.length-1;b>=0;b--){c=a[b];if(c[0].removeEventListener){c[0].removeEventListener(c[1],c[2],c[3])}if(c[1].substring(0,2)!="on"){c[1]="on"+c[1]}if(c[0].detachEvent){c[0].detachEvent(c[1],c[2])}c[0][c[1]]=null}}}}();addEvent(window,"unload",EventCache.flush);
/*ADDEVENT EXAMPLES
addEvent(elem,type,function);
addEvent(window,'load',function(event){ alert('Images Loaded'); });
addEvent(document,'domready',function(event){ alert('DOM Loaded'); });
*/
/*DOM ELEMENT SELECTION METHOD*/DomQuery=function(){var cache={},simpleCache={},valueCache={};var nonSpace=/\S/;var trimRe=/^\s+|\s+$/g;var tplRe=/\{(\d+)\}/g;var modeRe=/^(\s?[\/>+~]\s?|\s|$)/;var tagTokenRe=/^(#)?([\w-\*]+)/;var nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/;function child(p,index){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v){if(!v){return c}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((" "+ci.className+" ").indexOf(v)!=-1){r[++ri]=ci}}return r}function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(attr=="for"){return n.htmlFor}if(attr=="class"||attr=="className"){return n.className}return n.getAttribute(attr)||n[attr]}function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result}tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci}}}else{if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=="*"){result[++ri]=cj}}}}else{if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=="*")){result[++ri]=n}}}else{if(mode=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(tagName=="*"||n.tagName.toLowerCase()!=tagName))){}if(n){result[++ri]=n}}}}}}return result}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,tagName){if(cs.tagName||cs==document){cs=[cs]}if(!tagName){return cs}var r=[],ri=-1;tagName=tagName.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==tagName){r[++ri]=ci}}return r}function byId(cs,attr,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r}}return r}function byAttribute(cs,attr,value,op,custom){var r=[],ri=-1,st=custom=="{";var f=DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=DomQuery.getStyle(ci,attr)}else{if(attr=="class"||attr=="className"){a=ci.className}else{if(attr=="for"){a=ci.htmlFor}else{if(attr=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(attr)}}}}if((f&&f(a,value))||(!f&&a)){r[++ri]=ci}}return r}function byPseudo(cs,name,value){return DomQuery.pseudos[name](cs,value)}var isIE=window.ActiveXObject?true:false;eval("var batch = 30803;");var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(isIE&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var len1=c1.length;if(!len1){return c2}if(isIE&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}var d=++key;for(var i=0;i<len1;i++){c1[i]._qdiff=d}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,mode,root,id){if(ns==root){var d=root.ownerDocument||root;return d.getElementById(id)}ns=getNodes(ns,mode,"*");return byId(ns,null,id)}return{getStyle:function(el,name){return getStyle(el,name)},compile:function(path,type){type=type||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];var q=path,mode,lq;var tk=DomQuery.matchers;var tklen=tk.length;var mm;var lmode=q.match(modeRe);if(lmode&&lmode[1]){fn[fn.length]='mode="'+lmode[1].replace(trimRe,"")+'";';q=q.replace(lmode[1],"")}while(path.substr(0,1)=="/"){path=path.substr(1)}while(q&&lq!=q){lq=q;var tm=q.match(tagTokenRe);if(type=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");'}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");'}q=q.replace(tm[0],"")}}while(!(mm=q.match(modeRe))){var matched=false;for(var j=0;j<tklen;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(tplRe,function(x,i){return m[i]});q=q.replace(m[0],"");matched=true;break}}if(!matched){throw'Error parsing selector, parsing failed at "'+q+'"'}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(trimRe,"")+'";';q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(path,root,type){if(!root||root==document){root=document}if(typeof root=="string"){root=document.getElementById(root)}var paths=path.split(",");var results=[];for(var i=0,len=paths.length;i<len;i++){var p=paths[i].replace(trimRe,"");if(!cache[p]){cache[p]=DomQuery.compile(p);if(!cache[p]){throw p+" is not a valid selector"}}var result=cache[p](root);if(result&&result!=document){results=results.concat(result)}}if(paths.length>1){return nodup(results)}return results},selectNode:function(path,root){return DomQuery.select(path,root)[0]},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=DomQuery.compile(path,"select")}var n=valueCache[path](root);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?defaultValue:v)},selectNumber:function(path,root,defaultValue){var v=DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var isArray=(el instanceof Array);var result=DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0)},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=DomQuery.compile(ss,"simple")}var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1;var m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j}}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break}}if(empty){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return DomQuery.filter(c,ss,true)},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();var domQuery=DomQuery.select;
/*DOMQUERY REPLACES CSSQUERY AS NOT SUPPORTED IN IE8*/
/*DOMQUERY METHODS
select(path,root):Array
selectNode(path,root):Element
filter(elems,selector,nonMatches):Array
*/

/*OBLONGTECH 2009-10-06 JAVASCRIPT LIBRARY V2.3*/

//####################################################################################################
/*backcompatibility.js*/

function cssQuery(query,group){//REDEFINITION OF CSSQUERY
 if(typeof(group)=='undefined'){ return DomQuery.select(query); }
 else if(isarray(group)){ return DomQuery.filter(group,query); }
 else if(typeof(group)=='object'){ return DomQuery.select(query,group); }
 }
function getElementsByClassName(className,tag,elm){ return DomQuery.select("."+className,elm); }
/*
function getElementsByClass(class,tag,ref){
 var a = [];
 tag = tag || '*';
 ref = ref || document;
 var elems = ref.getElementsByTagName(tag);
 var pattern = new RegExp('(^|\\s)'+class+'(\\s|$)');
 for(var i=0; i<elems.length; i++){
  if(pattern.test(elems[i].className)){ a.push(elems[i]); }
  }
 return a;
 }
*/
//function nextSibling(e){ return nextSib(e); }//function nextSibling is an existing/default JS DOM function
//function prevSibling(e){ return nextSib(e); }
//function getNextSibling(e){ return nextSib(e); }
//function getPrevSibling(e){ return prevSib(e); }

function indexOfArray(obj,val){ return keyofval(obj,val); }
function arrayMinVal(array,start,end){ return minnum(array,start,end); }
function arrayMaxVal(array,start,end){ return maxnum(array,start,end); }

function isEnterKey(evt){ return isKey(evt,'ENTER'); }
function isTabKey(evt){ return isKey(evt,'TAB'); }
function isShiftKey(evt){ return isKey(evt,'SHIFT'); }
function isArrowUpKey(evt){ return isKey(evt,'ARROWUP'); }
function isArrowDownKey(evt){ return isKey(evt,'ARROWDOWN'); }
function triggerOnClickViaEnterKey(evt){ triggerOnClickViaKeyPress(evt,'ENTER'); }

/*
¹-FUNCTION RENAMED|&REDEFINED
²-FUNCTION REPLACED/REDEFINED
³-FUNCTION REMOVED
*/

//####################################################################################################
/*misc.js*/
function docname(bool){//v1.1
 var docname= "";
 var url = window.location.href.toString();
 if(bool){ return url; }
 var slash = url.lastIndexOf("/")+1;
 docname = url.substring(slash,url.length);
 if(docname.lastIndexOf("#")>0) docname = docname.substring(0,docname.indexOf("#"));
 if(docname.lastIndexOf("?")>0) docname = docname.substring(0,docname.indexOf("?"));
 if(docname=='') docname = url.substring(0,slash);
 return docname;
 }
function isIE(v){ return navigator.userAgent.toLowerCase().indexOf('msie'+(typeof(v)=='number'?' '+v:''))!=-1; }//var isIE = navigator.userAgent.search(/msie/i)!= -1
function isArray(a){ return a&&a.constructor!=null&&a.constructor==Array; }
function isFunction(fn){ return typeof(fn)=='function'&&(!Function.prototype.call||typeof(fn.call)=='function'); }
function isElement(e){ return e&&typeof(e)=='object'&&e.nodeType==1&&e.constructor==document.createElement(e.nodeName).constructor; }

//####################################################################################################
/*string.js*/

function strip_tags (str, allowed_tags) {

    var key = '', allowed = false;
    var matches = [];
    var allowed_array = [];
    var allowed_tag = '';
    var i = 0;
    var k = '';
    var html = '';

    var replacer = function (search, replace, str) {
        return str.split(search).join(replace);
    };

    // Build allowes tags associative array
    if (allowed_tags) {
        allowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);
    }

    str += '';

    // Match tags
    matches = str.match(/(<\/?[\S][^>]*>)/gi);

    // Go through all HTML tags
    for (key in matches) {
        if (isNaN(key)) {
            // IE7 Hack
            continue;
        }

        // Save HTML tag
        html = matches[key].toString();

        // Is tag not in allowed list? Remove from str!
        allowed = false;

        // Go through all allowed tags
        for (k in allowed_array) {
            // Init
            allowed_tag = allowed_array[k];
            i = -1;

            if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}
            if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}
            if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag)   ;}

            // Determine
            if (i == 0) {
                allowed = true;
                break;
            }
        }

        if (!allowed) {
            str = replacer(html, "", str); // Custom replace. No regexing
        }
    }

    return str;
}
//END STRIP_TAGS PHP.JS

function mreplace(str,hash){
 var a = [];
 for(var key in hash){ a[a.length] = key; }
 var regexp = a.join('|');
 return str.replace( new RegExp(regexp,'g'), function(m,l){ return hash[m] || hash["\\"+m]; });
 }
function urlEncode(a){ return mreplace(escape(a),{'\\/':'%2F','\\?':'%3F','=':'%3D','&':'%26','@':'%40','\\s':'+'}); }
function htmlEntities(html){ return html.toString().replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'); }
function htmlspaces(str){ return str.toString().replace(/[ ]{2}/g,"&nbsp; ").replace(/[ ]{2}/g,"&nbsp; "); }
function nl2br(str){ return str.toString().replace(/\r\n/g,'<br/>').replace(/[\r\n]/g,'<br/>'); }
function br2nl(text){ return text.replace(/<br\s*\/?>/mg,"\r\n"); }
function camelCase(str){ return str.toString().replace(/([A-Z]+)/g, function(m,l){return l.substr(0,1).toUpperCase() + l.toLowerCase().substr(1,l.length);}).replace(/[\&\.\-\_\=\+\s\?](.?)/g, function(m, l){return l.toUpperCase();}); }
function randstr(len,chars){
 var chars = typeof(chars)=='undefined' || !chars || chars=='' ? "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz" : chars ;
 var len = typeof(len)!='number' ? 8 : len ;
 var randomstring = '';
 for(var i=0; i<len; i++){
  var rnum = Math.floor(Math.random() * chars.length);
  randomstring += chars.substring(rnum,rnum+1);
  }
 return randomstring;
 }
function fileExtension(str){ return str.substr(str.lastIndexOf('.')+1,str.length).toLowerCase(); }

//####################################################################################################
/*array.js*/
function isarray(a){ return a&&a.constructor!=null&&a.constructor==Array; }
function keyofval(obj,val){ for(var i in obj){ if(obj[i]==val){ return i; } } return -1; }
function inarray(a,val){ return (keyofval(a,val)>-1) ? true : false ; }
function concatnest(a){ var b = []; for(var c in a){ if(isarray(a[c])){ b = b.concat(concatnest(a[c])); }else{ b.push(a[c]); } }; return b; }
function minnum(a,start,end){
 start = start || 0 ; end = end || a.length;
 var min = a[start];
 for(var i=start;i<end;i++){ min = (a[i]<min) ? a[i] : min ; }
 return min;
 }
function maxnum(a,start,end){
 start = start || 0 ; end = end || a.length;
 var max = a[start];
 for(var i=start;i<end;i++){ max = (a[i]>max) ? a[i] : max ; }
 return max;
 }
function sortNum(arr){ return arr.sort( function(a,b){ return a-b; } ); }
function echoarray(obj,lvl){ var str=''; for(var i in obj){ /*if(lvl>0&&isarray(obj[i])){}*/ str+=i+' = '+typeof(obj[i])+'<br/>'; } return str; }

//####################################################################################################
/*elements.js*/
function getElem(elemID){
 if(document.getElementById){return document.getElementById(elemID);}
 else if(document.all){return document.all[elemID];}
 else if(document.layers) {return document.layers[elemID];}
 else{alert('Browser Doesn\'t Support DOM')}
 }
function $(){
 var elems = new Array();
 var args = arguments;
 args = (args[0].constructor==Array) ? args[0] : args ;
 for(var i=0;i<args.length;i++){
  var e = args[i];
  if(typeof e == 'string') e = getElem(e);
  if(args.length == 1) return e;
  elems[elems.length] = e;
  }
 return elems;
 }
function nextSib(n){ while((n = n.nextSibling) && n.nodeType != 1); return n; }
function prevSib(n){ while((n = n.previousSibling) && n.nodeType != 1); return n; }
function parseElems(a){ var c = []; var j=0; for(i=0;i<a.length;i++){ if(a[i].nodeType!=3){ c[j++]=a[i]; } } return c; }
/* ²³function getChildren(e){ return parseElems(e.childNodes); }//USAGE EXAMPLE FOR FUNCTION ABOVE*/

//####################################################################################################
/*elements.js part2*/
function insertAfter(newChild,refChild){ refChild.parentNode.insertBefore(newChild,refChild.nextSibling); }
function insertBefore(newChild,refChild){ refChild.parentNode.insertBefore(newChild,refChild); }
function removeElem(e){
 if(typeof(e)=='string') e = getElem(e);
 if(e && e.nodeName.toLowerCase()=='iframe'){ try{ delete window.frames[e.name]; } catch(error){  }; }
 if(e) e.parentNode.removeChild(e);
 }

//####################################################################################################
/*styles.js*/
function getStyle(e,cssProperty){
 if(typeof e=='string'){e = document.getElementById(e);}
 if(e.currentStyle){
  var convertToCamelCase = cssProperty.replace(/\-(.)/g, function(m, l){return l.toUpperCase()});
  return e.currentStyle[convertToCamelCase];
  }
 else if(window.getComputedStyle){
  var elementStyle = window.getComputedStyle(e, "");
  return elementStyle.getPropertyValue(cssProperty);
  }
 }
function setStyle(e,style,value){
 if(typeof e=='string') e = document.getElementById(e);
 var style = style.replace(/\-(.)/g, function(m, l){return l.toUpperCase()});
 e.style[style] = value;
 
 switch(style){
  case 'cursor':
   if(isIE() && value=='pointer'){
    e.style.cursor = 'hand';
    }
   break;
  case 'float':
   e.style.cssFloat = value;
   e.style.styleFloat = value;
   break;
  case 'backgroundImage':
   value = mreplace(value,{"url\\(\\'":"","\\'\\)":""});
   if(isIE() && fileExtension(value)=='png'){
    e.style.backgroundImage = "none";
    e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+value+"', sizingMethod='crop');";
    }
   break;
  case 'opacity':
   if(value>0){ e.style.visibility='visible'; }
   else{ e.style.visibility='hidden'; }
   e.style.MozOpacity = value; //NETSCAPE+MOZILLA
   e.style.KhtmlOpacity = value; //<SAFARI1.X
   e.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + value*100 + ");"; //IE
   break;
  default:break;
  }
 }
function setStyles(arrayOfElements,stylesObject){
 for(var i=0;i<arrayOfElements.length;i++){
  var e = arrayOfElements[i];
  for(var style in stylesObject){
   setStyle(e,style,stylesObject[style]);
   }
  }
 }
function fixStyle(e, cssProperty){
 var value = getStyle(e, cssProperty);
 setStyle(e, cssProperty, value);
 return value;
 }

//####################################################################################################
/*position.js*/
function getScrollY(){ return document.body.scrollTop!=0 ? document.body.scrollTop : (window.pageYOffset || (document.body.parentElement ? document.body.parentElement.scrollTop : 0 )); }
function getPosition(e){
 if(typeof e=='string') e = document.getElementById(e);
 var X=e.offsetLeft, Y=e.offsetTop, p=e;
 if(p.offsetParent){
  while (p=p.offsetParent){
   X += p.offsetLeft;
   Y += p.offsetTop;
   }
  }
 return {'x':e.offsetLeft,'y':e.offsetTop,'X':X,'Y':Y};
 }

//####################################################################################################
/*display.js*/
function show(){ setStyles(arguments,{'display':''}); }
function hide(){ setStyles(arguments,{'display':'none'}); }
function visible(){ setStyles(arguments,{'visibility':'visible'}); }
function transparent(){ setStyles(arguments,{'visibility':'hidden'}); }
function fadein(e,t){ return opacityDimmer(e, 100, (t||500)); }
function fadeout(e,t){ return opacityDimmer(e, 0, (t||500)); }

/*TOGGLEDISPLAY REQUIRES ELEMENTS THAT HAVE STYLE DISPLAY:NONE AS DEFAULT MUST BE WRITTEN INLINE*/
function toggledisplay(){
 for(var i=0;i<arguments.length;i++){
  var e = arguments[i];
  if(typeof e=='string') e = document.getElementById(e);
  if(e.style.display != 'none'){ e.style.display = 'none'; }
  else{ e.style.display = ''; }
  }
 }
function togglevisibility(){
 for(var i=0;i<arguments.length;i++){
  var e = arguments[i];
  if(typeof e=='string') e = document.getElementById(e);
  if(e.style.visibility != 'hidden'){ e.style.visibility = 'hidden'; }
  else{ e.style.visibility = 'visible'; }
  }
 }

//####################################################################################################
/*opacity.css*/
function opacityDimmer(id, opacEnd, millisec, onComplete){
 var e = document.getElementById(id);
 var opacCurr = e.style.opacity == null || e.style.opacity == '' ? (isNaN(getStyle(id,'opacity')) ? 100 : fixStyle(id,'opacity')*100) : e.style.opacity*100;

 var speed = Math.round(millisec/100);
 var timer = 0;
 
 Tweener.cancelTween(id,'opacity');
 var animation = [];
 if(opacCurr>opacEnd){
  for(i=opacCurr;i>=opacEnd;i--){ animation.push( setTimeout("setStyle('" + id + "','opacity'," + i/100 + ")",timer*speed) ); timer++; }
  }
 else if(opacCurr<opacEnd){
  for(i=opacCurr;i<=opacEnd;i++){ animation.push( setTimeout("setStyle('" + id + "','opacity'," + i/100 + ")",timer*speed) ); timer++; }
  }
 
 animation.push( setTimeout("Tweener.removeTween('" + id + "','opacity')",(timer-1)*speed) );
 
 if(typeof(onComplete)=='string'||isFunction(onComplete)) animation.push( setTimeout( onComplete,timer*speed ) );
 
 Tweener.addTween(id,'opacity',animation);
  
 return animation;
 }

//####################################################################################################
/*colors.js*/
function hsb2rgb(h,s,b){
 h = h > 360 ? h-360 : h;
 h = Math.round(h);
 s = Math.round(s);
 b = Math.round(b);

 var hexBrightness = Math.round(b * 2.55);
 if(s==0){
  return { r:hexBrightness, g:hexBrightness, b:hexBrightness };
  }
 var Hi = Math.floor(h / 60);
 var f = h / 60 - Hi;
 var p = Math.round(b * (100 - s) * .0255);
 var q = Math.round(b * (100 - f * s) * .0255);
 var t = Math.round(b * (100 - (1 - f) * s) * .0255);
 switch(Hi){
  case 0: return {r:hexBrightness, g:t, b:p};
  case 1: return {r:q, g:hexBrightness, b:p};
  case 2: return {r:p, g:hexBrightness, b:t};
  case 3: return {r:p, g:q, b:hexBrightness};
  case 4: return {r:t, g:p, b:hexBrightness};
  case 5: return {r:hexBrightness, g:p, b:q};
  }
 return false;
 }
function rgb2hsb(r,g,b){
 var h, s, b;
 r = parseFloat(r); g = parseFloat(g); b = parseFloat(b);

 var cmax = (r>g && r>b) ? r : ( g>b ? g : b );
 var cmin = (r<g && r<b) ? r : ( g<b ? g : b );

 b = cmax / 255.0;
 s = (cmax != 0) ? (cmax - cmin) / cmax : 0 ;

 if(s == 0){ h = 0;}
 else{
  var redc = (cmax - r) / (cmax - cmin);
  var greenc = (cmax - g) / (cmax - cmin);
  var bluec = (cmax - b) / (cmax - cmin);

  if(r==cmax){ h = bluec - greenc; }
  else if(g==cmax){ h = 2.0 + redc - bluec; }
  else { h = 4.0 + greenc - redc; }
  
  h = (h>0) ? h / 6.0 : h + 1.0 ;
  }
 return { h:Math.round(h*360), s:Math.round(s*100), b:Math.round(b*100) };
 }

function dec2hex(n){ var r = n.toString(16); return (r.length==1) ? "0"+r : r ; }
function hex2dec(hex){ return parseInt(hex,16); }
function rgb_hex2dec(hex){ return {'r':hex2dec(hex.substring(0,2)), 'g':hex2dec(hex.substring(2,4)), 'b':hex2dec(hex.substring(4,6))}; }
function parseRGB(str){
 str = str.replace("rgb(","").replace(")","");
 var rgb = str.split(",",3);
 return {r:parseInt(rgb[0]),g:parseInt(rgb[1]),b:parseInt(rgb[2])};
 }

function get_hsb(id){
 var c = parseRGB(fixStyle(id,'background-color'));
 c = rgb2hsb(c.r,c.g,c.b);
 return { h:c.h, s:c.s, b:c.b };
 }
function set_hsb(id,h,s,b){
 h = (h>360) ? h-360 : (h<0 ? h+360 : h );
 var c = hsb2rgb(h,s,b);
 setStyle(getElem(id),'background-color','#'+dec2hex(c.r)+dec2hex(c.g)+dec2hex(c.b));
 }

function animateColor(id,c2,millisec){ animateRGB(id,c2,millisec,'color'); }
function animateBGColor(id,c2,millisec){ animateRGB(id,c2,millisec,'background-color'); }
function animateRGB(id,c2,millisec,param){
 var c1 = parseRGB(fixStyle(id,param));
 c2 = (c2.search('#')>-1) ? rgb_hex2dec(c2.substring(1)) : parseRGB(c2) ;
 
 var msi = millisec/20;//1000/20=50fps
 
 var ir = -(c1.r-c2.r)/msi; var ig = -(c1.g-c2.g)/msi; var ib = -(c1.b-c2.b)/msi;
   
 for(var i=1;i<=msi;i++){
  cr = Math.round(c1.r+i*ir); cg = Math.round(c1.g+i*ig); cb = Math.round(c1.b+i*ib);
  if(cr>255||cb>255||cg>255||cr<0||cb<0||cg<0) alert(i+' : '+cr+','+cg+','+cb);
  var color = '#'+dec2hex(cr)+dec2hex(cg)+dec2hex(cb);
  setTimeout( 'setStyle(\''+id+'\',\''+param+'\',\''+color+'\')', i*10 );
  }
 }

//####################################################################################################
/*tweener.js*///PROTOTYPE DEVELOPMENT BETA
var Tweener = {
 tweens:{},
 addTween:function(id,param,tweener){
  if(typeof(Tweener.tweens[id])=='undefined'){Tweener.tweens[id]={};}
  Tweener.tweens[id][param]=tweener;
  },
 removeTween:function(id,param){ delete Tweener.tweens[id][param]; },
 cancelTween:function(id,param){
  if(typeof(Tweener.tweens[id])!='undefined'&&typeof(Tweener.tweens[id][param])!='undefined'){
   Tweener.clearAll(Tweener.tweens[id][param]); delete Tweener.tweens[id][param];
   }
  },
 clearAll:function(a){for(var i in a){clearTimeout(a[i]);}}
 }

//####################################################################################################
/*cookies.js*/
function getCookie(c){var d=document.cookie.indexOf(c+"=");var a=d+c.length+1;if((!d)&&(c!=document.cookie.substring(0,c.length))){return null}if(d==-1){return null}var b=document.cookie.indexOf(";",a);if(b==-1){b=document.cookie.length}return unescape(document.cookie.substring(a,b))}function setCookie(c,e,a,h,d,g){var b=new Date();b.setTime(b.getTime());if(a){a=a*1000*60*60*24}var f=new Date(b.getTime()+(a));document.cookie=c+"="+escape(e)+((a)?";expires="+f.toGMTString():"")+((h)?";path="+h:"")+((d)?";domain="+d:"")+((g)?";secure":"")}function deleteCookie(a,c,b){if(getCookie(a)){document.cookie=a+"="+((c)?";path="+c:"")+((b)?";domain="+b:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};

//####################################################################################################
/*keyevents.js*/
function keyCode(evt){ var evt = ( window.event || evt ); var key = ( evt.keyCode || evt.charCode || evt.which || 0 ); return key; }
//var KEYNAMES = {13:'ENTER',9:'TAB',16:'SHIFT',38:'ARROWUP',40:'ARROWDOWN'};
var KEYCODES = {'ENTER':13,'TAB':9,'SHIFT':16,'ARROWUP':38,'ARROWDOWN':40,'BACKSPACE':8,'DELETE':46};
function isKey(evt,name){ return ( keyCode(evt)==KEYCODES[name.replace(/[^a-zA-Z 0-9]+/g,'').replace(/[ ]+/g,' ').toUpperCase()] ? true : false ); }
var isShiftKeyHeld = false;
addEvent(document,'keydown',function(event){if(isKey(event,'SHIFT') && !isShiftKeyHeld) isShiftKeyHeld = true; });
addEvent(document,'keyup',function(event){if(isKey(event,'SHIFT')) isShiftKeyHeld = false; });

function stopEvent(event){ if(window.event){/*IE*/ event.cancelBubble = true; event.returnValue = false; }else{ event.preventDefault(); event.stopPropagation(); } return true; } 
function cancelTabKey(event){ if(keyCode(event)==9){ return stopEvent(event); } else return false; }

function triggerEvent(elem,event){
 if(document.all){ elem.fireEvent("on"+event); }
 else{
  var Event = window.document.createEvent("Event");
  Event.initEvent(event, false, true);
  elem.dispatchEvent(Event);
  }
 return false;
 }
function triggerOnClick(elem){
 if(document.all){ elem.fireEvent("onclick"); }
 else{
  var clickEvent = window.document.createEvent("MouseEvent");
  clickEvent.initEvent("click", false, true);
  elem.dispatchEvent(clickEvent);
  }
 return false;
}
function triggerOnClickViaKeyPress(evt,name){
 var evt = ( window.event || evt );
 if(evt && evt.keyCode==KEYCODES[name.replace(/[^a-zA-Z 0-9]+/g,'').toUpperCase()]){
  var e = ( evt.target || evt.srcElement );
  triggerOnClick(e);
  return true;
  }
 else return false;
 }

//####################################################################################################
/*ajax.js*/
var xmlhttp = new Array();
function ajaxload(url,params,id,onComplete){
 id = id ? id : randstr() ;
 xmlhttp[id] = '';
 
 if(window.XMLHttpRequest){ xmlhttp[id] = new XMLHttpRequest(); }
 else if(window.ActiveXObject){ xmlhttp[id] = new ActiveXObject("Microsoft.XMLHTTP"); }

 xmlhttp[id].onreadystatechange = function(){
  if (xmlhttp[id].readyState==4 && (xmlhttp[id].status==200 || window.location.href.indexOf("http")==-1)){
   if(id && document.getElementById(id)){ document.getElementById(id).innerHTML = xmlhttp[id].responseText; }
   if(typeof(onComplete)=='string'||isFunction(onComplete)) setTimeout(onComplete,10);
   }
  }
 var method = (!params ? 'GET' : 'POST' );
 params = (!params ? '' : params );
 url = (url.indexOf('?')<0 ? url+'?ajax_unique_id='+randstr(16) : url+'&ajax_unique_id='+randstr(16) );
 xmlhttp[id].open(method, url, true);
 xmlhttp[id].setRequestHeader('Content-Type','application/x-www-form-urlencoded');
 xmlhttp[id].send(params);
 }
function ajaxeval(url,params){
 id = randstr() ;
 xmlhttp[id]='';
 
 if(window.XMLHttpRequest){ xmlhttp[id] = new XMLHttpRequest();}
 else if(window.ActiveXObject){ xmlhttp[id] = new ActiveXObject("Microsoft.XMLHTTP");}

 xmlhttp[id].onreadystatechange = function(){
  if (xmlhttp[id].readyState==4 && (xmlhttp[id].status==200 || window.location.href.indexOf("http")==-1)){
   var json = eval(xmlhttp[id].responseText);
   }
  }

 var method = (!params ? 'GET' : 'POST' );
 xmlhttp[id].open(method, url, true);
 xmlhttp[id].setRequestHeader('Content-Type','application/x-www-form-urlencoded');
 xmlhttp[id].send(params);
 }
function ajax_formpost(form){
 if(!getElem('ajax_formpost_container')){
  var i = document.createElement('div'); i.id = 'ajax_formpost_container'; i.style.display = 'none'; document.body.appendChild(i);
  }
 else{ var i = getElem('ajax_formpost_container'); }
 if(getElem('ajax_formpost_iframe')){ removeElem('ajax_formpost_iframe'); }
 i.innerHTML = '<iframe name="ajax_formpost_iframe" src="init.html" id="ajax_formpost_iframe" style="display:none;" onload="setTimeout(function(){ ajax_formpost_iframe_onload(); },1);"></iframe>';
 form.target = 'ajax_formpost_iframe';
 form.submit();
 }
function ajax_formpost_iframe_delete(){ removeElem('ajax_formpost_iframe'); removeElem('ajax_formpost_container'); }
function ajax_formpost_iframe_onload(){ var i = window.frames.ajax_formpost_iframe || document.getElementById('ajax_formpost_iframe').contentWindow ; if( i.init() ){ ajax_formpost_iframe_delete(); } };

//#################################################################################################### 
/*imagepreloader.js*/
function MM_preloadImages(){//v3.0
 var d = document;
 if(d.images){
  if(!d.MM_p) d.MM_p = new Array();
  var i,j = d.MM_p.length, a = MM_preloadImages.arguments;
  for(i=0;i<a.length;i++){
   if(a[i].indexOf("#")!=0){
    d.MM_p[j] = new Image;
    d.MM_p[j++].src = a[i];
 }}}}

//####################################################################################################
/*oblongtech.js*///OBLONGTECH PROTOTYPE CLASS
function $$(query,root){
 var o = new O();
 
 if(isElement(query)){ o.items = [query]; }
 else if(isArray(root)){ o.items = DomQuery.filter(root,query); }
 else{ o.items = DomQuery.select(query,root); }
 
 return o;
 }

O = function(){}

O.prototype.css = function(){//SET STYLES
 if(typeof(arguments[0])=='string'/* && typeof(arguments[1])=='undefined'*/){ return getStyle(this.items[0],arguments[0]); }
/*
 else if(typeof(arguments[0])=='string' && typeof(arguments[1])=='string'){
  var styles = {}; styles[arguments[0]]=arguments[1]; setStyles(this.items,styles);
  }
*/
 else if(typeof(arguments[0])=='object'){ setStyles(this.items,arguments[0]); }
 return this;
 }
O.prototype.each = function(fn){ for(var i in this.items){ fn(this.items[i]); } return this; }
O.prototype.add = function(event,fn){ for(var i in this.items){ addEvent(this.items[i],event,fn); } return this; }
//O.prototype.trigger = function(event){ for(var i in this.items){ triggerEvent(this.items[i],event); } return this; }
O.prototype.item = function(num){ return this.items[num]; }
O.prototype.filter = function(query){ this.items = DomQuery.filter(this.items,query); return this; }
O.prototype.exclude = function(query){ this.items = DomQuery.filter(this.items,query,true); return this; }


