<!--
function preloadImgs()
{
var myimgs = new Array();
var base= "images/";
if (document.images)
	{
		for (i=0;i<preloadImgs.arguments.length;i++)
		{
			myimgs[i] = new Image;
			myimgs[i].src = base + preloadImgs.arguments[i];
		}
	}
}

function showImage(img)
{
    image = new Image();
    image.src = (img);
   
    var width  = Math.floor(image.width + 40 );
    var height = Math.floor(image.height + 40);
    
    if((image.width==0)&&(image.height==0))
    {
        width = 600;
        height = 400;
    }
    
    var left   = Math.floor((screen.availWidth - width) / 2);
    var top    = Math.floor((screen.availHeight - height) / 2);
    dims = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
    newWindow = window.open('popup/show_img.php?img=' + img , '', dims, 'screenshot', ',toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes');
    newWindow.focus();
}

function showVideo(title, videoid, w, h)
{ 
    var width = Math.floor(w + 40 );
    var height = Math.floor(h + 30);
    
    if((width==0)&&(height==0))
    {
        width = 600;
        height = 400;
    }
    
    var left   = Math.floor((screen.availWidth - width) / 2);
    var top    = Math.floor((screen.availHeight - height) / 2);
    dims = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
    newWindow = window.open('popup/show_video.php?title=' + title + '&url=' + videoid + '&width=' + w + '&height=' + h , '', dims, 'screenshot', ',toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no');
    newWindow.focus();
}

function ResizeWindow() 
{
    if (navigator.appName == "Microsoft Internet Explorer")
    {
        iHeightOffset = 105;
    }
    else
    {   
        iHeightOffset = 80;
    }  
         
    iWidth  = document.images[1].width + 40;
    iHeight = document.images[1].height + iHeightOffset;
    
    if ((screen.width < iWidth) || (screen.height < iHeight))
    {
        if (screen.height < iHeight)
        {
            document.images[1].height = Math.floor(screen.height*0.88);
            iWidth  = document.images[1].width + 40;  
        }
        if (screen.width < iWidth)
        {
            factor = (screen.width*0.84) / document.images[1].width;
            document.images[1].height = Math.floor(screen.height*factor);  
        }
            
        iWidth = document.images[1].width + 40; 
        iHeight = document.images[1].height + iHeightOffset;  
        
        iLeft = Math.floor((screen.availWidth - iWidth) / 2);
        iTop  = Math.floor((screen.availHeight - iHeight) / 2);
        window.moveTo(iLeft, iTop);
        window.resizeTo(iWidth, iHeight); 
    }
    
    iLeft = Math.floor((screen.availWidth - iWidth) / 2);
    iTop  = Math.floor((screen.availHeight - iHeight) / 2);
    window.moveTo(iLeft, iTop);
    window.resizeTo(iWidth, iHeight);
    window.focus();    
};

function Loading()
{
    if (document.getElementById) 
    {  // DOM3 = IE5, NS6
        document.getElementById('loading').style.visibility = 'hidden';
        document.getElementById('screenshot').style.visibility = 'visible';       
    }
    else    
    {
        if (document.layers)
        {  // Netscape 4
            document.loading.visibility = 'hidden';
            document.screenshot.visibility = 'visible';
        }
        else
        {  // IE 4
            document.all.loading.style.visibility = 'hidden';
            document.all.screenshot.style.visibility = 'visible';
        }
   }
}

//-->
