
/* ******* The TEAM ******* */
var Video = Class.create();
Video.prototype = {
    initialize: function(oId, oTitle, oPath) {
        this.id = oId;
        this.title = oTitle;
        this.path = oPath;
    }, // initialize
	videoObject: function() {
	return '<object width=\"560\" height=\"340\"><param name=\"movie\" value=\"http://www.youtube.com/v/lfGU8SuaiMM&hl=en&fs=1&rel=0\">' +
		   '</param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param>' +
		   '<embed src=\"' + this.path + '\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" ' +
		   'width=\"560\" height=\"340\"></embed></object>';
	}
}

var Photo = Class.create();
Photo.prototype = {
    initialize: function(oId, oThumbNail, oLargeImage) {
        this.id = oId;
        this.thumb = oThumbNail;
        this.largeImage = oLargeImage;
    } // initialize
}

var Sponsor = Class.create();
Sponsor.prototype = {
    initialize: function(oId, oImage, oTitle, oSummary, oAddress) {
        this.id = oId;
        this.image = oImage;
        this.title = oTitle;
		this.summary = oSummary;
		this.address = oAddress;
    } // initialize
}

var PaddlerBio = Class.create();
PaddlerBio.prototype = {
    initialize: function(oId, oRealName, oMenuItem, oNickName, oPosition, oImage) {
        this.id = oId;
        this.realName = oRealName;
        this.menuItem = oMenuItem;
        this.nickName = oNickName;
        this.position = oPosition;
        this.image = oImage;
    } // initialize
}

var ua = window.navigator.userAgent
var msie = ua.indexOf("MSIE ")

function getGotPhoBio() {
    $('gotPhoBio').innerHTML = "<p>Got Pho? is a dragonboat racing team based out of Edmonton, Alberta.  Formed from a group of friends wanting " +
                           "to experience a new challenge together, we've come a long way from the team who perfected the caterpiller early in our " +
                           "team's history.  We pride ourselves on being a team that drives to excel, while trying not to make a fool of " +
                           "ourselves along the way.  We're a group that is continually motivated to grow as friends on and off the boat. " +
                           "<p>Our team name is derived from our second, and sometimes first, passion for really, ridiculously, good food.  We are so thankful " +
                           "for the support of our first sponsors Doan's Vietnamese restaurants and CraneTech, who saw promise in us even after completing our first race " +
                           "in a painful 4 minutes.  Pho is vietnamese for beef noodle soup and Got Pho? is sometimes also known as Got Sushi?, Got Japadogs?, Got Bubble Tea?,..." +
                           "<p>Today we are part of the Edmonton Dragonboat Racing Club and practice out of Edmonton's beautiful river valley. " +
                           "We are indebted to the knowledge and expertise of our coaches from the club.  In particular, we are grateful for the " +
                           "tremendous mentorship of Kevin Kwan, without who's help, we would still be perfecting the caterpillar and the donut. ";

}

var paddlers = [];
var videos = [];
var photos = [];
var photoLefts = [];
var sponsors = [];

var mVideoItem = 'position:relative;left:1px;height:30px;width:224px;border:1px solid #777;background-color:#333;color:#AFAFAF;padding:10px;font-size:10pt;cursor:pointer;';
var mPhotoItem = 'position:absolute;top:0px;height:50px;width:75px;display:inline-block;margin-right:8px;';

