function popPoster(imageURL,imageTitle){
	// Set the horizontal and vertical position for the popup
	PositionX = 50;
	PositionY = 50;
	
	// Set these value approximately 20 pixels greater than the
	// size of the largest image to be used (needed for Netscape)
	defaultWidth  = 500;
	defaultHeight = 500;
	
	// Set autoclose true to have the window close automatically
	// Set autoclose false to allow multiple popup windows
	var AutoClose = true;
	
	// Do not edit below this line...
	// ================================
	if (parseInt(navigator.appVersion.charAt(0))>=4){
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
		var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
		var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
		if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		
		writeln('<sc'+'ript>');
		
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		  writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		  writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		
		writeln('function reSizeToImage(){');
		
		  writeln('if (isIE){');
		    writeln('window.resizeTo(300,300);');
		    
		    writeln('if (document.images[0].width<screen.width) {');
	          writeln('width=300-(document.body.clientWidth-document.images[0].width);');
	        writeln('} else {');
	          writeln('width=screen.width-100;');
	        writeln('}');
	        
	        writeln('if (document.images[0].height<screen.height-300) {');
		      writeln('height=283-(document.body.clientHeight-document.images[0].height);');
		    writeln('} else {');
	          writeln('height=screen.height-200;');
	        writeln('}');
		      
		    writeln('window.resizeTo(width,height);');
		  writeln('}');
		
		  writeln('if (isNN){');       
  		    writeln('window.innerWidth=document.images["YMCAHO"].width;');
		    writeln('window.innerHeight=document.images["YMCAHO"].height;');
		  writeln('}');
		  
		writeln('}');
	    
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor=000000 scroll=yes onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=000000 scroll=yes onload="reSizeToImage();doTitle();self.focus()" >');
		writeln('<img name="YMCAHO" src="'+imageURL+'" style="display:block"></body></html>');
		close();		
	}
}


function popImage(imageURL,imageTitle){
	// Set the horizontal and vertical position for the popup
	PositionX = 50;
	PositionY = 50;
	
	// Set these value approximately 20 pixels greater than the
	// size of the largest image to be used (needed for Netscape)
	defaultWidth  = 500;
	defaultHeight = 500;
	
	// Set autoclose true to have the window close automatically
	// Set autoclose false to allow multiple popup windows
	var AutoClose = true;
	
	// Do not edit below this line...
	// ================================
	if (parseInt(navigator.appVersion.charAt(0))>=4){
		var isNN=(navigator.appName=="Netscape")?1:0;
		var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
		var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
		var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
		if (isNN){imgWin=window.open('about:blank','',optNN);}
		if (isIE){imgWin=window.open('about:blank','',optIE);}
		with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
		writeln('width=300-(document.body.clientWidth-document.images[0].width);');
		writeln('height=300-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["YMCAHO"].width;');writeln('window.innerHeight=document.images["YMCAHO"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" >');
		writeln('<img name="YMCAHO" src='+imageURL+' style="display:block"></body></html>');
		close();		
	}
}


function resizePic(picDetail) {
  var path = 'picture/'+picDetail[0]
  var img = new Image();
  img.src = path;

  if (picDetail[1] == 'h') {
    return ('<a href="javascript:popPoster(\'picture/'+picDetail[0]+'\',\''+picDetail[0]+'\')" ><img src='+img.src+' width=170 border=0 alt="'+picDetail[0]+'"></a>');
  } else {
    return ('<a href="javascript:popPoster(\'picture/'+picDetail[0]+'\',\''+picDetail[0]+'\')" ><img src='+img.src+' height=170 border=0 alt="'+picDetail[0]+'"></a>');
  } 
}


function writeUrl(page){
  return (page+'_'+lang+'.html');
}


