// GLS.js
// Version 1.10 

var photo;
var picts = new Array()
var xpos = -320;
var trainID;
var speed = 3;
var workingWin;
var pageReady=false;

function loadGLS()
{
    makeGLS();
    pageReady=true;
    self.focus();
}

function GLS(id, fname, photog, wpix, hpix, picname, dim, price )
{
	this.id=id;
	
	this.fname=fname;
	this.photog=photog;
	this.wpix=wpix;
	this.hpix=hpix;
	this.picname=picname;
	this.dim=dim;
	this.price=price;
	
	return this;
}

function makeGLS()
{
	picts[0]   = new GLS( 0,  "blank.gif",     1, 760, 495, "----", "22x500cm", "£2,250");

	picts[1]   = new GLS( 1,  "GLS_01.jpg",    1, 760, 480, "GLS 01", " ", " "  );
	picts[2]   = new GLS( 2,  "GLS_02.jpg",    1, 760, 480, "GLS 02", " ", " "  );
	picts[3]   = new GLS( 3,  "GLS_03.jpg",    1, 565, 475, "GLS 03", " ", " "  );
	picts[4]   = new GLS( 4,  "GLS_04.jpg",    1, 345, 423, "GLS 04", " ", " "  );
	picts[5]   = new GLS( 5,  "GLS_05.jpg",    1, 340, 340, "GLS 05", " ", " "  );
	picts[6]   = new GLS( 6,  "GLS_06.jpg",    1, 340, 340, "GLS 06", " ", " "  );
	picts[7]   = new GLS( 7,  "GLS_06.jpg",    1, 340, 340, "GLS 07", " ", " "  );
	picts[8]   = new GLS( 8,  "GLS_06.jpg",    1, 340, 340, "GLS 08", " ", " "  );
	picts[9]   = new GLS( 9,  "GLS_06.jpg",    1, 340, 340, "GLS 09", " ", " "  );
 
//	alert(picts.length);
}

function showGLS(x)
{
		var xp=50;
		var yp=50;
		var scrnwide=850;
		var scrnhigh=510;
		var imgfpath="";
		var imgobject;
		var ndx = parseInt(x);
				
		if (ndx >= 0 && ndx < picts.length)
		{
			imgfname =  picts[ndx].fname;
			imgfpath = "images/"+imgfname;
			photog   =  picts[ndx].photog;
			
			img_wide =  picts[ndx].wpix;
			img_high =  picts[ndx].hpix;

			picname    =  picts[ndx].picname;
			dimensions =  picts[ndx].dim;
			price      =  picts[ndx].price;
			
			// price = " ";
			// dimensions = " ";
		}
		else
		{
			alert(" Invalid index ");
		}

		if (img_wide < 20)
		{
			img_wide=650
		}
		
		if (img_high < 20)
		{
			img_high=450
		}
		
		if (screen.width > 1780)
		{
			scrnwide = img_wide +  100;
			scrnhigh = img_high +  75;
		}
		else
		{
			scrnwide = img_wide +  40;
			scrnhigh = img_high +  80;
		}

		scrnwide = 850;
		scrnhigh = 580;

		if (screen)
		{
			xp = (screen.width -scrnwide)/2;
			yp = ((screen.height-scrnhigh)/2)-30;

			if (xp < 1)
			{
				xp=0;
			}

			if (yp < 1)
			{
				yp=0;
			}
		}

		xp = 20;
		yp = 50;


		winStr = "window.open('','','toolbar=no,location=no,menubar=no,resizable=no,dependent=yes,status=no,scrollbars=no,alwaysRaised=yes,width=" + scrnwide + ",height=" + scrnhigh + ",left=" + xp + ",top=" + yp + "')";
		workingWin = eval(winStr);
		workingWin.focus;
		workingWin.document.open();
		workingWin.document.writeln('<html>\n<head>\n<title>Copyright &copy; 2009, General Labour Services Ltd. : www.generallabourservices.com</title>\n');
		workingWin.document.writeln('<meta http-equiv="imagetoolbar" content="no" />');
		workingWin.document.writeln('<style type=\"text/css\">');
		workingWin.document.writeln('.details {font-family: Verdana, Tahoma, Arial, Swiss, Helvetica, sans-serif; font-size: 12px; color: #ffffee; font-weight: bold; text-align: center; line-height: 150%; }');
		workingWin.document.writeln('.rights {font-family: Verdana, Tahoma, Arial, Swiss, Helvetica, sans-serif; font-size: 10px; color: #ffffee; }');
		workingWin.document.writeln('</style>\n');

		workingWin.document.writeln('<script language=\"JavaScript\" type=\"text/javascript\">\nvar ndxPict=0;\nself.focus;\n');

		workingWin.document.writeln('function nextPicture()\n{\n\topener.openPicture(ndxPict);\n}\n');

		workingWin.document.writeln('</script>\n</head>\n');
		workingWin.document.writeln('<body onclick=\"self.close();\" bgcolor=\"#111000\" text=\"#dddddd\"><center>');
		workingWin.document.writeln('<img src=\"./images/glass.gif\" height=\"1\" width=\"1\" vspace=\"8\" hspace=\"50\" border=\"0\"><br />');
		workingWin.document.writeln('<div onmouseover="javascript:showPlaque(1);" onmouseout="javascript:showPlaque(0);">');

		workingWin.document.writeln('<table border=\"1\" cellpadding=0 cellspacing=0 background=\"'+imgfpath+'\">\n<tbody>');
		workingWin.document.writeln('<tr><td><img src=\"images/'+"glass.gif"+'\" width=\"'+img_wide+'\" height=\"'+img_high+'\" border=\"0\" /></td></tr>\n</tbody>\n</table></div>');
		
		switch (photog)
		{
			case 1:
				workingWin.document.writeln('<br />\n<b><div class="details">'+dimensions+' &nbsp;&nbsp;&nbsp;&nbsp; '+picname+' &nbsp;&nbsp;&nbsp;&nbsp; '+price+'</font></b>\n<br />');
				break;
		}


		workingWin.document.writeln('</center>');
	
		workingWin.document.writeln('</body></html>');
		workingWin.document.close();
}

function noOp()
{
	return;
}


