var avideos = new Array("1","2","3","4","5");
var videos = new Array("Hope_and_Cope","ProductLaunch","NAFFEM","ThemedNight","CDPhoto_gallery");
var tvideos_en = new Array('<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Tribute Gala & Fundraiser - 900 guests</b></p><p class="normal"><b>Our Mandate</b><br/>Celebrate the 25<sup>th</sup> Anniversary of <i>Hope & Cope</i> with a special tribute to its founder and President, Sheila Kussner.</p><p class="normal"><b>The Event</b><br/>Using Sheila as our inspiration, we created an evening capturing her persona - elegant, dynamic and inspirational.  The challenge was to balance and blend information and entertainment in a consistent flow.  Our well-paced rhythm between videos, testimonials, performances and dinner courses assured the success of the evening.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Product Launch Closing Gala  - 450 guests</b></p><p class="normal"><b>Our Mandate</b><br/>To close a smoking cessation product launch employing our client&rsquo;s product keynote <i>imprisonment and escape</i>.</p><p class="normal"><b>The Event</b><br/>We wanted to deliver the suggestion of prison in an upbeat manner.  Cocktail decor evoked a chic and stylized jail and gave way to guards escorting guests to the dining area, similarly themed.  A driving performance of <i>Jailhouse Rock</i> led to a heart-stopping aerial tissue prison escape employing over 20 artists.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Fashion Show - Custom Performances </b></p><p class="normal"><b>Our Mandate</b><br/>Create brief, yet dramatic, preludes to three collections to the theme <i>The Orient Express</i>.</p><p class="normal"><b>The Event</b><br/>We envisaged a globetrotter making stops in exciting cities where she was greeted by local dancers.  Meticulous selection of music enabled us to quickly evoke Moscow, Hong Kong and Delhi, immediately transporting the audience to each destination. Original and rhythmic choreography facilitated the transition from performance to the fashion segments.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Themed Soir&eacute;e - 180 guests</b></p><p class="normal"><b>Our Mandate</b><br/>Create an uplifting, modern get-together for the sales force of a major company, using a hip, urban approach.</p><p class="normal"><b>The Event</b><br/>We opted for a very edgy look, feel and sound, starring Montr&eacute;al by night.  Urban decor, images of Montr&eacute;al, performances by human beat-box Charly Pop, street drummers, flamboyant acrobatic barmen and the band High Fidelity, recreated the pulse of an urban night out.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Photo Gallery</b></p><p class="normal">Have a look at our photo gallery, where a picture is worth a thousand words.</p>');
var tvideos_fr = new Array('<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Gala honorifique - lev&eacute;e de fonds - 900 invit&eacute;s</b></p><p class="normal"><b>Le mandat</b><br/>C&eacute;l&eacute;brer les 25 ans de la fondation <i>L&rsquo;espoir, c&rsquo;est la vie</i> et honorer sa pr&eacute;sidente et fondatrice Sheila Kussner.</p><p class="normal"><b>L&rsquo;&eacute;v&eacute;nement</b><br/>Madame Kussner nous a inspir&eacute; une soir&eacute;e &agrave; son image : &eacute;l&eacute;gante, &eacute;mouvante, dynamique.  Le d&eacute;fi fut de trouver un &eacute;quilibre entre information et animation tout en gardant un rythme soutenu.  Le fin dosage entre vid&eacute;os, t&eacute;moignages, performances et d&icirc;ner assur&egrave;rent le succ&egrave;s de la soir&eacute;e.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Gala pour lancement de produit - 450 invit&eacute;s</b></p><p class="normal"><b>Le mandat</b><br/>Cl&ocirc;turer le lancement d&rsquo;un produit pour arr&ecirc;ter de fumer en utilisant leur axe de communication bas&eacute; sur l&rsquo;emprisonnement et l&rsquo;&eacute;vasion.</p><p class="normal"><b>L&rsquo;&eacute;v&eacute;nement</b><br/>Le d&eacute;fi : utiliser le th&egrave;me de la prison tout en restant festifs.  Nous avons donc cr&eacute;&eacute; une prison stylis&eacute;e avec quelques clins d&rsquo;oeil aux fameuses rayures blanches et noires.  L&rsquo;animation a fait le reste.  Nos gardiens ont gentiment eu les invit&eacute;s &agrave; l&rsquo;oeil, les danseurs les ont &eacute;nergis&eacute;s avec un <i>Jailhouse Rock</i>  revisit&eacute; et la grande &eacute;vasion, impliquant 20 artistes, les a laiss&eacute;s &agrave; bout de souffle mais fin pr&ecirc;ts &agrave; savourer leur libert&eacute;.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>D&eacute;fil&eacute; de mode - num&eacute;ros sur mesure</b></p><p class="normal"><b>Le mandat</b><br/>Cr&eacute;er trois num&eacute;ros de 2m30 sous le th&egrave;me du voyage de l&rsquo;Orient Express.  Trois arr&ecirc;ts, trois villes, trois inspirations pour les collections.</p><p class="normal"><b>L&rsquo;&eacute;v&eacute;nement</b><br/>Une voyageuse fait escale dans trois villes o&ugrave; elle est accueillie par des danseurs locaux.  Notre d&eacute;fi a &eacute;t&eacute; de trouver des musiques qui &eacute;voquent rapidement la ville pour ensuite cr&eacute;er des chor&eacute;graphies originales et dynamiques qui faciliteraient la transition vers les blocs de d&eacute;fil&eacute;.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Soir&eacute;e th&eacute;matique - force de vente - 180 invit&eacute;s</b></p><p class="normal"><b>Le mandat</b><br/>Cr&eacute;er pour la force de vente d&rsquo;une grande entreprise un &eacute;v&eacute;nement moderne et ancr&eacute; dans le Montr&eacute;al d&rsquo;aujourd&rsquo;hui.</p><p class="normal"><b>L&rsquo;&eacute;v&eacute;nement</b><br/>Nous avons opt&eacute; pour un concept tr&egrave;s urbain s&rsquo;inspirant du Montr&eacute;al la nuit. Un d&eacute;cor tr&egrave;s actuel, des barmans aux acrobaties flamboyantes, des images infographique de Montr&eacute;al, le superbe Charly Pop et enfin, le band High Fidelity ont litt&eacute;ralement donn&eacute; vie au concept.</p>',
		'<h1><span class="redTitle1"><i>Portfolio</i></span></h1><p class="normal"><b>Galerie photo</b></p><p class="normal">Parce que parfois, une photo vaut mille mots.</p>');