function writeLeftBar(){
  
  if (lang == 'tc') {
  
  document.write('    <table width=179 border="0" cellpadding=0 cellspacing="0" align=center bgcolor=#ffffff>');
  document.write('      <tr><td height=96><img src=images/logo.jpg border=0 /></td></tr>');
  
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('index')+'"><img src=images/bt_home_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('concerts')+'"><img src=images/bt_concerts_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('history1940')+'"><img src=images/bt_history_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  
//	if (baseFile[0].substring(0,7) == 'history') {
	if (1 == 1) {
	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#708AAF>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1940')+'"><img src=images/bt_history1940_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1950')+'"><img src=images/bt_history1950_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1960')+'"><img src=images/bt_history1960_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1970')+'"><img src=images/bt_history1970_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1980')+'"><img src=images/bt_history1980_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1990')+'"><img src=images/bt_history1990_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history2000')+'"><img src=images/bt_history2000_tc.jpg border=0  /></a></td></tr>');
	  document.write('      <tr><td height=1></td></tr>');
	  document.write('      </table></td></tr>');
      document.write('      <tr><td height=1></td></tr>');
	}

  document.write('      <tr><td><a href="'+writeUrl('event')+'"><img src=images/bt_highlights_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  
//	if (baseFile[0].substring(0,10) == 'highlights') {
	if (1 == 1) {
	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#D37201>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('event')+'"><img src=images/bt_event_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('figure')+'"><img src=images/bt_figure_tc.jpg border=0  /></a></td></tr>');
	  document.write('      <tr><td height=1></td></tr>');
	  document.write('      </table></td></tr>');
  	  document.write('      <tr><td height=1></td></tr>');
	}

  document.write('      <tr><td><a href="'+writeUrl('structure')+'"><img src=images/bt_structure_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('education')+'"><img src=images/bt_education_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  
//	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#989F37>');
//	  document.write('        <tr><td height=1></td></tr>');
//	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('technique')+'"><img src=images/bt_technique_tc.jpg border=0  /></a></td></tr>');
//	  document.write('      <tr><td height=1></td></tr>');
//	  document.write('      </table></td></tr>');
//  	  document.write('      <tr><td height=1></td></tr>');
  
  document.write('      <tr><td><a href="'+writeUrl('picture')+'"><img src=images/bt_gallery_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
	if (1 == 1) {
	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#AE3082>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('picture')+'"><img src=images/bt_picture_tc.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('video')+'"><img src=images/bt_video_tc.jpg border=0  /></a></td></tr>');
	  document.write('      <tr><td height=1></td></tr>');
	  document.write('      </table></td></tr>');
  	  document.write('      <tr><td height=1></td></tr>');
	}
	
  document.write('      <tr><td><a href="'+writeUrl('links')+'"><img src=images/bt_links_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('contactus')+'"><img src=images/bt_contactus_tc.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('    </table>');
  
  } else {
	
  document.write('    <table width=179 border="0" cellpadding=0 cellspacing="0" align=center bgcolor=#ffffff>');
  document.write('      <tr><td height=96><img src=images/logo.jpg border=0 /></td></tr>');
  
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('index')+'"><img src=images/bt_home_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('concerts')+'"><img src=images/bt_concerts_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('history1940')+'"><img src=images/bt_history_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  
//	if (baseFile[0].substring(0,7) == 'history') {
	if (1 == 1) {
	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#708AAF>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1940')+'"><img src=images/bt_history1940_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1950')+'"><img src=images/bt_history1950_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1960')+'"><img src=images/bt_history1960_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1970')+'"><img src=images/bt_history1970_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1980')+'"><img src=images/bt_history1980_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history1990')+'"><img src=images/bt_history1990_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('history2000')+'"><img src=images/bt_history2000_en.jpg border=0  /></a></td></tr>');
	  document.write('      <tr><td height=1></td></tr>');
	  document.write('      </table></td></tr>');
      document.write('      <tr><td height=1></td></tr>');
	}

  document.write('      <tr><td><a href="'+writeUrl('event')+'"><img src=images/bt_highlights_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  
//  if (baseFile[0].substring(0,10) == 'highlights') {
	if (1 == 1) {	
	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#D37201>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('event')+'"><img src=images/bt_event_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('figure')+'"><img src=images/bt_figure_en.jpg border=0  /></a></td></tr>');
	  document.write('      <tr><td height=1></td></tr>');
	  document.write('      </table></td></tr>');
  	  document.write('      <tr><td height=1></td></tr>');
	}

  document.write('      <tr><td><a href="'+writeUrl('structure')+'"><img src=images/bt_structure_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('education')+'"><img src=images/bt_education_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  
//	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#989F37>');
//	  document.write('        <tr><td height=1></td></tr>');
//	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('technique')+'"><img src=images/bt_technique_en.jpg border=0  /></a></td></tr>');
//	  document.write('      <tr><td height=1></td></tr>');
//	  document.write('      </table></td></tr>');
// 	  document.write('      <tr><td height=1></td></tr>');
  
  document.write('      <tr><td><a href="'+writeUrl('picture')+'"><img src=images/bt_gallery_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
	if (1 == 1) {
	  document.write('      <tr><td><table width=179 border="0" cellpadding=0 cellspacing="0" bgcolor=#AE3082>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('picture')+'"><img src=images/bt_picture_en.jpg border=0  /></a></td></tr>');
	  document.write('        <tr><td height=1></td></tr>');
	  document.write('        <tr><td><img src=images/arrow.gif border=0 /></td><td><a href="'+writeUrl('video')+'"><img src=images/bt_video_en.jpg border=0  /></a></td></tr>');
	  document.write('      <tr><td height=1></td></tr>');
	  document.write('      </table></td></tr>');
  	  document.write('      <tr><td height=1></td></tr>');
	}
	
  document.write('      <tr><td><a href="'+writeUrl('links')+'"><img src=images/bt_links_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('      <tr><td><a href="'+writeUrl('contactus')+'"><img src=images/bt_contactus_en.jpg border=0 /></a></td></tr>');
  document.write('      <tr><td height=1></td></tr>');
  document.write('    </table>');
  }
}


function randomVideo() {
    var currentdate = 0;
    var video_number = 0;
 	var rand = 60/video.length
 	currentdate = new Date()
 	video_number = currentdate.getSeconds()
 	video_number = Math.floor(video_number/rand)
 	showVideo(video_number)
}


function showVideo(x) {
 	document.write('<table width=298 border=0 cellpadding=0 cellspacing="0" align=center>');
 	document.write('  <tr><td>');
 	document.write(video[x]);
 	document.write('  </td></tr>');
 	document.write('  <tr><td height=30 align=center valign=middle bgcolor=#888888>');
 	document.write('  <table width=296 height=28 border=0 cellpadding=0 cellspacing="0" bgcolor=#ffffff align=center><tr><td height=28 align=center valign=middle><span class=main>');
 	
    if (lang == 'tc') {
 	  document.write(video_tc_caption[x]);
    } else {
 	  document.write(video_en_caption[x]);
 	}
 	document.write('  </span></td></tr></table></td></tr>');
 	document.write('</table>'); 	
}
 
 
function explode( /* delimiter, string */ ) {
 
  var emptyArray = { 0: '' };
  
  if ( arguments.length != 2 
      || typeof arguments[0] == 'undefined'
      || typeof arguments[1] == 'undefined' ) 
  {
    return null;  
  }
          
  var delimiter = arguments[0];
  var string = arguments[1];   
  
  if ( delimiter === '' 
      || delimiter === false 
      || delimiter === null )
  {
    return false;  
  }
  
  if ( typeof delimiter == 'function' 
      || typeof delimiter == 'object' 
      || typeof string == 'function' 
      || typeof string == 'object' )
  {
    return emptyArray;
  }        
    
  if ( delimiter === true ) {
    delimiter = '1';  
  }
  
  return string.toString().split ( delimiter.toString() );  
 
} 


function basename(path, suffix) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Ash Searle (http://hexmen.com/blog/)
    // +   improved by: Lincoln Ramsay
    // +   improved by: djmix
    // *     example 1: basename('/www/site/home.htm', '.htm');
    // *     returns 1: 'home'
 
    var b = path.replace(/^.*[\/\\]/g, '');
    if (typeof(suffix) == 'string' && b.substr(b.length-suffix.length) == suffix) {
        b = b.substr(0, b.length-suffix.length);
    }
    return b;
}


function chgLang(newLang){
	return (baseFile[0]+'_'+newLang+'.html');
}


function writeFooter(){
  
  if (lang == 'tc') {
	  document.write('      <table width=1000 border=0 cellpadding=0 cellspacing="0" align=center>');
	  document.write('        <tr height=1><td></td></tr>');
	  document.write('        <tr height=80 bgcolor=#cccccc><td align=center><img src="images/footer_tc.jpg" /></td></tr>');
	  document.write('       <tr height=1><td></td></tr>');
	  document.write('      </table>');
  } else {
	  document.write('      <table width=1000 border=0 cellpadding=0 cellspacing="0" align=center>');
	  document.write('        <tr height=1><td></td></tr>');
	  document.write('        <tr height=80 bgcolor=#cccccc><td align=center><img src="images/footer_en.jpg" /></td></tr>');
	  document.write('       <tr height=1><td></td></tr>');
	  document.write('      </table>');
  }
}


function writeHeader(){
  document.write('      <!-- language control -->');
  document.write('      <table width=1000 height=25 border="0" cellpadding=0 cellspacing="0" align=center>');
  document.write('        <tr align=right><td>');
  document.write('          <table border="0" cellpadding=0 cellspacing="0" align=right><tr>');
//  document.write('            <td><a href="'+chgLang('en')+'" ><img src="images/eng.jpg" border=0 /></a></td>');
//  document.write('            <td><font color=#6D6D6D><b> | </b></font></td>');
//  document.write('            <td><a href="'+chgLang('tc')+'" ><img src="images/chi.jpg" border=0 /></a></td>');
  document.write('            <td width=20></td>');
  document.write('          </tr></table>');
  document.write('        </td></tr>');
  document.write('      </table>');
  document.write('      <!-- global banner -->');
  document.write('      <table width=1000 height=160 border="0" cellpadding=0 cellspacing="0" align=center>');
  document.write('        <tr><td><img src="images/gbanner.jpg" border=0 /></td></tr>');
  document.write('        <tr><td height=1></td></tr>');
  document.write('      </table>');
}


function pageBar(x) {
    
    if (!x) x = (video_tc_caption.length + 3)/4;
    
  document.write('<table width=600 border=0 cellpadding=0 cellspacing="0" align=center><tr><td>');
  document.write('<table border=0 cellpadding=0 cellspacing="0" align=center>');
  document.write('  <tr>');
  
  if (lang == 'tc') {
    document.write('    <td>頁&nbsp;&nbsp;&nbsp;</td>');
    var i=1
    for (i=1;i<=x;i++) {
      document.write('    <td width=20> <a href="'+baseFile[0]+'_tc.html?page='+i+'" class=pageBar>'+i+'</a> </td>');
    }
    
  } else {
    document.write('    <td>Page&nbsp;&nbsp;&nbsp;</td>');
    var i=1
    for (i=1;i<=x;i++) {
      document.write('    <td width=20> <a href="'+baseFile[0]+'_en.html?page='+i+'" class=pageBar>'+i+'</a> </td>');
    }
  }
  
  document.write('  </tr>');
  document.write('</table>');
  document.write('</td></tr></table>');
}


function pageBar2(x) {
    
  if (!x) x = photo_tc_pagetitle.length;
  
  document.write('<table width=600 border=0 cellpadding=0 cellspacing="0" align=center><tr><td>');
  document.write('<table border=0 cellpadding=0 cellspacing="0" align=center>');
  
  if (lang == 'tc') {
    document.write('    <tr><td align=center width=50>頁</td><td width=300>&nbsp;&nbsp;&nbsp;主題</td></tr>');
    document.write('    <tr><td align=center><hr width=80%></td><td><hr width=100%></td></tr>');
    var i=1
    for (i=1;i<=x;i++) {
      document.write('    <tr><td width=50 align=center> <a href="'+baseFile[0]+'_tc.html?page='+i+'" class=pageBar>'+i+'</a> </td><td>&nbsp;&nbsp;&nbsp; <a href="'+baseFile[0]+'_tc.html?page='+i+'" class=pageBar>'+photo_tc_pagetitle[i-1]+'</a> </td></tr>');
    }
    
  } else {
    document.write('    <tr><td width=50>Page</td><td width=300>&nbsp;&nbsp;&nbsp;Theme</td></tr>');
    document.write('    <tr><td align=center><hr width=80%></td><td><hr width=100%></td></tr>');
    var i=1
    for (i=1;i<=x;i++) {
      document.write('    <tr><td width=50 align=center> <a href="'+baseFile[0]+'_en.html?page='+i+'" class=pageBar>'+i+'</a> </td><td>&nbsp;&nbsp;&nbsp; <a href="'+baseFile[0]+'_en.html?page='+i+'" class=pageBar>'+photo_en_pagetitle[i-1]+'</a> </td></tr>');
    }
  }
  
  document.write('</table>');
  document.write('</td></tr></table>');
}


function gup(name){
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
      return "";
  else
      return results[1];
}


function listPic(page) {
  var base_no = (page-1)*9;
  if (base_no == -9) base_no = 0;
  
  document.write('<table width=600 border="0" cellpadding=0 cellspacing="0" align=center>');
  
  var i=0
  var j=0
  
  for (i=0;i<3;i++) {
    for (j=0;j<3;j++) {
  	  if (j%3 == 0) {
  	    if (photo[base_no+i*3+j]) {
	      document.write(' <tr><td width=180 height=180 bgcolor=#BC97B8 align=center valign=middle>'+resizePic(photo[base_no+i*3+j])+'</td><td width=30></td>');
	    } else {
	      document.write(' <tr><td width=180 height=180></td><td width=30></td>');
	    }
	  }
	  if (j%3 == 1) {
  	    if (photo[base_no+i*3+j]) {
	      document.write(' <td width=180 height=180 bgcolor=#BC97B8 align=center valign=middle>'+resizePic(photo[base_no+i*3+j])+'</td><td width=30></td>');
	    } else {
	      document.write(' <td width=180 height=180></td><td width=30></td>');
	    }
	  }
	  if (j%3 == 2) {
  	    if (photo[base_no+i*3+j]) {
	      document.write(' <td width=180 height=180 bgcolor=#BC97B8 align=center valign=middle>'+resizePic(photo[base_no+i*3+j])+'</td></tr>');
	    } else {
	      document.write(' <td width=180 height=180></td></tr>');
	    }
	  }
    }
    if (i != 2)
      document.write('  <tr><td height=30></td></tr>');
  }
  
  document.write('</table>');
}


function listPicTitle(page) {
  if (!page) page = 1;
  if (lang == 'tc') {
    document.write(photo_tc_pagetitle[page-1]);
  } else {
    document.write(photo_en_pagetitle[page-1]);
  }
}


function listVideo(page) {
  var base_no = (page-1)*4;
  if (base_no == -4) base_no = 0;
  
  document.write('<table width=620 border="0" cellpadding=0 cellspacing="0" align=center>');
  
  var i=0
  var j=0
  
  for (i=0;i<2;i++) {
    for (j=0;j<2;j++) {
  	  if (j%2 == 0) {
  	    if (video[base_no+i*2+j]) {
	      document.write(' <tr><td width=298 height=279>');
	      showVideo(base_no+i*2+j)
	      document.write(' </td><td width=24></td>');
	    } else {
	      document.write(' <tr><td width=298 height=279></td><td width=24></td>');
	    }
	  }
	  if (j%2 == 1) {
  	    if (video[base_no+i*2+j]) {
	      document.write(' <td width=298 height=279>');
	      showVideo(base_no+i*2+j)
	    } else {
	      document.write(' <td width=298 height=279></td>');
	    }
	  }
    }
    if (i != 2)
      document.write('  <tr><td height=30></td></tr>');
  }
  
  document.write('</table>');
}


var baseFile = basename(window.location.href,'.html').split('_');
var temp = baseFile[1].split('.');
var lang = temp[0];

var photo_tc_pagetitle = new Array (
  '40 / 50 年代',
  '60 / 70 年代',
  '80 / 90 年代',
  '2005年10月29日周年音樂會',
  '香港文化中心演出',
  '新加坡交流音樂會',
  '2006年11月25日六十五周年音樂會',
  '成都《港韻繞蓉城》音樂會(演出)',
  '成都《港韻繞蓉城》音樂會(花絮)',
  '2007年10月13日周年音樂會',
  '香港口琴演奏家往杭州交流訪問團',
  '2008年3月29日大會堂高座音樂會(上半場)',
  '2008年3月29日大會堂高座音樂會(下半場)'
);

var photo_en_pagetitle = new Array (
  '40/50',
  '60/70',
  '80/90',
  '2000',
  '65th Anniversary concert',
  'Singapore concert',
  'Cultural Centre performance',
  'Chengdu',
  '1013 2007 concert',
  '329 2008concert'
);

var photo = new Array(
  ['4050_banner1.jpg','h'],
  ['4050_hung_solo.jpg','h'],
  ['4050_audience.jpg','h'],
  ['4050_playing1.jpg','h'],
  ['4050_playing2.jpg','h'],
  ['4050_playing3.jpg','h'],
  ['4050_playing4.jpg','h'],
  ['4050_poster1.jpg','h'],
  ['4050_scommittee.jpg','h'],
  
  ['6070_playing.jpg','h'],
  ['6070_trio.jpg','h'],
  ['6070_playing2.jpg','h'],
  ['6070_adler.jpg','h'],
  ['6070_fung.jpg','h'],
  ['6070_lee-sheung-ching.jpg','h'],
  ['1966-01-30.jpg','h'],
  ['1978-09-theater-02.jpg','h'],
  ['6070-lau-chuen-wan.jpg','h'],
  
  ['1981-10-30asianfest.jpg','h'],
  ['1980_asianfest.jpg','h'],
  ['8090_highblock.jpg','h'],
  ['8090_trio.jpg','h'],
  ['8090_ensemble.jpg','v'],
  ['1990-04-27-ymca-01.jpg','h'],
  ['1997-09-13-02.jpg','h'],
  ['1998-09-12-HB-01.jpg','h'],
  ['1999-06-13-shatin-cityhall-01.jpg','h'],
  
  ['2005concert_0288.jpg','h'],
  ['2005concert_0347.jpg','h'],
  ['2005concert_0363.jpg','h'],
  ['2005concert_0379.jpg','h'],
  ['2005concert_0388.jpg','h'],
  ['2005concert_0405.jpg','h'],
  ['2005concert_0411.jpg','h'],
  ['2005concert_0415.jpg','h'],
  ['2005concert_0422.jpg','h'],
    
  ['culperf_070510a.jpg','h'],
  ['culperf_070510audiance.jpg','h'],
  ['culperf_070510bc.jpg','h'],
  ['culperf_IMG_0232c.jpg','h'],
  ['culperf_Img_1407.jpg','h'],
  ['culperf_Img_1412.jpg','h'],
  ['culperf_Img_1426.jpg','h'],
  ['culperf_Img_1442.jpg','h'],
  ['5thAPHF.jpg','h'],
  
  ['Singapore_holeungsing.jpg','h'],
  ['Singapore_DSC01954.jpg','h'],
  ['Singapore_DSC02030.jpg','h'],
  ['Singapore_DSC02046.jpg','h'],
  ['Singapore_DSC02060.jpg','h'],
  ['Singapore_DSC02064.jpg','h'],
  ['Singapore_DSC02071b.jpg','h'],
  ['Singapore_DSC02078.0.jpg','h'],
  ['Singapore_DSC02132.jpg','h'],
  
  ['65thConcert_1.jpg','h'],
  ['65thConcert_2.jpg','h'],
  ['65thConcert_3.jpg','h'],
  ['65thConcert_4.jpg','h'],
  ['65thConcert_5.jpg','h'],
  ['65thConcert_6.jpg','h'],
  ['65thConcert_7.jpg','h'],
  ['65thConcert_8.jpg','h'],
  ['65thConcert_9.jpg','h'],
  
  ['Chengdu_DSC_1663resize.jpg','h'],
  ['Chengdu_DSC_1666resize.jpg','h'],
  ['Chengdu_F63C5959resized.jpg','h'],
  ['Chengdu_F63C5979resized.jpg','h'],
  ['Chengdu_F63C5991resized.jpg','h'],
  ['Chengdu_F63C5941resized.jpg','h'],
  ['Chengdu_On Stage 27resize.jpg','h'],
  ['Chengdu_DSC_1687resize.jpg','h'],
  ['Chengdu_F63C6008resized.jpg','h'],
  
  ['Chengdu_CRW_6750resized.jpg','h'],
  ['Chengdu_CRW_6705resize.jpg','h'],
  ['Chengdu_CRW_6722resize.jpg','h'],
  ['Chengdu_CRW_6788resize.jpg','h'],
  ['Chengdu_CIMG0062resized.jpg','h'],
  ['Chengdu_CIMG0027resized.jpg','h'],
  ['Chengdu_Before Stage 11resize.jpg','h'],
  ['Chengdu_P1000178resized.jpg','h'],
  ['Chengdu_Leisure 24resize.jpg','h'],
    
  ['20071013_IMG_1330resized.jpg','h'],
  ['20071013_IMG_1584resize.jpg','h'],
  ['20071013_IMG_1604resized.jpg','h'],
  ['20071013_IMG_1605resize3.jpg','h'],
  ['20071013_IMG_1611resize4.jpg','h'],
  ['20071013_IMG_1678resize.jpg','h'],
  ['20071013_IMG_1778resize.jpg','h'],
  ['20071013_IMG_1836resize.jpg','h'],
  ['20071013_LG7P1430resize.jpg','h'],
  
  ['hangzhou_048.JPG','h'],
  ['hangzhou_P1010516resized.jpg','h'],
  ['hangzhou_P1010525resized.jpg','h'],
  ['hangzhou_P1010526resized.jpg','h'],
  ['hangzhou_P1010534resized.jpg','h'],
  ['hangzhou_R0012515resized.jpg','h'],
  ['hangzhou_R0012516resized.jpg','h'],
  ['hangzhou_R0012675resized.jpg','h'],
  ['hangzhou_R0012703resized.jpg','v'],
  
  ['YMCA Recital 29Mar08 - IMG_0997resize.jpg','h'],
  ['YMCA Recital 29Mar08 - IMG_0980.jpg','v'],
  ['YMCA Recital 29Mar08 - IMG_2504resized.jpg','h'],
  ['YMCA Recital 29Mar08 - IMG_2553resized.jpg','h'],
  ['YMCA Recital 29Mar08 - 05resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 10resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 14resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 19resize.jpg','h'],
  ['YMCA Recital 29Mar08 - IMG_0901resize.jpg','h'],
  
  ['YMCA Recital 29Mar08 - 27resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 43resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 50resize.jpg','h'],
  ['YMCA Recital 29Mar08 - IMG_0833resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 58resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 64resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 73resize.jpg','h'],
  ['YMCA Recital 29Mar08 - 80resize.jpg','h'],
  ['YMCA Recital 29Mar08 - IMG_1065resize.jpg','h']
);

var video = new Array(
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/x6t8EQS7Lyg&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/x6t8EQS7Lyg&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/YD8HA6k34EE&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/YD8HA6k34EE&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/8NVg_bFZJwY&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/8NVg_bFZJwY&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/eLLYPC67CwI&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/eLLYPC67CwI&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/QboYPz4Ifnk&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/QboYPz4Ifnk&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/uz1WxCIFbPo&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/uz1WxCIFbPo&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/kkGVTCBO01U&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/kkGVTCBO01U&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/2dZaPqg-YCM&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/2dZaPqg-YCM&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/Dv_Uruq1Zj8&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/Dv_Uruq1Zj8&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/azyS5JdgIMw&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/azyS5JdgIMw&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/yrwTk_4r6k8&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/yrwTk_4r6k8&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/rmOcy4LQy2g&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/rmOcy4LQy2g&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>',
  '<object width="298" height="249"><param name="movie" value="http://www.youtube.com/v/uL-MUelPtrc&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/uL-MUelPtrc&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="298" height="249"></embed></object>'
);

var video_tc_caption = new Array(
'貝多芬《F大調第八交響曲》I',
'貝多芬《F大調第八交響曲》II',
'貝多芬《F大調第八交響曲》III',
'貝多芬《F大調第八交響曲》IV',
'《浮士德芭蕾組曲》I',
'《浮士德芭蕾組曲》II',
'莫扎特《C大調第41交響曲》I',
'《幻想芭蕾》',
'《天堂與地獄序曲》',
'《愛的敬禮》',
'《耶穌、世人所渴望的喜悅》',
'《草原上的節日》',
'《詩人與農夫序曲》'
)

var video_en_caption = new Array(
'Beethoven Symphony 8 movement I',
'Beethoven Symphony 8 movement II',
'Beethoven Symphony 8 movement III',
'Beethoven Symphony 8 movement IV',
'Ballet music from Faust I',
'Ballet music from Faust II',
'Mozart Symphony 41 movement I',
'Ballet Imaginaire',
'Orpheus in Underworld Overture',
'Salute d\'amour',
'Jesu joy of man\'s desiring',
'Festival on the Grassland',
'Poet and peasant Overture'
)