/*
function GetElementsWithClassName(elementName,className) {
	var allElements = document.getElementsByTagName(elementName);
	var elemColl = new Array();
	for (var i = 0; i< allElements.length; i++) {
  if (hasClass(allElements[i], className)) {
 	 elemColl[elemColl.length] = allElements[i];
  }
	}
	return elemColl;
}
*/

function initall(sb) {
	resolution();
	deroule2(["insa.gif","aeir.gif","rennes.gif","chimie.gif","lcl.gif","univrennes1.gif","smeba.gif","breizhloc.gif","crous.gif","gerec.gif","radiol.gif","rcr.gif"], 'logogif','imageSite/logos/',0,169,1111);
	posfooter(sb);

	/*
	document.getElementByClass('para').style.color == 'black';
	document.getElementByClass('parasi').style.color == 'black';
	document.getElementByClass('liste').style.color == 'black';
	document.getElementByClass('tlist').style.color == 'black';
	*/
}

function posfooter(bool) {
	var height = getWindowHeight() - 70;
	//if (document.getElementById('partiedroite').style.marginTop != '0px') {
	
	if (!bool) {
		height -= 150;
	}
	document.getElementById('partiecentrale').style.minHeight = height+'px';
	//alert(height);
}
function initban() {
	deroule2(["bandeau compl1.png","bandeau compl2.png"],'imgban','imageSite/',0,101,700);
}

function fade(div_id,fade) {

	if(fade == 'FadeOut') {
		$('#'+div_id).fadeOut('slow');
	}
	else {
		$('#'+div_id).fadeIn('slow');
	}
}


function mfade(div_id) {

	if(document.getElementById(div_id).style.display == 'none') {
		//$('#'+div_id).fadeIn('slow');
		fade(div_id,'FadeIn');
	}
	else {
		//$('#'+div_id).fadeOut('slow');
		fade(div_id,'FadeOut');
	}
}

function deroule(im,ident,rac) {
	if (document.getElementById(ident).src)
		deroule2(im,ident,rac,0,101,3500);
}
function deroule2(im,ident,rac,num,rot,freq) {
	//document.getElementById(ident).innerHTML = '<img src="'+rac+im[num]+'.JPG" />';
	//alert(document.getElementById(ident).src);
	document.getElementById(ident).src = rac+im[num];
	num = (num+1)%im.length; rot--;
	var var1 = im[0];
	for (var i=1 ; i<im.length ; i++) var1+='","'+im[i];
	if (rot > 0) setTimeout('deroule2(["'+var1+'"],"'+ident+'","'+rac+'",'+num+','+rot+','+freq+')',freq);
}

function resolution() {
	//resolutiont();
}
function resolutiont() {
	//var width = screen.width;
	var owidth = getWindowWidth();
	var width = owidth;
	var rwidth = 16/100*width;
	var bord = 5;
	var base = 190;
	if (width > 1280) {
		width = (width-1280)/2;
		document.getElementById('partiegauche').style.left = bord+width+'px';
		document.getElementById('partiecentrale').style.marginLeft = (bord+base+width)+'px';
		document.getElementById('partiecentrale').style.marginRight = (rwidth+width+bord)+'px';
		document.getElementById('partiedroite').style.right = bord+width+'px';
	}
	else { 
		if (document.getElementById('partiegauche').style.left != bord+'px') {
			document.getElementById('partiegauche').style.left = bord+'px';
			document.getElementById('partiecentrale').style.marginLeft = (base+bord)+'px';
			document.getElementById('partiedroite').style.right = bord+'px';
		}
		document.getElementById('partiecentrale').style.marginRight = rwidth+'px';
	}
	if (document.getElementById('imgban')) {
		if (owidth < 1050) {
			if (document.getElementById('partiedroite').style.maxWidth != '99px') {
				document.getElementById('bannierehaut').style.width = '420px';
				document.getElementById('bannierehaut').style.height = '99px';
				document.getElementById('imgban').style.maxWidth = '528px';
				document.getElementById('imgban').style.maxHeight = '99px';
				document.getElementById('partiedroite').style.top = '99px';
				document.getElementById('partiegauche').style.top = '99px';
				document.getElementById('partiecentrale').style.marginTop = '99px';
				document.getElementById('affmasban').style.top = '75px';
				document.getElementById('affmasban').style.textIndent = '355px';
			}
		}
		else if (document.getElementById('partiedroite').style.top != '') {
			document.getElementById('bannierehaut').style.width = '710px';
			document.getElementById('bannierehaut').style.height = '150px';	
			document.getElementById('imgban').style.maxWidth = '800px';
			document.getElementById('imgban').style.maxHeight = '150px';
			document.getElementById('partiedroite').style.top = '150px';
			document.getElementById('partiegauche').style.top = '150px';
			document.getElementById('partiecentrale').style.marginTop = '150px';
			document.getElementById('affmasban').style.top = '120px';
			document.getElementById('affmasban').style.textIndent = '550px';		
		}
	}
	
}

function resolutionc() {
	//var width = screen.width;
	var base = 190;
	var owidth = getWindowWidth();
	var width = owidth;
	var rwidth = 16/100*width;
	width = width - 15/100*width - 180;
	var bord = 5;
	if (width > 800) {
		width = (width-800)/2;
		document.getElementById('partiecentrale').style.marginLeft = (bord+base+width)+'px';
		document.getElementById('partiecentrale').style.marginRight = (rwidth+width+bord)+'px';
	}
	else {
		document.getElementById('partiecentrale').style.marginLeft = (base+bord)+'px';
		document.getElementById('partiecentrale').style.marginRight = rwidth+'px';
	}
	if (owidth < 1050) {
		alert('test');
		document.getElementById('imgban').style.maxWidth = '528px';
		document.getElementById('imgban').style.maxHeight = '99px';
		document.getElementById('partiedroite').style.top = '99px';
		document.getElementById('partiegauche').style.top = '99px';
		document.getElementById('partiecentrale').style.top = '99px';
	}
}

function getWindowHeight() {
    var h = 0;
    if (typeof(window.innerHeight) == 'number') { // Netscape
        h = window.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        h = document.documentElement.clientHeight;
    } else if (document.body && document.body.offsetHeight) { //client
        h = document.body.offsetHeight;
    }
    return h;
}
function getWindowWidth() {
    var w = 0;
    if (typeof(window.innerWidth) == 'number') { // Netscape
        w = window.innerWidth;
    } else if (document.documentElement && document.documentElement.clientWidth) {
        w = document.documentElement.clientWidth;
    } else if (document.body && document.body.offsetWidth) { //client
        w = document.body.offsetWidth;
    }
    return w;
}