function insertAnimation(fname,dname) {
	ob = document.getElementById(dname);
	width = ob.offsetWidth;
	height = ob.offsetHeight;
	//alert("width:"+width);
	var so = new SWFObject("/flash/"+fname+".swf", "animation", width, height, "8");
	so.write(dname);
	//alert(ob.innerHTML)
}

function insertVideo(id) {
	var ob = document.getElementById("videoAnim");
	var width = ob.offsetWidth;
	var height = ob.offsetHeight;
	if(videos[id*1-1] == ""){
		insertVideoToCame();		
	}else{
		var so = new SWFObject("/flash/mediaplayer.swf?media=/flash/"+videos[id*1-1]+".flv&type=flv", "animation", width, height, "8");
		so.addParam("bgcolor","#ffffff");
		so.write("videoAnim");
	}
}

function insertVideoToCame(){
	var ob = document.getElementById("videoAnim");
	var ndt = (pageURL.lang == "en")?"<div class='toComeDiv_en'>&nbsp;<div>":"<div class='toComeDiv_fr'>&nbsp;</div>";
	ob.innerHTML = ndt;
}


function rollOnSelector(obj){
	var cels = obj.getElementsByTagName("td");
	//resetSelector(obj);
	for(var i=0;i<cels.length;i=i+1){
		cn = cels[i].className;
		if(cn.indexOf("selectorEvent_off")>=0){
			cels[i].className="selectorEvent_on";
		}
	}
	
}

function selectSelector(obj){
	var cels = obj.getElementsByTagName("td");
	resetSelector(obj);
	for(var i=0;i<cels.length;i=i+1){
		cn = cels[i].className;
		if(cn.indexOf("selectorEvent")>=0){
			cels[i].className="selectorEvent_selected";
		}
	}
}

function rollOffSelector(obj){
	var cels = obj.getElementsByTagName("td");
	//resetSelector(obj);
	orig = document.getElementById("selector"+eventid);
	if(orig.className.indexOf("_selected")<0){
		orig.className="selectorEvent_on";
	}
}

function resetSelector(obj){
	line = obj.parentNode;
	var cels = line.getElementsByTagName("td");
	for(var i=0;i<cels.length;i=i+1){
		cn = cels[i].className;
		if(cn.indexOf("selectorEvent")>=0){
			cels[i].className="selectorEvent_off";
		}
	}
}

function playvideo(id){
	if(avideos.contains(id)){
		insertVideo(id);
	}else{
		insertVideoToCame();
	}
	eventid = id;
	insertText(id);
	//rollOnSelector(document.getElementById("sel"+eventid));
	selectSelector(document.getElementById("sel"+eventid));
	
}

function insertText(index){
	ob = document.getElementById("textContent");
	ob.innerHTML = (pageURL.lang == "en")?tvideos_en[index-1]:tvideos_fr[index-1];
}

Array.prototype.contains = function(value){
	rez = false;
	for(var i=0;i<this.length;i=i+1){
		if(this[i] == value){
			rez = true;
		}
	}
	return rez;
};

function prepareVideos(){
	if(pageURL.page == 'portfolio'){
		if(typeof(eventid) != "undefined"){
			for(var i=1;i<6;i=i+1){
				if(!avideos.contains(i)){
					ob = document.getElementById("tc"+i);
					ob.className = "tocame_off";
				}
			}
		}
	}
}
window.onload = prepareVideos;


var projectExtension='html';
var pageURL = function(){
	txt=window.location.href;
	tabs=txt.split("/");
	p=tabs[tabs.length-1].substring(0,tabs[tabs.length-1].lastIndexOf('.'));
	v=(tabs[tabs.length-1].indexOf('?') >= 0)?tabs[tabs.length-1].substring(0,tabs[tabs.length-1].indexOf('?')):tabs[tabs.length-1];
	ps=(tabs[tabs.length-1].indexOf('?') >= 0)?tabs[tabs.length-1].substring(tabs[tabs.length-1].indexOf('?')+1):'';
	return{
		protocol:tabs[0].substring(0,tabs[0].indexOf(':')),
		serverName:tabs[2],	
		lang:tabs[3],	
		page:(p=='')?'index':p,
		pagewe:(v=='')?'index.'+projectExtension:v,
		parameters:ps.split('&')
	};
}();

function openPortfolio(lang){
	location.href = "/"+lang+"/portfolio.html?eventid="+eventid;
}

var eventid=1;

function startPortfolio(){
	prms = pageURL.parameters;
	for(var i=0;i<prms.length;i++){
		if(prms[i].indexOf("eventid") >=0){
			tabs = prms[i].split('=');
			eventid = tabs[1];
		}	
	}
	playvideo(eventid);
}

