var link1 	= "images/MediaRelease1.jpg";
var link2 	= "images/MediaRelease2.jpg";
var link3 	= "images/article1.jpg";
var link4 	= "images/article2.jpg";
var link5 	= "common/images/googlemap.gif";

var goImg	= "<br/>(hover left / right of this image to navigate to the previous / next image)";
var title1 	= "The Wine Review 2001 ";
var title2 	= "Zao Bao Review 2009 ";
var title3 	= "Location of The Wine Gallery at Magnum";
var title4 	= "Location of The Wine Gallery at Club Street";
var title5 	= "Location of The Wine Gallery at Boat Quay";
var title6 	= "Location of The Wine Gallery at Tanglin";

var Gmapstarted = false;
var showmap = false;

function show(image) {
		
	var a = document.getElementById("media"+image+"");
	var f = new Array()
	f[1] = link1; f[2] = link2; f[3] = link3; f[4] = link4;
	
	f[5] = link5; //cc
	f[6] = link5; //cs
	f[7] = link5; //bq
	f[8] = link5; //tl
	var url = f[image];
	//alertSize();
	a.setAttribute('href', url);
	
	//alert(BrowserDetect()) FF doesnt work, need fade("map_canvas")	
	if(image<5){
		showmap=false;
	}
	else 
	{ 
		if(Gmapstarted == false){
			initializeGmap(); 
			Gmapstarted = true;
			showmap		= true;	
		}
	
		document.getElementById("map_container").style.zIndex = "101";
		document.getElementById("map_canvas").style.display = "block";
		
		if(clientbrowser()!="ie") fade('map_canvas'); 
	}
	
	myLightbox.start(a);
	
	switch(image)
	{
		case 5: showmap=true; map.panTo(cc); map.setZoom(17); break;
		case 6: showmap=true; map.panTo(cs); map.setZoom(18); break;
		case 7: showmap=true; map.panTo(bq); map.setZoom(17); break; 
		case 8: showmap=true; map.panTo(tl); map.setZoom(17); break;
	}
	//alert(showmap)
}

initLightbox();

document.write ("<a name='top'></a>");
document.write ("<a id='media1' href='"+link1+"' rel='lightbox[publication1]' title='"+title1+"'></a>");
document.write ("<a id='media2' href='"+link2+"' rel='lightbox[publication1]' title='"+title1+"'></a>");
document.write ("<a id='media3' href='"+link3+"' rel='lightbox[publication2]' title='"+title2+"'></a>");
document.write ("<a id='media4' href='"+link4+"' rel='lightbox[publication2]' title='"+title2+"'></a>");
document.write ("<a id='media5' href='"+link5+"' rel='lightbox[mapCC]' title='"+title3+"'></a>"); 
document.write ("<a id='media6' href='"+link5+"' rel='lightbox[mapCS]' title='"+title4+"'></a>"); 
document.write ("<a id='media7' href='"+link5+"' rel='lightbox[mapBQ]' title='"+title5+"'></a>"); 
document.write ("<a id='media8' href='"+link5+"' rel='lightbox[mapTL]' title='"+title6+"'></a>"); 

//setTimeout("show(5)", 2000);