var slideShowURL = '/nyito/slideshow/SlideShow.html'; //parameter
var slideShowNS4URL = '/i/hpti/1/wimg/Shared/SlideShow/SlideShowNS4.html'; //parameter
var ns4 = false;

if( navigator.appName == "Netscape" )
{
    version = parseInt(navigator.appVersion);
    ns4=(version == 4);
}


function Slide(url, height, width, caption)
{
	this.url = url;
    //height = parseInt(height);
    //width = parseInt(width);
 	if(height > 0 && width > height  && width > 500)
	{
    	this.width = 500;
    	this.height = (height/width)*500;
    }
    else if(width > 0 && height >= width && height > 500)
    {
    	this.height = 500;
    	this.width = (width/height)*500;
    }
    else if(height > 0 && width > 0 && width <= 500 && height <= 500)
    {
    	this.width = width;
    	this.height = height;
    }  	
	else
	{
		this.width = 500;
    	this.height = 375;
   	}
   	//document.write("b<br>");
	this.caption = caption;
}


function openSlideShow2(initialIndex, language) {

	var myWidth = 700;		// if 800x600 or less, take up
	var myHeight = 600;	// the whole screen.
	var myLeft = Math.round((screen.availWidth - myWidth) / 2);
	var myTop = Math.round((screen.availHeight - myHeight) / 2)-25;

	if (myTop < 0) { myTop = 0; }	// bugfix for Opera
	if (screen.availHeight < 600) { myTop-=20; }

	currentSlideIndex = initialIndex;//initialize the global

	var url = (ns4) ? slideShowNS4URL : slideShowURL;

	var slideWindow = window.open(url + '?lang=' + language, 'slideshow', 'scrollbars=no,titlebar=no,location=no,status=no,toolbar=no,resizable=no,width='+myWidth+',height='+myHeight+',top='+myTop+',left='+myLeft);

	slideWindow.focus();
}
