function swap(){
	var str = new String(window.location);
	regX = (str.indexOf("/english/")>0) ? /english/g : /francais/g ;
	newstring = (str.indexOf("/english/")>0) ? "francais" : "english";
	var str2 = str.replace(regX,newstring);
	//alert(str2+" "+regX+" "+newstring)
	window.location.href = str2;
}
// MENU FUNCTIONALITY
var colour = Array("#968CA7","#968CA7","#AB98B3","#AB98B3");

function findPosX(obj)
{
     var curleft = 0;
     if (obj.offsetParent)
     {
          while (obj.offsetParent)
          {
               curleft += obj.offsetLeft
               obj = obj.offsetParent;
          }
     }
     else if (obj.x)
          curleft += obj.x;
     return curleft;
}
function findPosY(obj)
{
     var curtop = 9;
     if (obj.offsetParent)
     {
          while (obj.offsetParent)
          {
               curtop += obj.offsetTop
               obj = obj.offsetParent;
          }
     }
     else if (obj.y)
          curtop += obj.y;
     return curtop;
}
function keep(layer){
	if(document.getElementById){
		var q = eval("document.getElementById('"+layer+"').style");
		q.visibility = 'visible';
	}
}
function show(obj,layer,x,y){
	if(document.getElementById){
		var q = eval("document.getElementById('"+layer+"').style");
		offset = (window.innerWidth) ? window.innerWidth : document.body.offsetWidth;
		offset = (offset > (findPosX(obj)+268)) ? x : (x*-1);
		q.left = findPosX(obj)+offset;
		q.top = findPosY(obj)+y;
		q.visibility = 'visible';
	}
}
function hideall(){
	var arr = new Array('about','aboutcw','research','resources','news');
	if(document.getElementById){
		for(i=0;i<arr.length;i++){
			temp = eval("document.getElementById('"+arr[i]+"').style");
			temp.visibility = 'hidden';
		}
	}
}
function mouseon(obj,num,path){
	if(document.getElementById){
		if(getcolour()<24){
			temp = eval("img"+num+".src");
			eval("document.getElementById('"+obj+"').style.background='url("+temp+")'");
		}else eval("document.getElementById('"+obj+"').style.backgroundColor='"+colour[num-1]+"'");
	}
}
function mouseoff(obj,num,path){
	if(document.getElementById){
		if(getcolour()<24){
			temp = eval("img"+num+".src");
			eval("document.getElementById('"+obj+"').style.background='url("+temp+")'");
		}else eval("document.getElementById('"+obj+"').style.backgroundColor='"+colour[num-1]+"'");
	}
}
function getcolour(){
    if (window.screen) return screen.colorDepth;
    else return 0;
}
