var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',status=no'
win = window.open(mypage,myname,settings)
}

function hideshow(obj) { 
	if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1) {
		if (document.getElementById(obj).style.display=="none") 
			document.getElementById(obj).style.display="";
		else
			document.getElementById(obj).style.display="none";
	}
} 	

function ins(ll) {
	showcontent('li=1&c=&l='+ll, '/inscription.asp', 'inscription'); return false;
}

function enrins() {
//	if(document.frmins.prenom.value==""){document.frmins.prenom.focus();alert("Vous devez entrer votre prénom");return false;}
//	if(document.frmins.nom.value==""){document.frmins.nom.focus();alert("Vous devez entrer votre nom");return false;}
//	if(document.frmins.courriel.value==""){document.frmins.courriel.focus();alert("Vous devez entrer votre courriel");return false;}
//	ll('inscription', '/images/loader.gif')
	showcontent('li=1&c=1&prenom='+document.frmins.prenom.value+'&nom='+document.frmins.nom.value+'&courriel='+document.frmins.courriel.value+'&l='+document.frmins.l.value, '/inscription.asp', 'inscription'); return false;
}

function popuppdf(pdf) {
	w = (screen.width)*0.5;
	h = (screen.height)*0.5;
	NewWindow(pdf,"popuppdf",w,h,"yes");
	return false;
}

function popyoutube(vlink) {
	w = 510;
	h = 410;
	NewWindow("/video.asp?vl="+vlink,"youtube",w,h,"yes");
	return false;
}

function slideSwitch(did) {
	var $active = $('#'+did+' IMG.active');

	if ( $active.length == 0 ) $active = $('#'+did+' IMG:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
		: $('#'+did+' IMG:first');

	// uncomment the 3 lines below to pull the images in random order
	var $sibs  = $active.siblings();
	var rndNum = Math.floor(Math.random() * $sibs.length );
	var $next  = $( $sibs[ rndNum ] );

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}

