function youtube (videolink, pagetitle) {
	myWin = open("","","width=550,height=500");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<object width="425" height="350"><param name="movie" value="');
		write(videolink);
		write('"></param><param name="wmode" value="transparent"></param><embed src="');
		write(videolink);
		write('" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>');
		write('</body></html>');
	    close();
	}
}
function yahoo (videolink, pagetitle) {
	myWin = open("","","width=550,height=500");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<embed src="http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf" flashvars="');
		write(videolink);
		write('" type="application/x-shockwave-flash" width="425" height="350"></embed>');
		write('</body></html>');
	    close();
	}
}
function quicktime (videolink, pagetitle) {
	myWin = open("","","width=550,height=500");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<object classid="clsid:02bf25d5-8C17-4b23-bc80-d3488abddc6b" width="425" height="350" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" value="');
		write(videolink);
		write('"><param name="autoplay" value="true"><param name="controller" value="false"><embed src="');
		write(videolink);
		write('" width="425" height="350" autoplay="true" controller="false" pluginspace="http://www.apple.com/quicktime/download/"></embed></object>');
		write('</body></html>');
	    close();
	}
}
function sound (musiclink, pagetitle) {
	myWin = open("","","width=550,height=200");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"><param name="filename" value="');
		write(musiclink);
		write('"><embed src="');
		write(musiclink);
		write('" height="60" width="145" autostart="true" volume="50%" mastersound></embed></object>');
		write('</body></html>');
	    close();
	}
}
function wmv (videolink, pagetitle) {
	myWin = open("","","width=550,height=500");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<object id="mediaplayer" width=425 height=350 classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74C7e95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"><param name="filename" value="');
		write(videolink);
		write('"><param name="showcontrols" value="true"><param name="autostart" value="true"><embed type="application/x-mplayer2" src="');
		write(videolink);
		write('" name="mediaplayer" width=425 height=350></embed></object>');
		write('</body></html>');
	    close();
	}
}
function chinese (imgsrc, pagetitle) {
	myWin = open("","","width=650,height=500,scrollbars=yes");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<div><img src="');
		write(imgsrc);
		write('" alt="');
		write(pagetitle);
		write('"></div>');
	    write('</body></html>');
	    close();
	}
}
function grouppic (imgsrc, pagetitle) {
	myWin = open("","","width=780,height=500,scrollbars=yes");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<div><img src="');
		write(imgsrc);
		write('" alt="');
		write(pagetitle);
		write('"><span style="font-size:1em;"><p class="noindent">Back Row: Steven Tam, Larry Tam, Philippe Saikali, Giancarlo Scalia<br/>	Middle Row: Clayton Ma, Chantal Nadeau, Angela Chan, Jacqueline To, Emily To, Cynthia Wong, Wei Tu<br/>Front Row: Chun Ming Liang, Sihan Guo, Arielle Hakim, Kathleen Wong, Jeremy Zhu, Emilia M</p></span></div>');
	    write('</body></html>');
	    close();
	}
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
function writing (filename, pagetitle) {

	myWin = open("","","width=550,height=450,scrollbar=yes");
    with(myWin.document){
		open();
		write('<html><head><title>Angela Chan: ');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<iframe src ="../docs/');
		write(filename);
		write('.html" id="iframe" frameborder="0"></iframe>');
		write('</body></html>');
	    close();
	}
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
function currentPage (subnav) {
var targetsubLink = document.getElementById(subnav);
addClass (targetsubLink, 'subcurrent');
}
function addClass(target, classValue) {
  var pattern = new RegExp("(^| )" + classValue + "( |$)");
  if (!pattern.test(target.className)) {
    if (target.className == "") { target.className = classValue; }
	else { target.className += " " + classValue; }
  }
  return true;
}
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
function openPic (pagetitle, imgsrc) {
	myWin = open("","","width=550,height=500");
    with(myWin.document){
		open();
		write('<html><head><title>');
		write(pagetitle);
		write('</title><link rel="stylesheet" type="text/css" href="../css/index.css"></head><body id="video">');
		write('<div id="closewindow"><a href="javascript:void();" onClick="window.close();" class="alignright">Close this window</a></div>');
   	    write('<div id="doctitle">');
		write(pagetitle);
		write('</div>');
		write('<div>');
		write(imgsrc);
		write('</div>');
	    write('</body></html>');
	    close();
	}
}