// This script and many more are available free online at 
// The JavaScript Source!! http://javascript.internet.com 

floatX=10;
floatY=100;
layerwidth=160;
layerheight=200;
halign="left";
valign="top";
delayspeed=1;

// This script is copyright (c) Henrik Petersen, NetKontoret
// Feel free to use this script on your own pages as long as you do not change it.
// It is illegal to distribute the script as part of a tutorial / script archive.
// Updated version available at: http://www.echoecho.com/toolfloatinglayer.htm
// This comment and the 4 lines above may not be removed from the code.

NS6=false;
IE4=(document.all);
if (!IE4) {NS6=(document.getElementById);}
NS4=(document.layers);

function adjust() {
	if ((NS4) || (NS6)) {
		if (lastX==-1 || delayspeed==0)
		{
			lastX=window.pageXOffset + floatX;
			lastY=window.pageYOffset + floatY;
		}
		else
		{
			var dx=Math.abs(window.pageXOffset+floatX-lastX);
			var dy=Math.abs(window.pageYOffset+floatY-lastY);
			var d=Math.sqrt(dx*dx+dy*dy);
			var c=Math.round(d/10);
			if (window.pageXOffset+floatX>lastX) {lastX=lastX+delayspeed+c;}
			if (window.pageXOffset+floatX<lastX) {lastX=lastX-delayspeed-c;}
			if (window.pageYOffset+floatY>lastY) {lastY=lastY+delayspeed+c;}
			if (window.pageYOffset+floatY<lastY) {lastY=lastY-delayspeed-c;}
		}
		if (NS4){
			document.layers['floatlayer'].pageX = lastX;
			document.layers['floatlayer'].pageY = lastY;
		}
		if (NS6){
			document.getElementById('floatlayer').style.left=lastX;
			document.getElementById('floatlayer').style.top=lastY;
		}
	}
	else if (IE4){
		if (lastX==-1 || delayspeed==0)
		{
			lastX=document.body.scrollLeft + floatX;
			lastY=document.body.scrollTop + floatY;
		}
		else
		{
			var dx=Math.abs(document.body.scrollLeft+floatX-lastX);
			var dy=Math.abs(document.body.scrollTop+floatY-lastY);
			var d=Math.sqrt(dx*dx+dy*dy);
			var c=Math.round(d/10);
			if (document.body.scrollLeft+floatX>lastX) {lastX=lastX+delayspeed+c;}
			if (document.body.scrollLeft+floatX<lastX) {lastX=lastX-delayspeed-c;}
			if (document.body.scrollTop+floatY>lastY) {lastY=lastY+delayspeed+c;}
			if (document.body.scrollTop+floatY<lastY) {lastY=lastY-delayspeed-c;}
		}
		document.all['floatlayer'].style.posLeft = lastX;
		document.all['floatlayer'].style.posTop = lastY;
	}
	setTimeout('adjust()',50);
}

function define()
{
	if ((NS4) || (NS6))
	{
		if (halign=="left") {floatX=ifloatX};
		if (halign=="right") {floatX=window.innerWidth-ifloatX-layerwidth-20};
		if (halign=="center") {floatX=Math.round((window.innerWidth-20)/2)-Math.round(layerwidth/2)};
		if (valign=="top") {floatY=ifloatY};
		if (valign=="bottom") {floatY=window.innerHeight-ifloatY-layerheight};
		if (valign=="center") {floatY=Math.round((window.innerHeight-20)/2)-Math.round(layerheight/2)};
	}
	if (IE4)
	{
		if (halign=="left") {floatX=ifloatX};
		if (halign=="right") {floatX=document.body.offsetWidth-ifloatX-layerwidth-20}
		if (halign=="center") {floatX=Math.round((document.body.offsetWidth-20)/2)-Math.round(layerwidth/2)}
		if (valign=="top") {floatY=ifloatY};
		if (valign=="bottom") {floatY=document.body.offsetHeight-ifloatY-layerheight}
		if (valign=="center") {floatY=Math.round((document.body.offsetHeight-20)/2)-Math.round(layerheight/2)}
	}
}


