// JavaScript Document

ifexists=false;



function chk(str) {
if (str=="yes") ifexists=true; else ifexists=false;


}
function ialert() {
alert(ifexists);
}
function fadein(fname,width,height) {
var newImg = new Image();
newImg.src = fname;
//var height = newImg.height;

ttop=(370-height)/2;
//ttop=0;
ttop=24;
lleft=20;
if (width < 270) lleft=275-width;

//alert ('The image size is '+width+'*'+height);
//alert ('The padding is '+ttop+'*'+lleft);

hname=fname.substring(10);
hname="./pics/huge" + hname;
hnum=fname.substring(10,13);
hnum=hnum*1;

var pdesc=[];

pdesc[1]="HRH The Duke of Edinburgh. My first Royal commission on returning from St Petersburg, painted at Buckingham Palace. This painting was commissioned by St George's House at Windsor Castle to mark the 82nd Birthday of HRH The Duke of Edinburgh. HRH is painted wearing the Garter Robes.";
pdesc[2]="HM The Queen. Painted after a portrait commissioned for the Royal collection of HRH The Duke of Edinburgh driving his carriage and four in hand, HM agreed to sit for me in the Royal Mews. This painting was commissioned by The Worshipful Company of Ironmongers to celebrate Her Golden Jubilee.";
pdesc[3]="HRH The Duke of Edinburgh. Commissioned by the Worshipful Company of Shipwrights in the City of London, HRH The Duke of Edinburgh is painted in the livery of the Worshipful Company.";
pdesc[4]="The Lord Bishop of London Richard Chartres. This painting directly led to my being chosen to paint HRH The Duke of Edinburgh. Bishop Richard is in incredibly intelligent and spiritual man, who has had a profound influence on my career. I am sustained by my faith and he is one of the most inspiring subjects I have painted.";
pdesc[5]="Mrs 'CZ' Guest. Also painted by Diego and before that by Salvador Dali. This was the last painting of CZ before she died. She wanted this to be called 'The Icon' and she was an icon, she had grace, glamour and guts. Earnest Hemingway was the best man at her wedding to Mr Winston Guest, who is illustrated behind her. She is wearing a dress made for the painting by Oscar De La Renta. What a lady!";
pdesc[6]="Sir Ronald Grierson. This is one of my favourite paintings because the subject is well known by his friends for doing three things at once! It was commissioned in recognition of his contribution to St George's House at Windsor Castle.";
pdesc[7]="The late Mr Bobby Short, the famous New York Jazz pianist. This painting will be unveiled in May at the Cafe Carlyle in Manhattan, New York, in May 2009.";
pdesc[8]="Altynia Asylmoratova. The former Prima Ballerina of the Kirov Ballet and artistic director of the Vaganova Academy of Ballet in St Petersburg. I was chosen by the Director of the Repin Academy to have the honour of painting her portrait.";
pdesc[9]="Portrait of Madam B. A very beautiful and kind Russian lady.";
pdesc[10]="Portrait of a gentleman on the polo field. I painted this picture partly using photographs of the rider swerving away from me and partly from imagination";
pdesc[11]="Mr Charles T de M Frazer. High Sheriff of Sussex, wearing the Uniform of the Lifeguards.";
pdesc[12]="Mr Alexander Hopkinson-Woolley. The subject is the father of one of my best friends.";
pdesc[13]="Master Oliver Fleischmann. ";
pdesc[14]="Mrs Jane Crocker Tee. A family friend from California.";
pdesc[15]="Mr Ian Hanbury. Wearing a mustard coloured smoking jacket.";
pdesc[16]="Mr Peter Lusk and his 'boys'.";
pdesc[17]="His Grace The Duke of Westminster. Painted wearing Garter Robes.";
pdesc[18]="Mrs Anne Down. A family friend from California.";
pdesc[19]="His Excellency President Salva Kiir of Southern Sudan. Painted on the banks of the River Nile, the President wears a hat he was given by The President of The United States. This painting was unveiled by The British Ambassador from Khartoum in Juba, the capital of Southern Sudan.";
pdesc[20]="Miss Emily Wheelwright.";
pdesc[21]="Major Gen Peter Leuchards. A close family friend, this portrait was painted before I went to Russia having just  returned from Florence.";
pdesc[22]="Miss Virginia Blake. Is the niece of Mr David Blake who is responsible for my exhibition at the National Portrait Gallery in Washington. A truer friend one could not find.";
pdesc[23]="Miss Alexandra Codina. My cousin from California.";
pdesc[24]="Miss Sarah Daschbach. My cousin from California.";
pdesc[25]="Miss Jessica Marguet. My cousin in California.";
pdesc[26]="The Hurley girls. Otherwise known as 'portrait of a red shoe'.";
pdesc[27]="Portrait of a young lady.";
pdesc[28]="Drawing of model from St Petersburg.";
pdesc[29]="Master Andrew Daschbach.";
pdesc[30]="Miss Dianna Kenealy.";






desc="";
if (pdesc[hnum]!=undefined) desc=pdesc[hnum];


//var ajax=new Ajax();
//rstart= new Date();
//start=rstart.getTime();  // need random get value to get around IE caching
//ajax.doGet(sname + '//checkfile.php?file=' + hname + '&start=' + start,chk);
//delete ajax;



href="javascript:showpop('image-pop');";
//alert(ifexists);
if (harray[hnum]=="y") {
	document.getElementById('huge').src=hname;
	str="<div style='position:relative'><a href=\"" + href + "\"><img style='border:none; padding: " + ttop + "px 0px 0px " + lleft + "px;' src='" + fname + "' alt='click to see even larger photo' /></a></div>";
	}

if (harray[hnum]!="y") {
	document.getElementById('bigimg').style.width=width + "px";
	str="<img style='float:right; width: " + width + "px; border:none; margin-top: " + ttop  + "px;' src='" + fname + "' alt='enlarged picture' />";
	
	str2=desc;
}

o=document.getElementById('bigpic');

opacity=100;
setOpacity (o, opacity);

ddown=1;
fadeLoop1 ();

}


	
function fadeLoop1 () {
		if (ddown==1) {
		if (opacity >= 4) {
		//alert(opacity);
			setOpacity(o, opacity);
			opacity -= 6;
			window.setTimeout("fadeLoop1()", 15);
		} else {
		ddown=0;
		document.getElementById('bigimg').innerHTML=str;
		document.getElementById('bignote').innerHTML=str2;
		
		}
		}
		
		if (ddown==0) {
		if (opacity <= 95) {
			setOpacity(o, opacity);
			opacity += 2;
			window.setTimeout("fadeLoop1()", 40);
		} 
		}
	}


function setOpacity (o, opacity) {
		o.style.filter = "alpha(style=0,opacity:" + opacity + ")";	// IE
		o.style.KHTMLOpacity = opacity / 100;				// Konqueror
		o.style.MozOpacity = opacity / 100;					// Mozilla (old)
		o.style.opacity = opacity / 100;					// Mozilla (new)
	}
	
function opaq(id,oo) {

t=document.getElementById(id);
setOpacity (t,oo);
}