function openwindow(Url, Wid, Hei)
{
	window.open (Url, 'Desin', 'toolbar=no,status=no,menubar=no,scrollbars=no,fullscreen=no,resizable=no,width='+Wid+',height='+Hei);
}

var CurImgId = 0;

function ListImg()
{
	if (!window.ListImgs)
		window.ListImgs = new Array();

	this.ID = window.ListImgs.length;
	this.Type = "ListImg";

	// containers for properties
	this.IdImg = new Array();
	this.Src = new Array();
	this.Link = new Array();
	this.Alt = new Array();
	this.Target = new Array();
	this.Width = new Array();
	this.Height = new Array();
	this.Didascalia = new Array();
	this.Img = new Array()
	
	// procedures for Menu object
	this.AddItem = fAddItem;

	window.ListImgs[window.ListImgs.length] = this;
}

function fAddItem(sIdImg,sSrc,sLink,sAlt,sTarget,sWidth,sHeight,sDidascalia)
{
	if (sIdImg) this.IdImg[this.IdImg.length] = sIdImg; else this.IdImg[this.IdImg.length] = '';
	if (sLink) this.Link[this.Link.length] = sLink; else this.Link[this.Link.length] = '';
	if (sAlt) this.Alt[this.Alt.length] = sAlt; else this.Alt[this.Alt.length] = '';
	if (sTarget) this.Target[this.Target.length] = sTarget; else this.Target[this.Target.length] = '';
	if (sWidth) this.Width[this.Width.length] = sWidth; else this.Width[this.Width.length] = '';
	if (sHeight) this.Height[this.Height.length] = sHeight; else this.Height[this.Height.length] = '';
	if (sDidascalia) this.Didascalia[this.Didascalia.length] = sDidascalia; else this.Didascalia[this.Didascalia.length] = '';

	if (sSrc) 
	{
		this.Img[this.Src.length] = new Image(); 
		this.Img[this.Src.length].src = sSrc;
		this.Src[this.Src.length] = sSrc; 
	}
	else
	{
		this.Img[this.Src.length] = new Image(); 
		this.Src[this.Src.length] = '';
	}
}

function ShowNextImg()
	{
		if(window.ListImgs!=null)
		{
			OldId = CurImgId;
			CurImgId = CurImgId + 1;
			if(window.ListImgs.Src[CurImgId]==null)
				CurImgId = 0;
			if(CurImgId != OldId)
			{
				objImg = GetObjId('a_immagine');
				objLnk = GetObjId('a_href');
				objDid = GetObjId('a_didascalia');
	
				if(window.ListImgs.Src[CurImgId]!=null && window.ListImgs.Src[CurImgId]!='')
				{
					if (document.all)
					{
						var CrossFadeDuration = 3;
						objImg.style.filter="blendTrans(duration=2)";
						objImg.style.filter="blendTrans(duration=CrossFadeDuration)";
						objImg.filters.blendTrans.Apply();
					}
	
					objImg.src = window.ListImgs.Img[CurImgId].src;
					objImg.width = window.ListImgs.Width[CurImgId];
					objImg.height = window.ListImgs.Height[CurImgId];
					objImg.alt = window.ListImgs.Alt[CurImgId];
					
					if (document.all) objImg.filters.blendTrans.Play();
				}
				if(window.ListImgs.Link[CurImgId]!=null && window.ListImgs.Link[CurImgId]!='')
				{
					objLnk.style.cursor='hand';
					objLnk.href = window.ListImgs.Link[CurImgId];
					if(window.ListImgs.Link[CurImgId]!='')
						objLnk.target = window.ListImgs.Link[CurImgId];
					else
						objLnk.target = '_self';
				}
				else
				{
					if (document.all)
						objLnk.href = '#';
					else
						objLnk.href = 'http://www.cftpackaging.eu/index.php';
					objLnk.target = '_self';
					objLnk.style.cursor='default';
				}
				if(objDid!=null)
				{
					objDid.innerHTML = window.ListImgs.Didascalia[CurImgId];
				}
				setTimeout('ShowNextImg()',TimeOut);
			}
		}
	}

function GetObjId(IdTxt)
{
	var Obj=null;
	if (document.all)
	{
		Obj = document.all(IdTxt);
	}
	else
	{
		Obj = document.getElementById(IdTxt);
	}
	return Obj;
}