function Sello_GalleryController()	{

	this.pictures = new Array();
	this.actualindex = -1;
	this.first = -1;
	this.last  = -1;
	this.dir   = '';

	this.addPicture = function(picture)	{
		if (!this.pictures.length)	{
		  this.actualindex = 0;
		  this.first = 0;
		}		
	  this.last = this.pictures.length;
	  this.pictures[this.pictures.length] = picture;
	}
	
	this.isOnFirstIndex = function()	{
	  return this.actualindex == this.first;
	}

	this.isOnLastIndex = function()	{
	  return this.actualindex == this.last;
	}
	
	this.nextPicture = function() {
	  this.actualindex++;
	  document.getElementById('gallerypicture').src=this.dir + this.pictures[this.actualindex].name;
	  writeSpan(getWorkWindow(),'picturecount',(this.actualindex+1));
	}

	this.previousPicture = function() {
	  this.actualindex--;
	  document.getElementById('gallerypicture').src=this.dir + this.pictures[this.actualindex].name;
	  writeSpan(getWorkWindow(),'picturecount',(this.actualindex+1));
	}


}



function Sello_GalleryPicture()	{
  this.name = '';
}


function Sello_PictureView(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop)   // v4.01
{ 
	var minHeight = 300;
  var maxHeight = 300;
  
	var header='sellocentrum.hu';
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	
	if (imageType == "swf")
	{
  	  newWindow.document.write('<html><title>'+header+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	  newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	  newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	  newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	  newWindow.document.write('</embed></object>');	
	}
	else
	{
  	  newWindow.document.write('<html><title>'+header+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()" background="'+imageName+'">'); 
	  newWindow.document.write('<img src=\"img/hu/spacer.gif\" width='+imageWidth+' height='+imageHeight+' alt=\"'+header+'\">'); 	
	}
	
	newWindow.document.write('</body></html>');
	newWindow.document.close();

	 var w = getWindowWidth(newWindow.top);
	 var wh = getDocumentHeight(newWindow);
	 var x = (screen.width - w)/2;
	 
	 var tmp = 0;
	 var h = Math.max(minHeight,wh);
	 h = Math.min(maxHeight,h);
	 h = h + tmp;
	
	 var y = (screen.height - h)/3;
	
	 if (parseInt(navigator.appVersion)>3) {
/*	   if (navigator.appName=="Netscape") {
	    newWindow.top.outerHeight=h+50;
	    newWindow.top.outerWidth=w+10; 
	   }
	   else {
	     newWindow.top.resizeTo(w+50,h+50);
	   } */
	    newWindow.top.moveTo(x,y);
	  }


	newWindow.focus();
}

