// JavaScript Document

//popups (0_o)/

function superPop() {
	// check to see that the browser supports the getElementsByTagName method
	// if not, exit the loop 
	if (!document.getElementsByTagName) {
		return false; 
	} 
	// create an array of objects of each link in the document 
	var popuplinks = document.getElementsByTagName("a");
	// loop through each of these links (anchor tags) 	
	for (var i=0; i < popuplinks.length; i++) {	
		// if the link has a class of "popup"...	
		if (popuplinks[i].getAttribute("class") == "popup") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			openPopUp(this.getAttribute("href"));	
			return false; 	
			} 
			
		}
		
	     if (popuplinks[i].getAttribute("class") == "popup2") {	
			// add an onclick event on the fly to pass the href attribute	
			// of the link to our second function, openPopUp 	
			popuplinks[i].onclick = function() {	
			openPopUp2(this.getAttribute("href"));	
			return false; 	
			}
		}
	}
} 

function openPopUp(linkURL) {
window.open(linkURL,'popup','width=520,height=395')
}

function openPopUp2(linkURL) {
window.open(linkURL,'popup','width=395,height=520')
}


function roll(img_name, img_src) 
{
  document[img_name].src = img_src;
}
   
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;
}

var laylervisible = "";
function setvisible(layername)
{
	if (laylervisible != "")
	{
		SetLayerDisplay(laylervisible,false);
		laylervisible = layername;
	}
	else
	{
		laylervisible = layername;
	}
	SetLayerDisplay(layername,true);
}

function SetLayerDisplay(layer,value)
{
	var divDisplay = '';
	divDisplay = MM_findObj(layer);
	if (divDisplay != '')
	{	
		if (value == 'togle')	
		{
			if (divDisplay.style.display == '')
			{
				divDisplay.style.display = 'none';
			}
			else
			{
				divDisplay.style.display = '';
			}
		}
		else
		{
			if (value == false)
			{
				divDisplay.style.display = 'none';
			}
			
			if (value == true)
			{
				divDisplay.style.display = '';
			}
		}
	}
}

// Active groupe
function infoSmenuActive(){
document.getElementById("info").style.background = "url(images/btn-smenu-information-over.png)";
}

function organisationSmenuActive(){
document.getElementById("organisation").style.background = "url(images/btn-smenu-organisation-over.png)";
}

function pedagogieSmenuActive(){
document.getElementById("pedagogie").style.background = "url(images/btn-smenu-pedagogie-over.png)";
}

function parentsSmenuActive(){
document.getElementById("parents").style.background = "url(images/btn-smenu-parents-over.png)";
}

function elevesSmenuActive(){
document.getElementById("eleves").style.background = "url(images/btn-smenu-eleves-over.png)";
}

function evenementsSmenuActive(){
document.getElementById("evenements").style.background = "url(images/btn-smenu-evenements-over.png)";
}

function anciensSmenuActive(){
document.getElementById("anciens").style.background = "url(images/btn-smenu-anciens-over.png)";
}


// Out groupe
function infoSmenuOut(){
document.getElementById("info").style.background = "url(images/btn-smenu-information.png)";
}

function organisationSmenuOut(){
document.getElementById("organisation").style.background = "url(images/btn-smenu-organisation.png)";
}

function pedagogieSmenuOut(){
document.getElementById("pedagogie").style.background = "url(images/btn-smenu-pedagogie.png)";
}

function parentsSmenuOut(){
document.getElementById("parents").style.background = "url(images/btn-smenu-parents.png)";
}

function elevesSmenuOut(){
document.getElementById("eleves").style.background = "url(images/btn-smenu-eleves.png)";
}

function evenementsSmenuOut(){
document.getElementById("evenements").style.background = "url(images/btn-smenu-evenements.png)";
}

function anciensSmenuOut(){
document.getElementById("anciens").style.background = "url(images/btn-smenu-anciens.png)";
}



function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}