// display calender
function calender(){
	window.open('http://www.cs.ubc.ca/~okumak/calender.html','mywindow','width=400,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');
}
// display my schedule
function schedule(){
	window.open('http://www.cs.ubc.ca/~okumak/myschedule.html','mywindow2','width=800,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');
}
	
// display header
function header() {
	document.write('<div id="header">');
	document.write('<img src="./images/header.jpg" border="0">');
	document.write('</div>');
}
	    
// display navigation 
function displayNavi() {
	document.write('<div id="sidepanel">');
	document.write('<div class="subs-navbar">');
	document.write('<p><a href="index.html">Home</a></p>');
	document.write('<ul>');
	document.write('<li><a href="research.html">Research</a></li>');
	document.write('<li><a href="publications.html">Publications</a></li>');
	//document.write('<li><a href="pictures.html">Pictures</a></li>');
	document.write('<li><a href="contacts.html">Contact</a></li>');
	//document.write('<li><a href="cv.html">CV</a></li>');
	document.write('</div>');
	document.write('</div>');

}

// display footnote without counter
function footnote() {
	document.write('<div id="footer">');
	document.write('<p id="details"><B>E-mail:</B> okumak[at]cs.ubc.ca </p>');
	document.write('<!--spacer--><img src="./images/footspace.jpg" border="0"><!--spacer-->');
	document.write('<br><br></div>');
}

// display footnote with counter on the main page
function maincounter_footnote() {
	document.write('<div id="footer">');
	document.write('<p id="details"><B>E-mail:</B> okumak[at]cs.ubc.ca </p>'); 
	document.write('<!--spacer--><img src="./images/footspace.jpg" border="0"><!--spacer-->');
	document.write('<br><br></div>');
}

// display footnote with counter on research 
function researchcounter_footnote() {
	document.write('<div id="footer">');
	document.write('<p id="details"><B>E-mail:</B> okumak[at]cs.ubc.ca </p>'); 
	document.write('<!--spacer--><img src="./images/footspace.jpg" border="0"><!--spacer-->');
	document.write('<br><br></div>');
}

// display footnote with counter on publications
function pubscounter_footnote() {
	document.write('<div id="footer">');
	document.write('<p id="details"><B>E-mail:</B> okumak[at]cs.ubc.ca</p>');
	document.write('<!--spacer--><img src="./images/footspace.jpg" border="0"><!--spacer-->');
	document.write('<br><br></div>');
}

// display footnote with counter on pictures
function picscounter_footnote() {
	document.write('<div id="footer">');
	document.write('<p id="details"><B>E-mail:</B> okumak[at]cs.ubc.ca</p>');
	document.write('<!--spacer--><img src="./images/footspace.jpg" border="0"><!--spacer-->');
	document.write('<br><br></div>');
}

