
menunum=0;menus=new Array();_d=document;function addmenu(){menunum++;menus[menunum]=menu;}function dumpmenus(){mt="<script language=javascript>";for(a=1;a<menus.length;a++){mt+=" menu"+a+"=menus["+a+"];"}mt+="<\/script>";_d.write(mt)}

if(navigator.appVersion.indexOf( "MSIE 6.0") > 0 ) {
	effect = "Fade(duration=0.2);Alpha(style=0,opacity=94);";
}
else {
	effect = "";
	//effect = "Shadow(color='#777777', Direction=135, Strength=1)" // Stop IE5.5 bug when using more than one filter
}


timegap=500				// The time delay for menus to remain visible
followspeed=5			// Follow Scrolling speed
followrate=40			// Follow Scrolling Rate
suboffset_top=10;		// Sub menu offset Top position 
suboffset_left=10;		// Sub menu offset Left position

style1=[				// style1 is an array of properties. You can have as many property arrays as you need. This means that menus can have their own style.
"#ffffff",				// Mouse Off Font Color
"#224466",				// Mouse Off Background Color
"#ffffff",				// Mouse On Font Color
"#006699",				// Mouse On Background Color
"#000000",				// Menu Border Color 
14,						// Font Size in pixels
"normal",				// Font Style (italic or normal)
"bold",					// Font Weight (bold or normal)
"arial, helvetica, sans-serif;",		// Font Name
4,						// Menu Item Padding
,						// Sub Menu Image (Leave this blank if not needed)
"Raised",				// 3D Border & Separator bar
"#ffffff",				// 3D High Color
"#006699",				// 3D Low Color
"#ffffff",				// Current Page Item Font Color (leave this blank to disable)
"#006699",				// Current Page Item Background Color (leave this blank to disable)
,						// Top Bar image (Leave this blank to disable)
"ffffff",				// Menu Header Font Color (Leave blank if headers are not needed)
"000099",				// Menu Header Background Color (Leave blank if headers are not needed)
]




var imgPos = getImagePos( 'ccsd_logo' );

var x_pos = imgPos.x;
var y_pos = imgPos.y;

y_pos = y_pos + 105;
x_pos = x_pos - 30;
if( document.images ) {
	x_pos = x_pos + 1;
}


//mac detect for positioning of the nav menu

if ((navigator.appVersion.indexOf("Mac") != -1))
 		{
		var imgPos = getImagePos( 'ccsd_logo' );

var x_pos = imgPos.x;
var y_pos = imgPos.y;

y_pos = y_pos + 105;
x_pos = x_pos - 23;
if( document.images ) {
	x_pos = x_pos + 1;
}
}






addmenu(menu=[		// This is the array that contains your menu properties and details
"mainmenu",			// Menu Name - This is needed in order for the menu to be called
y_pos,				// Menu Top - The Top position of the menu in pixels
x_pos,				// Menu Left - The Left position of the menu in pixels
175,				// Menu Width - Menus width in pixels
1,					// Menu Border Width 
,					// Screen Position - here you can use "center;left;right;middle;top;bottom" or a combination of "center:middle"
style1,				// Properties Array - this is set higher up, as above
1,					// Always Visible - allows the menu item to be visible at all time (1=on/0=off)
"left",				// Alignment - sets the menu elements text alignment, values valid here are: left, right or center
effect,				// Filter - Text variable for setting transitional effects on menu activation - see above for more info
,					// Follow Scrolling - Tells the menu item to follow the user down the screen (visible at all times) (1=on/0=off)
0, 					// Horizontal Menu - Tells the menu to become horizontal instead of top to bottom style (1=on/0=off)
,					// Keep Alive - Keeps the menu visible until the user moves over another menu or clicks elsewhere on the page (1=on/0=off)
,					// Position of TOP sub image left:center:right
,					// Set the Overall Width of Horizontal Menu to 100% and height to the specified amount (Leave blank to disable)
,					// Right To Left - Used in Hebrew for example. (1=on/0=off)
,					// Open the Menus OnClick - leave blank for OnMouseover (1=on/0=off)
,					// ID of the div you want to hide on MouseOver (useful for hiding form elements)
,					// Reserved for future use
,					// Reserved for future use
,					// Reserved for future use
 // "Description Text", "URL", "Alternate URL", "Status", "Separator Bar",
,"HOME","home.html",,"Back to the home page",1
,"WHAT'S NEW?","new.html",,"News",1
,"PRESENTATIONS","presentations.html",,"Presentations",1
,"RESEARCH PRODUCTS","research.html",,"Research Products",1
,"URBAN POVERTY PROJECT","up.html",,"Urban Poverty Project",1
,"FAQS","faqs.html",,"FAQs",1
,"CONTACT US","contact.html",,"Contact Us",1
,"CCSD WEBSITE","javascript: openWin_full( \"http://www.ccsd.ca/home.htm\");",,"CCSD website  home page",1
,"FRAN&Ccedil;AIS","f_acceuil.html",, "Version fran&Ccedil;ais" ,1


])


// the code from lines 111-120 repositions the nav bar in relation to the CCSD logo 
// if the window is resized
window.onresize= moveMenu;

function moveMenu() {
	var imgPos = getImagePos( 'ccsd_logo' );
	var x_pos = imgPos.x;
	x_pos = x_pos - 30;
	if( document.images ) {	x_pos = x_pos + 1; }
	if( document.getElementById ) { document.getElementById( "menu1" ).style.left = x_pos; } else { document.all[ "menu1" ].style.pixelLeft = x_pos };
}

dumpmenus()


function getImagePos( thisImage ) {
	var img = document.images[ thisImage ];
	if ( document.layers ) return img;

	var rd = { x:0, y:0 };
	do {
		rd.x += parseInt( img.offsetLeft );
		rd.y += parseInt( img.offsetTop );
		img = img.offsetParent;
   } while ( img );
   
   return rd
};


function openWin( thisURL ){
		
	window.open( thisURL,'thankyou','width=700,height=400,left=100,top=100,screenX=100,screenY=100,menubar=yes,toolbar=no,scrollbars=yes,resizable=yes');

}


function openWin_full( thisURL ){
		
	window.open( thisURL,'newwindow','width=700,height=400,left=100,top=100,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes');


}
