function bviodAction()
{

}
// Image Preloader
function bImagePreloader(images,callback)
{
	// store the callback
	this.callback = callback;

	// initialize internal state.
	this.nLoaded = 0;
	this.nProcessed = 0;
	this.aImages = new Array;

	// record the number of images.
	this.nImages = images.length;

	// for each image, call preload()
	for ( var i = 0; i < images.length; i++ )
		this.preload(images[i]);
}
bImagePreloader.prototype.preload = function(image)
{
	// create new Image object and add to array
	var oImage = new Image;
	this.aImages.push(oImage);

	// set up event handlers for the Image object
	oImage.onload = bImagePreloader.prototype.onload;
	oImage.onerror = bImagePreloader.prototype.onerror;
	oImage.onabort = bImagePreloader.prototype.onabort;

	// assign pointer back to this.
	oImage.oImagePreloader = this;
	oImage.bLoaded = false;
	oImage.source = image;

	// assign the .src property of the Image object
	oImage.src = image;
}
bImagePreloader.prototype.onComplete = function()
{
	this.nProcessed++;
	if ( this.nProcessed == this.nImages )
		this.callback(this.aImages);
}
bImagePreloader.prototype.onload = function()
{
	this.bLoaded = true;
	this.oImagePreloader.nLoaded++;
	this.oImagePreloader.onComplete();
}
bImagePreloader.prototype.onerror = function()
{
	this.bError = true;
	this.oImagePreloader.onComplete();
}
bImagePreloader.prototype.onabort = function()
{
	this.bAbort = true;
	this.oImagePreloader.onComplete();
}

function findPos(obj) {
	var curleft = curtop = curwidth = curheight = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		curwidth = obj.offsetWidth;
		curheight = obj.offsetHeight;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
			//curwidth += obj.offsetWidth;
		    //curheight += obj.offsetHeight;
		}

	}
	return [curleft,curtop,curwidth,curheight];
}

function showRBanner(banner,img,width,height)
{
    if(document.all) { e = event; }
    var obj = document.getElementById('bannerContainer');
    var iobj = document.getElementById('rolloverBannerImg');
    obj.style.display = 'block';
    iobj.src = img;
    iobj.width = width;
    iobj.height = height;
    pos = findPos(banner);
    obj.style.left = (pos[0] - width - 10) + 'px';
    obj.style.top = pos[1] + 'px';
}

function hideRBanner()
{
    document.getElementById('bannerContainer').style.display = 'none';
}

/*** version two ***/
function myfindObj(n,d)
{
    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=myfindObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function bannershowHide(layer,banner,v)
{
    if ((obj = myfindObj(layer)) != null) {
        v = (v=='show') ? 'visible' : (v=='hide') ? 'hidden' : v;
        if ((bobj = myfindObj(banner)) != null) {
            var pos = findPos(obj);
            var bpos = findPos(bobj);
            obj.style.top = bpos[1] + 'px';
            obj.style.left = (bpos[0] - parseInt(obj.style.width) - 20) + 'px';
            obj.style.visibility = v;
        }
    }
}
function topmenushowHide(layer,menu,v)
{
    if ((obj = myfindObj(layer)) != null) {
        v = (v=='show') ? '' : (v=='hide') ? 'none' : v;
        if ((bobj = myfindObj(menu)) != null && (aobj = myfindObj(layer + '_href')) != null) {
            var apos = findPos(aobj);
            var bpos = findPos(bobj);
            var pos = findPos(obj);
            var max_left_pos = bpos[0] + bpos[2];
            var left_pos = apos[0] + 248;
            if (left_pos > max_left_pos) { left_pos = max_left_pos - 248; }
            obj.style.top = (bpos[1] + bpos[3] - 1) + 'px';
            obj.style.left = left_pos - 1 + 'px';
            obj.style.display= v;
            if (v == 'visible') {
                aobj.className = "active";
            } else {
                aobj.className = "";
            }
        }
    }
}
function showActiveTopNav(menu)
{
    if ((obj = myfindObj(menu)) != null) {
        aobj.className = "active";
    }
}