function getPaddlerBios() {
    paddlers.push(new PaddlerBio('1', 'Lynda', 'Spring Rolls','','','lynda.jpg'));
    paddlers.push(new PaddlerBio('2', 'Eric', 'Salad Rolls', '', '', 'eric.jpg'));
    paddlers.push(new PaddlerBio('5', 'Rosan', 'Garlic Shrimp', '', '', 'rosan.jpg'));
    paddlers.push(new PaddlerBio('8', 'Helen', 'Kim Chi','','','helen.jpg'));
    paddlers.push(new PaddlerBio('10', 'Gina', 'Wonton Soup','','','gina.jpg'));
    paddlers.push(new PaddlerBio('12', 'Jess', 'sweet & sour soup','','','jess.jpg'));
    paddlers.push(new PaddlerBio('17', 'Brian ', 'Papaya Salad','','','bk.jpg'));
    paddlers.push(new PaddlerBio('25', 'Sang', 'vermicelli bowl','','','sang.jpg'));
    paddlers.push(new PaddlerBio('31', 'Kathleen', 'Grilled Beef','','','kathleen.jpg'));
    paddlers.push(new PaddlerBio('35', 'Linda', 'Golden Shrimp','','','linda.jpg'));
    paddlers.push(new PaddlerBio('54', 'Law', 'Steamed Rice','','','law.jpg'));
    paddlers.push(new PaddlerBio('72', 'Nancy', 'Lemongrass Tofu','','','nancy.jpg'));
    paddlers.push(new PaddlerBio('75', 'Jerry', 'Lemongrass Chicken','','','jerry.jpg'));
    paddlers.push(new PaddlerBio('86', 'Jo', 'Prawns & Peaches','','','jo.jpg'));
    paddlers.push(new PaddlerBio('87', 'Mike', 'lemongrass prawns','','','mikey.jpg'));
    paddlers.push(new PaddlerBio('88', 'Hughs', 'Salty Sweet Prawns','','','hughs.jpg'));
    paddlers.push(new PaddlerBio('89', 'Ellis', 'Seafood Kai Lai','','','ellis.jpg'));
    paddlers.push(new PaddlerBio('92', 'Wilson', 'Satay Prawns','','','wilson.jpg'));
    paddlers.push(new PaddlerBio('104', 'Noelle', 'Curry chicken','','','noelle.jpg'));
    paddlers.push(new PaddlerBio('108', 'Dennis', 'Iced Coffee','','','dennis.jpg'));
    paddlers.push(new PaddlerBio('114', 'Ming', 'three bean drink','','','ming.jpg'));
    paddlers.push(new PaddlerBio('121', 'Kenny', 'Sour Sop Milkshake','','','kenny.jpg'));
    paddlers.push(new PaddlerBio('122', 'Candy', 'Avocado Milkshake','','','candy.jpg'));
    paddlers.push(new PaddlerBio('123', 'Larry', 'Durian Milkshake','','','larry.jpg'));
}

function getVideos() {
    videos.push(new Video('mVideo1','Alcan Dragonboat Festival 2009'+'\n'+'Race #1','http://www.youtube.com/v/lfGU8SuaiMM&hl=en&fs=1&rel=0'));
    videos.push(new Video('mVideo2','Alcan Dragonboat Festival 2009'+'\n'+'Race #2', 'http://www.youtube.com/v/Ddk6Q2Fa_HY&hl=en&fs=1&rel=0'));
    videos.push(new Video('mVideo3','Alcan Dragonboat Festival 2009'+'\n'+'Race #3', 'http://www.youtube.com/v/w2tNldIoMbM&hl=en&fs=1&rel=0'));
    videos.push(new Video('mVideo4','Alcan Dragonboat Festival 2009'+'\n'+'Race #4 - Warm Up', 'http://www.youtube.com/v/JURYCsEMsD8&hl=en&fs=1&rel=0'));
    videos.push(new Video('mVideo5','Alcan Dragonboat Festival 2009'+'\n'+'Race #4', 'http://www.youtube.com/v/1955Yk-Noik&hl=en&fs=1&rel=0'));

    var mVideos = $('mVideos');
    var dt;
	for (var i=0;i<videos.length;i++) {
		dt = Builder.node('div',{style:mVideoItem},videos[i].title);
		//element = Builder.node('span',{style:'cursor:pointer;width:206px;'},videos[i].title);
		//element.id = 'mVideoSpan'+i;
		//dt.appendChild(element);
		dt.id = videos[i].id;

		Event.observe($(dt), 'mouseover', moVideo, false);
		Event.observe($(dt), 'mouseout', moVideo, false);
		Event.observe($(dt), 'click', viewVideo, false);

		mVideos.appendChild(dt);
    }
    $('mVideoUp').style.left = '-248px';
    
    if (videos.length <= 6) 
        $('mVideoDown').style.left = '-248px';
	
}

