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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function init_sucker()
{
    sfHover = function() {

        if ( document.getElementById)
        {
            var sfEls = document.getElementById("sucker").getElementsByTagName("LI");
            for (var i=0; i<sfEls.length; i++)
            {
                sfEls[i].onmouseover = function() { this.className += " sfhover"; }
                sfEls[i].onmouseout = function() { this.className = this.className.replace('sfhover', ''); }
            }

            var _input = document.getElementsByTagName("input");

            for ( var _i=0,_c=_input.length; _i<_c; _i++)
            {
                if ( _input[_i].type == 'text')
                {
                    _input[_i].onfocus=function() { this.className+=" over"; }
                    _input[_i].onblur=function() { this.className=this.className.replace("over", ""); }                    
                }
            }

            var _textarea = document.getElementsByTagName("textarea");

            for ( var _t=0,_c=_textarea.length; _t<_c; _t++)
            {
                _textarea[_t].onfocus=function() { this.className+=" over"; }
                _textarea[_t].onblur=function() { this.className=this.className.replace("over", ""); }                    
            }
        }
    }

    sfHover();
}

function thumb_prev(_target, _src, _height, _width, _visible)
{
    var _image = document.getElementById(_target);
    _image.style.visibility = (_visible) ? 'visible' : 'hidden';
    _image.src = _src;
    _image.height = _height;
    _image.width = _width;
    return;
}

var _win;

function pop_up( _url, _name, _width, _height, _center, _resize, _posleft, _postop, _menubar ) {
         
    var _x, _y = 0;
    var _offset = 20;
        
    _width = parseInt(_width) + _offset;
    _height = parseInt(_height)  + _offset;

    if ( ( parseInt(navigator.appVersion) >= 4 ) && ( _center != 0 ) )
    {
        _x = ( ( screen.width - _width ) / 2 );
        _y = ( ( screen.height -_height ) / 2 );
    }

    else
    {
        _x = _posleft;
        _y = _postop;
    }

    _menubar = _menubar ? "menubar=yes" : "menubar=no";

    if ( typeof _win != 'undefined' || _win != null )
    {
        if ( !_win.closed )
        {
            _win.location    =  _url;
            _win.resizeTo(_width, _height);

            var _scrWidth = _win.innerWidth || _win.document.body.clientWidth;
            var _scrHeight = _win.innerHeight || _win.document.body.clientHeight;

            _width = ( _scrWidth >= _width ) ? ( _scrWidth - _width ) : ( _width - _scrWidth );
            _height = ( _scrHeight >= _height ) ? ( _scrHeight - _height ) : ( _height - _scrHeight );
                        
            _win.resizeBy( _width, _height );
        }

        else
        {
            _win = window.open( _url, _name, 'width='+_width+', height='+_height+', top='+_y+', left='+_x+', resizable=yes, scrollbars=yes, location=no, directories=no, status=no, '+_menubar+', toolbar=no');
        }
    }

    else
    {
        _win = window.open( _url, _name, 'width='+_width+', height='+_height+', top='+_y+', left='+_x+', resizable=yes, scrollbars=yes, location=no, directories=no, status=no, '+_menubar+', toolbar=no');
    }

    _win.opener  =   self;
    _win.focus();
}

var Hover = new Object();

Hover = {
    tags: ['input', 'textarea', 'select'],
    load: function()
    {
        for (var t = 0, c = this.tags.length; t < c; t++) {
            if (document.getElementsByTagName) {
                var elements = document.getElementsByTagName(this.tags[t]);
                for (var e in elements) {
                    if (typeof elements[e].tagName != 'undefined') {
                        elements[e].onfocus = function()
                        {
                            var span = this.parentNode;
                            span.className += ' hover';
                        };
                        elements[e].onblur = function()
                        {
                            var span = this.parentNode;
                            span.className = span.className.replace(/(\s*hover)+/, '');
                        };
                    }
                }
            }
        }
    }
};