// display any picture in a smaller window
function displayPic(pic,h,w){
	var url="http://www.cs.ubc.ca/~okumak/images/" + pic;
       
	var high = h*1.2;
	var wide = w*1.2;
	
    	mywin=open("","mywindow","dependent=yes,width="+wide+",height="+high+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");

	var high2 = h;
	var wide2 = w;

	mywin.document.open();
	mywin.document.writeln('<html><head>');
	mywin.document.writeln('<title>Higher resolution picture!! :)</title>');

	mywin.document.writeln('<!-- head text -->');

	mywin.document.writeln('</head><body>');

	mywin.document.writeln('<center><img src='+url+' height='+high2+' width='+wide2+'></center>');
	mywin.document.writeln('<form><center><input type="button" value=" Close " onclick="window.close()"></center></form>');
	mywin.document.writeln('</body></html>');
	mywin.document.close();
	mywin.focus(); 

}

dayName = new Array("", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
monName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
now = new Date;


var strDay;
if ((now.getDate() == 1) || (now.getDate() != 11) && (now.getDate() % 10 == 1)) 		// Correction for 11th and 1st/21st/31st
	strDay = "st ";
else if ((now.getDate() == 2) || (now.getDate() != 12) && (now.getDate() % 10 == 2)) 	// Correction for 12th and 2nd/22nd/32nd
	strDay = "nd ";
else if ((now.getDate() == 3) || (now.getDate() != 13) && (now.getDate() % 10 == 3)) 	// Correction for 13th and 3rd/23rd/33rd
	strDay = "rd ";
else
	strDay = "th ";
	
// display date
function displayDate() {
	document.write((now.getMonth()+1)+"/"+now.getDate()+"/"+now.getFullYear()+'<br>');
}

	
// hey this is easy - just populate this array with
// the pictures you want in this slide show.
// (c) Sebastian Thrun, 2000

var myPix = new Array(

//Rock Climbing

"./images/greeting.jpg",	// 0
"./images/100-0042_IMG.JPG", 	// 1
"./images/100-0045_IMG.JPG", 	// 2

// Halloween:2001

"./images/51.jpg",		        // 3
"./images/101-0148_IMG.JPG", 	// 4
"./images/101-0149_IMG.JPG",	// 5
"./images/101-0150_IMG.JPG",	// 6
"./images/101-0151_IMG.JPG",	// 7
"./images/101-0152_IMG.JPG",	// 8
"./images/101-0153_IMG.JPG",	// 9

// Luna

"./images/luna.JPG", 			// 10
"./images/100-0007_IMG.JPG", 	// 11

// Where am I?

"./images/whereami.JPG", 		// 12

// Xmas Dinner at SJC

"./images/IMG_0187.JPG", 		// 13
"./images/IMG_0190.JPG",		// 14
"./images/IMG_0191.JPG",		// 15
"./images/IMG_0193.JPG",		// 16
"./images/IMG_0194.JPG",		// 17
"./images/IMG_0196.JPG",		// 18
"./images/IMG_0197.JPG",		// 19
"./images/IMG_0200.JPG",		// 20
"./images/IMG_0201.JPG",		// 21
"./images/IMG_0202.JPG",		// 22
"./images/IMG_0204.JPG",		// 23
"./images/IMG_0205.JPG",		// 24
"./images/IMG_0207.JPG",		// 25
"./images/IMG_0209.JPG",		// 26
"./images/IMG_0210.JPG",		// 27
"./images/IMG_0212.JPG",		// 28
"./images/IMG_0213.JPG",		// 29
"./images/IMG_0214.JPG",		// 30

// Dinner at Nick & Kate

"./images/IMG_0222.JPG",		// 31
"./images/IMG_0224.JPG",		// 32
"./images/IMG_0225.JPG",		// 33
"./images/IMG_0226.JPG",		// 34
"./images/IMG_0228.JPG",		// 35
"./images/IMG_0232.JPG",		// 36
"./images/IMG_0234.JPG",		// 37
"./images/IMG_0235.JPG",		// 38
"./images/IMG_0236.JPG",		// 39
"./images/IMG_0237.JPG",		// 40

// SJC on 12/24/01

"./images/IMG_0242.JPG",		// 41
"./images/IMG_0243.JPG",		// 42
"./images/IMG_0244.JPG",		// 43
"./images/IMG_0245.JPG",		// 44
"./images/IMG_0246.JPG",		// 45
"./images/IMG_0247.JPG",		// 46
"./images/IMG_0248.JPG",		// 47
"./images/IMG_0249.JPG",		// 48
"./images/IMG_0250.JPG",		// 49
"./images/IMG_0251.JPG",		// 50
"./images/IMG_0252.JPG",		// 51
"./images/IMG_0253.JPG",		// 52
"./images/IMG_0254.JPG",		// 53
"./images/IMG_0255.JPG",		// 54
"./images/IMG_0256.JPG",		// 55
"./images/IMG_0258.JPG",		// 56
"./images/IMG_0259.JPG",		// 57
"./images/IMG_0260.JPG",		// 58
"./images/IMG_0261.JPG",		// 59
"./images/IMG_0262.JPG",		// 60

// SJC on 12/25/01

"./images/IMG_0264.JPG",		// 61
"./images/IMG_0265.JPG",		// 62
"./images/IMG_0266.JPG",		// 63
"./images/IMG_0268.JPG",		// 64
"./images/IMG_0269.JPG",		// 65
"./images/IMG_0270.JPG",		// 66
"./images/IMG_0271.JPG",		// 67
"./images/IMG_0272.JPG",		// 68
"./images/IMG_0273.JPG",		// 69
"./images/IMG_0274.JPG",		// 70
"./images/IMG_0275.JPG",		// 71
"./images/IMG_0276.JPG",		// 72
"./images/IMG_0277.JPG",		// 73
"./images/IMG_0278.JPG",		// 74
"./images/IMG_0279.JPG",		// 75
"./images/IMG_0280.JPG",		// 76
"./images/IMG_0281.JPG",		// 77
"./images/IMG_0282.JPG",		// 78
"./images/IMG_0283.JPG",		// 79
"./images/IMG_0284.JPG",		// 80
"./images/IMG_0286.JPG",		// 81
"./images/IMG_0288.JPG",		// 82
"./images/IMG_0289.JPG",		// 83
"./images/IMG_0290.JPG",		// 84
"./images/IMG_0291.JPG",		// 85

// New Year's Eve & Day

"./images/IMG_0310.JPG",		// 86
"./images/IMG_0311.JPG",		// 87
"./images/IMG_0312.JPG",		// 88
"./images/IMG_0313.JPG",		// 89
"./images/IMG_0314.JPG",		// 90
"./images/IMG_0315.JPG",		// 91
"./images/IMG_0317.JPG",		// 92
"./images/IMG_0318.JPG",		// 93
"./images/IMG_0319.JPG",		// 94
"./images/IMG_0320.JPG",		// 95
"./images/IMG_0321.JPG",		// 96
"./images/IMG_0322.JPG",		// 97
"./images/IMG_0323.JPG",		// 98
"./images/IMG_0324.JPG",		// 99
"./images/IMG_0325.JPG",		// 100
"./images/IMG_0326.JPG",		// 101
"./images/IMG_0328.JPG",		// 102
"./images/IMG_0329.JPG",		// 103
"./images/IMG_0330.JPG",		// 104
"./images/IMG_0331.JPG",		// 105
"./images/IMG_0332.JPG",		// 106
"./images/IMG_0333.JPG",		// 107
"./images/IMG_0334.JPG",		// 108
"./images/IMG_0336.JPG",		// 109
"./images/IMG_0337.JPG",		// 110
"./images/IMG_0338.JPG",		// 111
"./images/IMG_0339.JPG",		// 112
"./images/IMG_0340.JPG",		// 113
"./images/IMG_0341.JPG",		// 114
"./images/IMG_0343.JPG",		// 115
"./images/IMG_0344.JPG",		// 116
"./images/IMG_0346.JPG",		// 117
"./images/IMG_0347.JPG",		// 118
"./images/IMG_0348.JPG",		// 119
"./images/IMG_0349.JPG",		// 120
"./images/IMG_0350.JPG",		// 121
"./images/IMG_0353.JPG",		// 122

// Portland Trip

"./images/IMG_0355.JPG",		// 123
"./images/IMG_0356.JPG",		// 124
"./images/IMG_0358.JPG",		// 125
"./images/IMG_0359.JPG",		// 126
"./images/IMG_0360.JPG",		// 127
"./images/IMG_0361.JPG",		// 128
"./images/IMG_0362.JPG",		// 129
"./images/IMG_0363.JPG",		// 130
"./images/IMG_0365.JPG",		// 131
"./images/IMG_0366.JPG",		// 132
"./images/IMG_0367.JPG",		// 133
"./images/IMG_0368.JPG",		// 134
"./images/IMG_0370.JPG",		// 135
"./images/IMG_0371.JPG",		// 136
"./images/IMG_0372.JPG",		// 137
"./images/IMG_0373.JPG",		// 138
"./images/IMG_0374.JPG",		// 139

// Dance!!

"./images/IMG_0393.JPG",		// 140
"./images/IMG_0394.JPG",		// 141
"./images/IMG_0395.JPG",		// 142
"./images/IMG_0396.JPG",		// 143
"./images/IMG_0397.JPG",		// 144
"./images/IMG_0399.JPG",		// 145
"./images/IMG_0400.JPG",		// 146
"./images/IMG_0401.JPG",		// 147

// Snowboard

"./images/IMG_0381.JPG",		// 148
"./images/IMG_0382.JPG",		// 149
"./images/IMG_0386.JPG",		// 150
"./images/IMG_0387.JPG",		// 151

// My B-day

"./images/IMG_0407.JPG",		// 152
"./images/IMG_0411.JPG",		// 153
"./images/IMG_0414.JPG",		// 154
"./images/IMG_0415.JPG",		// 155
"./images/IMG_0416.JPG",		// 156

// International Dinner

"./images/339.jpg",		// 157
"./images/340.jpg",		// 158
"./images/341.jpg",		// 159
"./images/342.jpg",		// 160
"./images/343.jpg",		// 161
"./images/344.jpg",		// 162
"./images/345.jpg",		// 163
"./images/346.jpg",		// 164
"./images/347.jpg",		// 165
"./images/348.jpg",		// 166
"./images/349.jpg",		// 167
"./images/351.jpg",		// 168
"./images/352.jpg",		// 169
"./images/353.jpg",		// 170
"./images/354.jpg",		// 171
"./images/355.jpg",		// 172
"./images/356.jpg",		// 173

// Snowy night!

"./images/371.jpg",		// 174
"./images/372.jpg",		// 175
"./images/373.jpg",		// 176
"./images/375.jpg",		// 177
"./images/376.jpg",		// 178
"./images/379.jpg",		// 179
"./images/380.jpg",		// 180

// Ben's Farewell

"./images/457.jpg",		// 181
"./images/458.jpg",		// 182
"./images/459.jpg",		// 183
"./images/460.jpg",		// 184
"./images/461.jpg",		// 185
"./images/462.jpg",		// 186

// Nick & Kate's Farewell

"./images/485.jpg",		// 187
"./images/487.jpg",		// 188
"./images/488.jpg",		// 189
"./images/489.jpg",		// 190
"./images/491.jpg",		// 191
"./images/492.jpg",		// 192
"./images/493.jpg",		// 193
"./images/494.jpg",		// 194
"./images/498.jpg",		// 195
"./images/501.jpg",		// 196
"./images/505.jpg",		// 197
"./images/506.jpg",		// 198
"./images/507.jpg",		// 199
"./images/508.jpg",		// 200

// Turkish Night

"./images/525.jpg",		// 201
"./images/526.jpg",		// 202
"./images/527.jpg",		// 203
"./images/530.jpg",		// 204
"./images/531.jpg",		// 205
"./images/532.jpg",		// 206
"./images/534.jpg",		// 207
"./images/535.jpg",		// 208
"./images/537.jpg",		// 209
"./images/538.jpg",		// 210
"./images/540.jpg",		// 211
"./images/541.jpg",		// 212
"./images/545.jpg",		// 213
"./images/547.jpg",		// 214
"./images/548.jpg",		// 215
"./images/552.jpg",		// 216
"./images/554.jpg",		// 217
"./images/555.jpg",		// 218
"./images/556.jpg",		// 219
"./images/561.jpg",		// 220
"./images/563.jpg",		// 221
"./images/566.jpg",		// 222
"./images/569.jpg",		// 223
"./images/573.jpg",		// 224
"./images/575.jpg",		// 225
"./images/583.jpg",		// 226
"./images/587.jpg",     // 227

// Skating!!

"./images/622.jpg",		// 228
"./images/623.jpg",		// 229
"./images/624.jpg",		// 230
"./images/626.jpg",		// 231
"./images/627.jpg",		// 232
"./images/629.jpg",		// 233

// Chinese New Year's Party

"./images/632.jpg",		// 234
"./images/633.jpg",		// 235
"./images/634.jpg",		// 236
"./images/635.jpg",		// 237
"./images/636.jpg",		// 238
"./images/638.jpg",		// 239
"./images/639.jpg",		// 240
"./images/641.jpg",		// 241
"./images/643.jpg",		// 242
"./images/644.jpg",		// 243
"./images/645.jpg",		// 244
"./images/646.jpg",		// 245
"./images/647.jpg",		// 246
"./images/649.jpg",		// 247

// Vancouver Aquarium!

"./images/652.jpg",		// 248
"./images/655.jpg",		// 249
"./images/659.jpg",		// 250
"./images/660.jpg",		// 251
"./images/662.jpg",		// 252
"./images/663.jpg",		// 253
"./images/665.jpg",		// 254
"./images/672.jpg",		// 255
"./images/673.jpg",		// 256
"./images/674.jpg",		// 257
"./images/675.jpg",		// 258
"./images/676.jpg",		// 259
"./images/677.jpg",		// 260

// Emre's B-day

"./images/686.jpg",		// 261
"./images/687.jpg",		// 262
"./images/688.jpg",		// 263
"./images/689.jpg",		// 264
"./images/690.jpg",		// 265
"./images/691.jpg",		// 266
"./images/692.jpg",		// 267
"./images/693.jpg",		// 268
"./images/694.jpg",		// 269
"./images/696.jpg",		// 270
"./images/697.jpg",		// 271

// Easter Dinner

"./images/1100.jpg",	// 272
"./images/1101.jpg",	// 273
"./images/1103.jpg",	// 274
"./images/1104.jpg",	// 275
"./images/1105.jpg",	// 276
"./images/1106.jpg",	// 277
"./images/1107.jpg",	// 278
"./images/1109.jpg",	// 279
"./images/1111.jpg",	// 280
"./images/1113.jpg",	// 281
"./images/1114.jpg",	// 282
"./images/1122.jpg",    // 283

/* Hakan's B-day! HOT!!!

"./images/1289.jpg",	// 284
"./images/1285.jpg",	// 
"./images/1286.jpg",	// 
"./images/1287.jpg",	// 
"./images/1288.jpg",	// 
"./images/1284.jpg",	// 
"./images/1290.jpg",	// 
"./images/1291.jpg",	// 
"./images/1292.jpg",	// 
"./images/1293.jpg",	//
"./images/1294.jpg",	// 
"./images/1295.jpg",	// 
"./images/1296.jpg",	// 
"./images/1297.jpg",	// 297
"./images/1298.jpg",	// 298
"./images/1299.jpg",	// 
"./images/1300.jpg",	// 
"./images/1301.jpg",	// 
"./images/1302.jpg",	// 
"./images/1303.jpg",	// 
"./images/1304.jpg",	// 
"./images/1305.jpg",	// 
"./images/1306.jpg",	// 
"./images/1307.jpg",	// 
"./images/1308.jpg",	// 
"./images/1309.jpg",	// 
"./images/1310.jpg",	// 
"./images/1311.jpg",	// 
"./images/1312.jpg",	// 
"./images/1313.jpg",	// 
"./images/1314.jpg",	// 314
*/

// Turkish Folk Dance
"./images/IMG_1574.JPG",		// 
"./images/IMG_1575.JPG",		// 
"./images/IMG_1576.JPG",		// 
"./images/IMG_1577.JPG",		// 
"./images/IMG_1578.JPG",		// 
"./images/IMG_1579.JPG",		// 
"./images/IMG_1580.JPG",		// 
"./images/IMG_1581.JPG",		// 
"./images/IMG_1582.JPG",		// 
"./images/IMG_1583.JPG",		// 
"./images/IMG_1584.JPG",		// 
"./images/IMG_1585.JPG",		// 
"./images/IMG_1586.JPG",		// 
"./images/IMG_1587.JPG",		// 
"./images/IMG_1588.JPG",		// 
"./images/IMG_1589.JPG",		// 
"./images/IMG_1590.JPG",		// 
"./images/IMG_1591.JPG",		// 
"./images/IMG_1592.JPG",		// 
"./images/IMG_1594.JPG",		// 
"./images/IMG_1595.JPG",		// 
"./images/IMG_1596.JPG",		// 
"./images/IMG_1597.JPG",		// 
"./images/IMG_1598.JPG",		// 
"./images/IMG_1599.JPG",		// 
"./images/IMG_1600.JPG",		//340 

// with my mexican brother
"./images/carlos&me.jpg",	// 341
"./images/carlos1.jpg",	// 
"./images/carlos2.jpg",	// 

// Halifax photos
"./images/Halifax_photos/IMG_1670.JPG",	// 344
"./images/Halifax_photos/IMG_1671.JPG",	// 
"./images/Halifax_photos/IMG_1675.JPG",	// 
"./images/Halifax_photos/IMG_1677.JPG",	// 
"./images/Halifax_photos/IMG_1678.JPG",	// 
"./images/Halifax_photos/IMG_1679.JPG",	//
"./images/Halifax_photos/IMG_1680.JPG",	//350

// Misc
"./images/1272.jpg",	// 351
"./images/1274.jpg",	// 
"./images/1275.jpg",	// 
"./images/1278.jpg",	// 
"./images/1280.jpg",	//
"./images/1282.jpg",	// 
"./images/1283.jpg",	// 
"./images/IMG_0138.JPG",		// 
"./images/IMG_0139.JPG",		// 
"./images/IMG_0181.JPG",		// 
"./images/IMG_0133.JPG",		// 
"./images/IMG_0185.JPG" 		// 362
);



/* above is the array that holds our images, it is indexed from 0 to 
   (number of elements - 1) */

var thisPic = 0;  //the counter for the image array
var lastPic = 362;  //the last cell in our array = (number of pictures)

/*
function myInit() {
    document.myApplet.newText("Click on buttons below to start slide show.");    
}
*/

function display() {
  if (document.images) {
    document.myPicture.src=myPix[thisPic];
//    document.myApplet.newText(myTex[thisPic]);    
  }
  reset();
}

function reset() {
	// resets the menu selection upon entry after selected picture is displayed
	document.dropdownmenu.selector.selectedIndex = 0;
}

function my_win()
{
var url = "http://www.cs.ubc.ca/~okumak/"+myPix[thisPic];
switch (thisPic)
 {
  case 0:
    mywin=open("","mywindow","dependent=yes,width=510,height=412,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 2:
    mywin=open("","mywindow","dependent=yes,width=440,height=593,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 3:
    mywin=open("","mywindow","dependent=yes,width=599,height=601,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 34:
    mywin=open("","mywindow","dependent=yes,width=540,height=528,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 36:
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 38:
    mywin=open("","mywindow","dependent=yes,width=391,height=528,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 100: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 107: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 153: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 154: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 190: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 198: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 199: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 200: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 205: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 206: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;    
  case 207: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 231: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 234: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 235: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 237: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 269: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 278: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break; 
  case 280: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break; 
  /*
  case 297: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 298: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  */
  case 287://case 318: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 289://case 320: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 290://case 321: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  case 313://case 344: 
    mywin=open("","mywindow","dependent=yes,width=500,height=720,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");
    break;
  default:
    mywin=open("","mywindow","dependent=yes,width=680,height=540,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=yes");  
    break;
 }
 
mywin.document.open();
mywin.document.writeln('<html><head>');
mywin.document.writeln('<title>Higher resolution picture!! :)</title>');

mywin.document.writeln('<!-- head text -->');

mywin.document.writeln('</head><body' + 
      ' onBlur=\'window.close()\''+
      ' onKeyDown=\'window.close()\''+
      ' onKeyPress=\'window.close()\''+
      '>');

mywin.document.writeln('<center><img src='+url+'></center>');
// mywin.document.writeln('<center>'+myTex[thisPic]+'</center>');
mywin.document.writeln('<form><center><input type="button" value=" Close " onclick="window.close()"></center></form>');
mywin.document.writeln('</body></html>');
mywin.document.close();
mywin.focus(); 

}

function processPrevious() {
  if (thisPic > 0){ //if at the very beginning of array
    thisPic--; //else simply decrement the counter                    
    display();
  }
  else{
    thisPic=lastPic;
    display();
  } 
}

function processNext() {
  if (thisPic < lastPic){ //if at the very end of the array
    thisPic++; //else simply increment the counter
    display();
  }
  else {
    thisPic=0;
    display();
  }
}

var Section = new Array(
	"Rock Climbing",
	"Halloween 2001", 
	"Luna",
	"Where am I?",
	"Xmas Dinner at SJC",
	"Dinnner at Nick and Kate",
	"SJC on Xmas Eve",
	"SJC on Xmas",
	"New Year's Eve & Day 2002",
	"Portland Trip",
	"Dance",
	"Snowboard",
	"My 24th B-day!",
	"International Dinner",
	"Snowy night at SJC",
	"Ben's Farewell",
	"Nick & Kate Farewell",
	"Turkish night!",
	"Skating",
	"Chinese New Year Party",
	"Vancouver Aquarium",
	"Emre's B-day",
	"Easter Dinner",
	//"Hakan's B-day",
	"Turkish Folk Dance",
	"My mexican brother",
	"Halifax IS2003",
	"Misc"
);

var Index = new Array(
	"1",
	"3", 
	"10",
	"12",
	"13",
	"31",
	"41",
	"61",
	"86",
	"123",
	"140",
	"148",
	"152",
	"157",
	"174",
	"181",
	"187",
	"201",
	"228",
	"234",
	"248",
	"261",
	"272",
	"284",
	//"315",
	//"341",
	//"344",
	//"351"
	"310",
	"313",
	"320"
);

function whichPic(pic) {
	thisPic = parseInt(pic);
	display();
}

function addButtons() {
	document.write('<center><form>');
	document.write('<INPUT type="BUTTON"  value="&nbsp;&nbsp;&laquo;&nbsp;" name="left" onClick="processPrevious()">');
	document.write('<INPUT type="BUTTON"  value="&nbsp;&nbsp;&raquo;&nbsp;" name="right" onClick="processNext()"><br>');
	document.write('<INPUT type="BUTTON"  value="Higher resolution picture" name="right" onClick="my_win()"><br>');
	document.write('</form></center>')
}
function addDropDownMenu() {  
	// drop down link menu
	document.write('<form name="dropdownmenu"><select onChange="whichPic(this.options[this.selectedIndex].value)" name="selector">');

	document.write('<option value = "">Gallery</option>');
	for (i = 0; i < Section.length; i++)
	{
		document.write("<option value = " + Index[i]  + ">" + Section[i] + "</option>");
	}
	document.write('</select></form>');
}