function getPhotos() {
    $('mPhotosListLoader').style.display = (msie > 0) ? 'none' : 'block';
    if (msie > 0) {
        $('mPhotoLoader').src = 'images/loader_bg.gif';
        $('mPhotoLoader').style.top = '0px';
    }
	for (var i=1;i<=26;i++){
        photos.push(new Photo('mp' + i, 'images/photos/thumbs/'+ i + '.jpg', 'images/photos/large/'+ i + '.jpg'));
    }

    var numLefts = photos.length / 8; 
    var left = 32;
    for (var i=0;i<numLefts;i++) {
        photoLefts[i] = left;
        left = left - 480;
    }
    
    var mPhotosList = $('mPhotosList');
    var dt, element;
    var photoLeft = 0;
	for (var i=0;i<photos.length;i++) {
		dt = Builder.node('div',{style:mPhotoItem+'left:'+photoLeft+'px;'},'');
		element = Builder.node('img',{style:'cursor:pointer;border:2px solid #CCC;'},'');
		element.id = photos[i].id;
		element.src = photos[i].thumb;
		dt.appendChild(element);
		dt.id = "photo" + photos[i].id;
		photoLeft = photoLeft + 80;
		
		Event.observe($(dt), 'mouseover', moThumb, false);
		Event.observe($(dt), 'mouseout', moThumb, false);
		Event.observe($(dt), 'click', viewPhoto, false);

		mPhotosList.appendChild(dt);
    }
    $('mPhotoLeft').style.top = '-60px';
    if (photos.length <= 4)
        $('mVideoDown').style.left = '-248px';
	
	if (msie <= 0)
	    new Effect.Opacity($('mPhotosListLoader'), {from:1.0,to:0.0,duration: 3.0, queue: { scope: 'mediaScope', position: 'end'}});
}

function getSponsors() {
    sponsors.push(new Sponsor('doans', 'images/sponsors/doans.jpg', 'Doan\'s',
                  'For over ten years, Doan\'s Restaurant has been proud to serve authentic vietnamese cuisine, offering their customers a ' +
                  'healthy alternative that sacrifices nothing in taste. They have two convenient locations and a friendly atmosphere for any ' +
                  'dining experience - be it business dinners, romantic dates, or family outings.<p>Doan\'s Restaurant has an extensive menu ' +
                  'that is a wonderful mix of traditional Vietnamese flavours, and Western specialities.<p>Downtown<br>10130 107 Street<br>' + 
                  '780.424.3034<p>Southside<br>7909 104 Street<br>780.434.4448'));
    sponsors.push(new Sponsor('cranetech', 'images/sponsors/cranetech.jpg', 
                  'Crane Tech - Service & Repair', 'Address:	 9812 47 Ave Nw Suite 1<br>' +
	              'Edmonton, AB,<br>T6E 5P3<br>Phone:	780-988-8822<br>Fax:	780-436-8477'));
}

function getEDBRCContent() {
	$('edbrcDetailTitle').innerHTML = 'EDBRC';
	$('edbrcDetailSummary').innerHTML = '<p>The Edmonton Dragon Boat Racing Club (EDBRC) was formed in 1999 to foster the growth of world class ' +
	                                    'and community Dragon Boat Racing in Alberta. In that time our members and teams have competed across Canada, ' +
	                                    'US and abroad.<p>We have a team for everyone ranging from the social weekend warrior to the competitive ' +
	                                    'athlete training several times per week. Our teams include co-ed teams, women teams senior teams, and youth ' +
	                                    'teams. <p>As part of our commitment to grow dragon boat racing for all levels, we are currently in the ' +
	                                    'process of creating what will be the only dedicated dragon boat club house in western Canada.' +
	                                    '<p>We are heavily involved in the community working closely with Big Brothers and Big Sisters Society of ' +
	                                    'Edmonton, River Valley Clean Up, and have hosted field trips for the Edmonton Public School Board and Norquest ' +
	                                    'College, as well as corporate team building events.<p>EDBRC is extremely proud to host the 2009 Corporate ' +
	                                    'Challenge dragon boat races and the 2009 Leduc Dragon Boat Festival!!!';	
}

function getFestivalsDetail() {
	$('festivalsDetail').innerHTML = '<h2>2009</h2><p>Alcan Dragonboat Festival <br> Competitive D<br> 3rd Place';	
}

function getTweets() {
	$('mTweetsContent').innerHTML = '<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" ' +
	                                'codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0\" width=\"734\" height=\"350\" id=\"TwitterWidget\" ' +
	                                'align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"false\" /><param name=\"movie\" ' +
	                                'value=\"http://static.twitter.com/flash/widgets/profile/TwitterWidget.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" ' +
	                                'value=\"#000000\" /><param name=\"FlashVars\" value=\"userID=52796207&styleURL=http://static.twitter.com/flash/widgets/profile/smooth.xml\"> ' +
	                                '<embed src=\"http://static.twitter.com/flash/widgets/profile/TwitterWidget.swf\" quality=\"high\" bgcolor=\"#000000\" width=\"734\" height=\"350\" ' +
	                                'name=\"TwitterWidget\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" ' +
	                                'pluginspage=\"http://www.macromedia.com/go/getflashplayer\" FlashVars=\"userID=52796207&styleURL=http://static.twitter.com/flash/widgets/profile/smooth.xml\"/></object>';
}
