
  ns6 = (!document.all && document.getElementById)? true:false
  ns4 = (document.layers)? true:false
  ie4 = (document.all)? true:false  


function PreloadMenuImgs() {

	MM_preloadImages('images/projects_b.gif',
                         'images/projects_w.gif',
                         'images/about_b.gif',
                         'images/about_w.gif',
	                 	'images/contact_b.gif',
                        'images/contact_w.gif',
						'images/press_b.gif',
						'images/press_w.gif',
						
			 'images/hmred_smbw.jpg',
			 'images/hmred_smcol.jpg',
			 'images/hands_smbw.jpg',
			 'images/hands_smcol.jpg',
			 'images/p2p_smbw.jpg',
			 'images/p2p_smcol.jpg',
			 'images/neocon_smbw.jpg',
			 'images/neocon_smcol.jpg',
			 'images/handcrank_smbw.jpg',
			 'images/handcrank_smcol.jpg',
			 'images/xfr_smbw.jpg',
			 'images/xfr_smcol.jpg',
			 'images/lileo_smbw.jpg',
			 'images/lileo_smcol.jpg',
			 'images/drake_smbw.jpg',
			 'images/drake_smcol.jpg',
			 'images/metoyou_smbw.jpg',
			 'images/metoyou_smcol.jpg',
			 'images/rom_smbw.jpg',
			 'images/rom_smcol.jpg',
			 'images/schulich_smbw.jpg',
			 'images/schulich_smcol.jpg',
			 'images/sjc_smbw.jpg',
			 'images/sjc_smcol.jpg',
			 'images/made_smbw.jpg',
			 'images/made_smcol.jpg',
			 'images/courtesy_smbw.jpg',
			 'images/courtesy_smcol.jpg',
			 'images/ck_smbw.jpg',
			 'images/ck_smcol.jpg',
			 'images/solar_smbw.jpg',
			 'images/solar_smcol.jpg'
			 )
}

// 
function changePic(pic,text) {
    if (ns4) document.layers['big'].src = pic;
    else if (ie4)  document.all['big'].src = pic; 
         else if(ns6) document.getElementById('big').src=pic;
	//big.src=pic
	writit(text, 'caption')
}


function show(showobj) {
	if (ns4) document.layers[showobj].visibility = "show";
	else if (ie4) document.all[showobj].style.visibility = "visible";
	     else if (ns6) document.getElementById(showobj).style.visibility="visible";
}

function hide(hideobj) {
	if (ns4) document.layers[hideobj].visibility = "hide";
	else if (ie4) document.all[hideobj].style.visibility = "hidden";
	     else if (ns6) document.getElementById(hideobj).style.visibility="hidden";
}


function writit(text,id)
{
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
	else if (document.layers)
	{
		x = document.layers[id];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}

// Image rollovers
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; 
  if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


