function createXmlHttp()
{
    if (window.XMLHttpRequest) 
	{             // Mozilla, Firefox, Safari, IE7
        return new XMLHttpRequest();
    } 
	else if (window.ActiveXObject) 
	{       // IE5, IE6
        try {
            return new ActiveXObject("Msxml2.XMLHTTP");    // MSXML3
        } catch(e) {
            return new ActiveXObject("Microsoft.XMLHTTP"); // MSXML2
        }
    } else 
	{
        return null;
    }
}

 function getPath(type)
  {
	if (document.getElementById(type).innerHTML!='')
		{document.getElementById(type).innerHTML='';}
	else
		{
		XMLHttpRequestObject= new createXmlHttp();
		XMLHttpRequestObject.open("GET","http://www.reseaulycee.com/path_cours.php",false);
		XMLHttpRequestObject.send(null); 
		
			
		items=XMLHttpRequestObject.responseText;
			
		document.getElementById(type).innerHTML=items;
			
		}
	}

function setCookie(name, value, expires, path, domain) 
{ document.cookie = name + "=" + escape(value) + 
  ((expires == 0) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null)    ? "" : "; path=" + path) +
  ((domain == null)  ? "" : "; domain=" + domain);
}
function getCookie(name)
{ var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) 
  { begin = dc.indexOf(cname);       
    if (begin != -1) 
    { begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
      return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}

function show_blogwatch()
{
	var blogwatch=document.getElementById('blogwatch');
	var mygroups=document.getElementById('mygroups');
	var connected=document.getElementById('connected');
	var blogwatch_tab=document.getElementById('blogwatch_tab');
	var mygroups_tab=document.getElementById('mygroups_tab');
	var connected_tab=document.getElementById('connected_tab');
	blogwatch.style.display="block" ;
	mygroups.style.display="none" ;
	connected.style.display="none" ;
	blogwatch_tab.style.backgroundImage="url(/images/tab_blogwatch.gif)";
	mygroups_tab.style.backgroundImage="url(/images/tab_mygroups_off.gif)";
	connected_tab.style.backgroundImage="url(/images/tab_online_off.gif)";
	setCookie('tab','blogwatch',0,'/','reseaucampus.com');
}

function show_mygroups()
{
	var blogwatch=document.getElementById('blogwatch');
	var mygroups=document.getElementById('mygroups');
	var connected=document.getElementById('connected');
	var blogwatch_tab=document.getElementById('blogwatch_tab');
	var mygroups_tab=document.getElementById('mygroups_tab');
	var connected_tab=document.getElementById('connected_tab');
	blogwatch.style.display="none" ;
	mygroups.style.display="block" ;
	connected.style.display="none" ;
	blogwatch_tab.style.backgroundImage="url(/images/tab_blogwatch_off.gif)";
	mygroups_tab.style.backgroundImage="url(/images/tab_mygroups.gif)";
	connected_tab.style.backgroundImage="url(/images/tab_online_off.gif)";
	setCookie('tab','mygroups',0,'/','reseaucampus.com');
}  

function show_connected()
{
	var blogwatch=document.getElementById('blogwatch');
	var mygroups=document.getElementById('mygroups');
	var connected=document.getElementById('connected');
	var blogwatch_tab=document.getElementById('blogwatch_tab');
	var mygroups_tab=document.getElementById('mygroups_tab');
	var connected_tab=document.getElementById('connected_tab');
	blogwatch.style.display="none" ;
	mygroups.style.display="none" ;
	connected.style.display="block" ;
	blogwatch_tab.style.backgroundImage="url(/images/tab_blogwatch_off.gif)";
	mygroups_tab.style.backgroundImage="url(/images/tab_mygroups_off.gif)";
	connected_tab.style.backgroundImage="url(/images/tab_online.gif)";
	setCookie('tab','connected',0,'/','reseaucampus.com');
}  
     
function hideshow(which)
{
	if (!document.getElementById) return ;

	var lcl_which = document.getElementById(which);
	if (lcl_which.style.display!="block") lcl_which.style.display="block" ;
	else lcl_which.style.display="none" ;
}

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 statusText(objName,x,newText)
{ //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function makeCheck(form, el,check) 
{ 
	for (i = 0; i <= form.elements.length; i++) 
	{
    try{
      if(form.elements[i].name == el) {
        form.elements[i].checked = check;
      }
    } catch(er) {}
  }
} 

