// copyright W. Rees 21/02/2011
// unused
// used for both right and left justification
function ImageParserWithCaption(thisImage, AltText, Caption, leftright)
{
	
	if ((screen.width<= 1024))
	{
		if (screen.width <= 800)
		{
			thisWidth = "180";
			textWidth = "150";
		}
		else
		{
			thisWidth = "300";
			textWidth = "250";
		}
	}
	else
	{
		textWidth = "350";
		thisWidth = "400";
	}

	if ( (leftright == "left") || (leftright == "right") )
	{
	}
	else
	{
		leftright= "center";
	}

	//leftright="center";

	thisfinaltext = "<div style=\"width:" + textWidth + "px; font-size:60%; text-align:" +
					"center" +
					";\"><img src=\"" + 
					thisImage + 
					"\" align=\"" +
					"center" +
					"\" valign=\"top\" width=" +
					thisWidth +
					" hspace=\"10\" alt=\"" + 
					AltText + 
					" style=\"padding-bottom:0.5em;\" /><i>" +
					Caption +
					"</i></div>";

	//document.writeln(thisfinaltext);
	document.write (thisfinaltext);
}
function ImageParserWithCaptionPortrait(thisImage, AltText, Caption,leftright)
{

	if ((screen.width<= 1024))
	{
		if (screen.width <= 800)
		{
			thisHeight = "180";
			textWidth = "100";
		}
		else
		{
			thisHeight = "300";
			textWidth = "200";
		}
	}
	else
	{
		textWidth = "300";
		thisHeight = "400";
	}




//	if ((screen.width<=800))
//	{
//		thisHeight = "300";
//		textWidth = "250"
//	}
//	else
//	{
//		thisHeight = "400";
//		textWidth = "350";
//	}



	//thisHeight = "300";

	if ( (leftright == "left") || (leftright == "right") )
	{
	}
	else
	{
		leftright= "center"
	}

	thisfinaltext = "<div style=\"width:" + textWidth + "px; font-size:60%; text-align:" +
					"center" +
					";\"><img src=\"" + 
					thisImage + 
					"\" align=\"" +
					"center" +
					"\" valign=\"top\" height=" +
					thisHeight +
					" hspace=\"10\" alt=\"" + 
					AltText + 
					" style=\"padding-bottom:0.5em;\" /><i>" +
					Caption +
					"</i></div>";

//	thisfinaltext = "<div style=\"width:100%; font-size:70%; text-align:center;\"><img src=\"" + 
//					thisImage + 
//					"\" align=\"" +
//					leftright +
//					"\" valign=\"center\" height=" +
//					thisHeight +
//					" hspace=\"10\" alt=\"" + 
//					AltText + 
//					"\"  /><br><br><i>" +
//					Caption +
//					"</i></div>";
	document.write (thisfinaltext);
}
//used to select apprpriate ad size in index column
function ZopaShortAdvert()
{
	if ((screen.height<800)) 
	{
		document.write('<a href="http://uk.zopa.com/member/TigerRag"><img src="https://uk.zopa.com/ApplicationResources/images/promos/120.60.lend.gif" border="0" /></a>');
	}
	else
	{
		document.write('<a href="http://uk.zopa.com/member/TigerRag"><img src="https://uk.zopa.com/ApplicationResources/images/promos/120.bankofdave.gif" border="0" /></a>');
	}
}
//used to dynamically scale header banner
function BannerScaleDisplay(thisImage, AltText)
{

	var winW = 630, winH = 460;
	if (document.body && document.body.offsetWidth) 
	{
	 	winW = document.body.offsetWidth;
	 	winH = document.body.offsetHeight;
	}
	if (document.compatMode=='CSS1Compat' &&
    	document.documentElement &&
    	document.documentElement.offsetWidth ) 
	{
	 	winW = document.documentElement.offsetWidth;
	 	winH = document.documentElement.offsetHeight;
	}
	if (window.innerWidth && window.innerHeight) 
	{
 		winW = window.innerWidth;
 		winH = window.innerHeight;
	}

	//document.writeln('Window width = '+winW);
	//document.writeln('Window height = '+winH);

	thisWidth = winW *0.7;
	thisfinaltext = "<img  src=\"" + thisImage +  "\" class=\"hdr\" align=\"center\" valign=\"center\" width=" + thisWidth + ">";
	document.write (thisfinaltext);
}

function LeftBanner(thisImage, AltText)
{
	thisWidth = "120";

	thisfinaltext = "<img src=\"" + thisImage + "\" align=\"center\" valign=\"center\" width=" +
					thisWidth +	" hspace=\"10\" alt=\"" + AltText + ">"
					
	document.write (thisfinaltext);
}



					



