
window.onload = window_onload;

/* add any functions that need to run onload in here */
function window_onload()
{
if (injectscroll==true){inject();};
set_rightnav_height(document.getElementById('rightbav-bkg'));
set_rollovers();
space = false; // there's no space for odiogo currently
}

/*  =======================================================
SET_ROLLOVERS
loops through all images looking for class="ro"
if found, adds onmouseover and onmouseout events

// PNG rollovers in Opera 7.5 doesn't seem to work
*/
function set_rollovers()
{
var path, img;
if(document.getElementsByTagName)
{
var isie = /MSIE ((5\.5)|[6789])/.test(navigator.userAgent) && navigator.platform == "Win32" && !/Opera/.test(navigator.userAgent);
var els = document.getElementsByTagName("IMG");
for(var i=0,j=els.length;i<j;i++)
{
if(els[i].className == "ro")
{
// preload image
path = els[i].src;
img = new Image();
img.src = path.substr(0,path.length-4) + '_o.' + path.substr(path.length-3,3);

// attach event handlers
els[i].onmouseover = function()
{
var path;
if(isie && /\.png'/i.test(this.runtimeStyle.filter)){
path = this.runtimeStyle.filter;
path = path.substr(56,path.indexOf("'",56) - 56);
this.ofilter = this.runtimeStyle.filter;
this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft." +
"AlphaImageLoader(src='" + path.substr(0,path.length-4) + '_o.' + path.substr(path.length-3,3) + "',sizingMethod='scale')";
}else{
path = this.src;
this.osrc = path;
this.src = path.substr(0,path.length-4) + '_o.' + path.substr(path.length-3,3);
}

};

els[i].onmouseout = function()
{
if(isie && /\.png'/i.test(this.runtimeStyle.filter)){
this.runtimeStyle.filter = this.ofilter;
}else{
if(this.osrc)this.src = this.osrc;
}
};

}
}
}
}


/* utility functions here */
function openWin(sImg, iWidth, iHeight)
{
window.open('<?php echo $PHP_SELF; ?>?img=' + sImg, 'the_window', "width=" + iWidth + ",height=" + iHeight + ",resizable=yes,scrollbars=no");
}