var gAGMRegistrationCutoff = Date.UTC(2010,5,3,21);	//June 3 at 17:00 EDT = June 3 at 16:00 EST = June 3 at 21:00 UTC
var aNow = new Date();
var gAGMRegistrationClosed = (aNow.getTime() > gAGMRegistrationCutoff);
//alert(aNow.toUTCString()  + '; ' + new Date(gAGMRegistrationCutoff).toUTCString() + "; Closed is " + gAGMRegistrationClosed);

// -- Action Functions
function CSOpenWindow(action) {
	var wf = "";	
	wf = wf + "width=" + action[3];
	wf = wf + ",height=" + action[4];
	wf = wf + ",resizable=" + (action[5] ? "yes" : "no");
	wf = wf + ",scrollbars=" + (action[6] ? "yes" : "no");
	wf = wf + ",menubar=" + (action[7] ? "yes" : "no");
	wf = wf + ",toolbar=" + (action[8] ? "yes" : "no");
	wf = wf + ",directories=" + (action[9] ? "yes" : "no");
	wf = wf + ",location=" + (action[10] ? "yes" : "no");
	wf = wf + ",status=" + (action[11] ? "yes" : "no");		
	window.open(action[1],action[2],wf);
}
function openWorkshopPopup(pUrl) {
	CSOpenWindow( new Array(CSOpenWindow,/*URL*/ pUrl,'_blank',600,500,false,true,false,false,false,false,false) );
}

function MastheadFlash(pFileName) {

// Write object by javascript to get around MS restrictions
// ref: http://www.adobe.com/devnet/activecontent/articles/devletter.html

	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' height='215' width='800'>");
	document.write("<param name='movie' value='" + pFileName + "' />");
	document.write("<param name='quality' value='best' />");
	document.write("<param name='play' value='true' />");
	document.write("<embed height='215' pluginspage='http://www.macromedia.com/go/getflashplayer' src='" + pFileName + "' type='application/x-shockwave-flash' width='800' quality='best' play='true'></embed>");
	document.write("</object>\n");
// 	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="750" height="210" id="masthead" align="middle">\n');
// 	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
// 	document.write('<param name="allowFullScreen" value="false" />\n');
// 	document.write('<param name="movie" value="' + pFileName + '" /><param name="loop" value="false" /><param name="quality" value="high" /><param name="scale" value="noborder" /><param name="bgcolor" value="#ffffff" />\n');
// 	document.write('<embed src="' + pFileName + '" loop="false" quality="high" scale="noborder" bgcolor="#ffffff" width="750" height="210" name="masthead" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
// 	document.write('</object>\n');
}

function agmregister(pLang) {	
	
	if (gAGMRegistrationClosed) {
		var aMess = (pLang == "F") ? 
			"D\xE9sol\xE9, l’inscription en ligne pour l’assembl\xE9e annuelle est maintenant termin\xE9e. Vous pouvez vous inscrire à l’AGA ou apporter des changements à votre inscription sur place au Centre des congr\xE8s de London, \xE9tage principal, à compter de 11 h le mercredi 9 juin (10 h pour les participants à la CGC)." :
			"Sorry, online registration for the Annual Meeting is now closed. You can register for the AGM or make registration changes on-site at the London Convention Centre, main level, beginning at 11 a.m. on Wednesday, June 9th (10 a.m. for CMC participants)."
		alert(aMess);
	} else {
		CSOpenWindow( new Array(CSOpenWindow,/*URL*/ 'https://www.confersense-events.com/chfc/','_blank',1024,800,false,true,false,false,false,false,false) );
	 	//var aMess = (pLang == "F") ? "L'inscription en ligne commencera le 22 f\xE9vrier 2010" : "Online registration begins on February 19, 2010"
	 	//alert(aMess);
	}
}

function agmregisterclosed(pLang) {	
 	var aMess = (pLang == "F") ? 
		"D\xE9sol\xE9, l’inscription en ligne pour l’assembl\xE9e annuelle est maintenant termin\xE9e. Veuillez vous inscrire sur place au Centre des congres de Victoria à compter de 13 h 30 le mercredi 27 mai." :
 		"Sorry, online registration for the Annual Meeting is now closed. Please register on-site at the Victoria Conference Centre beginning at 1:30 p.m. on Wednesday, May 27th."
 	alert(aMess);
}

function agmchecklist() {
	CSOpenWindow( new Array(CSOpenWindow,/*URL*/ 'agm_checklist.html','_blank',600,500,false,true,false,false,false,false,false) );
}

function agmschedule() {
	CSOpenWindow( new Array(CSOpenWindow,/*URL*/ 'agm_schedule.html','_blank',600,500,false,true,false,false,false,false,false) );
}
