// aztacos.js

function PreLoadImages()
{
	img1=new Image();
	img2=new Image();
	img3=new Image();
	img4=new Image();

	img1.src="./img/menu_garden_railroad_products_s.gif";
	img2.src="./img/menu_wrought_iron_s.gif";
	img3.src="./img/menu_rides_s.gif";
	img4.src="./img/menu_furniture_s.gif";
}

function CatalogView(img,desc)
{
/*
	// Get the dimensions of the img
	img1=new Image();
	img1.src='./img/'+img;

	width=img1.width+10+10;
	height=img1.height+10+10;
*/
	// *&* TEMP KLUDGE
	width=500;
	height=400;
/*
	// If the values are <= 20, that means that the image hasn't been loaded yet. Wait a second and try it again.
	if(width <= 20 || height <= 20)
	{
		setTimeout('CatalogView("'+img+'","'+desc+'");',1000);	// wait a sec
		return;
	}

	// Else the dimensions are valid, so open the new window

	// If there is a desc, increase the height
	if(desc.length > 0)
	{
//*&*		height+=50;
	}
*/
	// Open a new window that has this in it
	window.open("view_item.php?img=./img/grp/"+img+"&desc="+desc,"catalog_view_popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height);
}

function RidesView(img,desc)
{
	width=550;
	height=450;

	// Open a new window that has this in it
	window.open("view_item.php?img=./img/rides/"+img+"&desc="+desc,"catalog_view_popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height);
}

function ViewGalleryImage(img,width,height,desc,header,link)
{
	var obj=document.getElementById('image');
	obj.src=img;
	obj.width=width;
	obj.height=height;
	
	if(link.length > 0)
	{
		obj.style.cursor='pointer';
		obj.onclick=function(){document.location=link;}
	}
	else
	{
		obj.style.cursor='';
		obj.onclick=null;
	}

	obj=document.getElementById('desc');
	obj.innerHTML=desc;
	
	var hdr="";
	if(link.length > 0)
	{
		hdr+="<a href='"+link+"'>";
	}
	hdr+=header;
	if(link.length > 0)
	{
		hdr+="</a>";
	}
	obj=document.getElementById('header');
	obj.innerHTML=hdr;
	
	return false;
}
