/* ,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,. *\

   Zen JavaScript DHTML
   (c) 2006 Zendhi Nagao <nagaozen@hotmail.com>

   This Lib is freely distributable under the terms of an MIT-style license.
   For details, see Zen web site: http://zend.lojcomm.com.br

   ps[0]: This Lib is derived from Dithered 1k JS library
          http://www.dithered.com

\* ,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,.·'`'·.,,. */

var imgsPath="/octopus/design/images/";

var d=document;var l=d.layers;var op=navigator.userAgent.indexOf('Opera')!=-1;var ie=d.all?1:0;
function gE(e,f) { return $(e) }
function sE(e) { e.setStyle("visibility", "visible") }
function hE(e) { e.setStyle("visibility", "hidden") }
function gX(e) { return e.getLeft() }
function gY(e) { return e.getTop() }
function gW(e) { return e.getSize().size.x }
function gH(e) { return e.getSize().size.y }
function gO(e) { return ( e.getStyle("opacity") * 100 ) }
function sX(e,x) { e.setStyle("left", x) }
function sY(e,y) { e.setStyle("top", y) }
function sZ(e,z) { e.setStyle("z-index", z) }
function sW(e,w,m) { e.setStyle("width", w + m) }
function sH(e,h,m) { e.setStyle("height", h + m) }
function sO(e,o) { e.setStyle("opacity", o / 100); }
function sC(e,t,r,b,x){ e.style.clip='rect(' + t + ' ' + r + ' ' + b + ' ' + x + ')' }

function cC(e,c){e.className=c;}
function hC(e,c){if(e.className==null){if(c==null)return true;else return false;}var namesArray=e.className.split(" ");for(var i=0;i<namesArray.length;i++)if(namesArray[i]==c)return true;return false;}
function rC(e,c){if(e.className==null)return;var newNamesArray=new Array();var namesArray=e.className.split(" ");for(var i=0;i<namesArray.length;i++)if(namesArray[i]!=c)newNamesArray.push(namesArray[i]);e.className=newNamesArray.join(" ");}

function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}else if(e.innerHTML){e.innerHTML='';e.innerHTML=h;}}
function cH(e1,e2){wH(e2,e1.innerHTML);}
function mL(e,x,y){sX(e,x);sY(e,y);}
function rL(e,w,h,m){sW(e,w,m);sH(e,h,m);}

function bW() { return window.getWidth() }
function bH() { return window.getHeight() }
function pW() { return window.getScrollWidth() }
function pH() { return window.getScrollHeight() }
function rX() { return window.getScrollLeft() }
function rY() { return window.getScrollTop() }

function sI(id,i){e=gE(id);e.src=i;}
function dE(id,s){e=gE(id);if(typeof s=="undefined")s=(e.style.display=="none")?1:0;e.style.display=(s==1)?'':'none';}
function pI(){d.pli=new Array();var i,a=pI.arguments;for(i=0;i<a.length;i++){d.pli[i]=new Image();d.pli[i].src=a[i];}}
function wait(t){var st,now,dif;st=new Date();while(1){now = new Date();dif = now-st;if(dif>t) return;}}

if(window.ActiveXObject && !window.XMLHttpRequest){window.XMLHttpRequest=function(){return new ActiveXObject('Microsoft.XMLHTTP');}}

function ajaxRequest(/* string */ fn, /* string */ url, /* string */ postdata) {
    postdata = postdata || null;
    
    var indicator = $("mouseTrail"),
        request   = new XHR({
            method: ( postdata ) ? "post" : "get",
            onSuccess: function(txt, xml) {
                var obj = request.transport,
                    f   = function(){ return eval(fn) };
                
                f();
                
                _onComplete();
            },
            onFailure: function(transport) {
                alert("{status} - {description}".substitute({
                    "status": request.transport.status,
                    "description": request.transport.statusText
                }));
                
                _onComplete();
            }
        });
    
    function _onRequest() {
        sE( indicator );
    };
    
    function _onComplete() {
        hE( indicator );
    };
    
    _onRequest();
    request
        .setHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8")
        .send(url, postdata);
}

function ajaxDisplay(id, obj) {
    $(id).setHTML( obj.responseText );
}

/*
function ajaxRequest(fn, url, postdata) {
    sE(gE("mouseTrail"));
    if(!postdata)postdata=null;
    r=new XMLHttpRequest();
    r.onreadystatechange = function() {
        ajaxExecute(fn,r);
    };
    
    if(postdata == null){
        r.open("GET",url,true);
    } else {
        r.open("POST",url,true);
        r.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");
    }
    
    r.setRequestHeader("If-Modified-Since","Tue, 31 Aug 1982 00:00:00 GMT");
    r.send(postdata);
}

function ajaxExecute(fn, obj) {
    if (obj.readyState == 4) {
        hE(gE("mouseTrail"));
        if (obj.status == 200) this.tmr = window.setTimeout("" + eval(fn) + "", 100);
        else alert(obj.status + " - " + obj.statusText);
    }
}

function ajaxDisplay(id,obj) {
    e = gE(id);
    wH(e, obj.responseText);
}
*/

