function fixPNG(element)
{
  if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent))
  {
    var src;
	
    if (element.tagName=='IMG')
    {
      if (/\.png$/.test(element.src))
      {
        src = element.src;
        element.src = path+"/images/blank.gif";
      }
    }
    else
    {
      src = element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i);
      if (src)
      {
        src = src[1];
        element.runtimeStyle.backgroundImage="none";
      }
    }
    if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
  }
}
function openw(res,title) {
   rand=Math.random().toString().substring(2,15);
   //window.open(path + "/lib/show_pic.php?src="+res+"&title="+title, 'new_'+rand, "top=50, left=50, width=50, height=50, channelmode=no, toolbar=no, location=no, status=no, directories=no, menubar=no, resizable=yes");
   window.open(path + "/lib/show_pic.php?src="+res+"&title="+title, 'new_'+rand, "toolbar=1,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=1");
}
function rand( min, max ) {    // Generate a random integer
    // 
    // +   original by: Leslie Hoare
 
    if( max ) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    } else {
        return Math.floor(Math.random() * (min + 1));
    }
}
var banner_old = -1;
function BannerChange(n,type) 
{
    /*
    BannerIndex = rand(0,n-1);
    while (BannerIndex == banner_old)
    {
    	BannerIndex = rand(0,n-1);
    }
    
    banner_old = BannerIndex;
    */
    document.getElementById("div_banners_"+type).innerHTML = document.getElementById(banners_index[BannerIndex]).innerHTML;
    BannerIndex = (BannerIndex < (banners_index.length - 1)) ? ++BannerIndex :0;
}
