function recup_reso(wh) {	
	var wh; var reso;
	if (wh == 'w') reso = (window.screen.availWidth ? window.screen.availWidth : (screen.width ? screen.width : 1016));
	else if (wh == 'h') reso = (window.screen.availHeight ? window.screen.availHeight : (screen.height ? screen.height : 714));
	return reso;
}

function popup(URL,title,W,H) {
	var URL; var title; var W; var H; var left; var top; var scrollbar; var menubar; var full=false;
	var isIE = (navigator.appName.indexOf("Microsoft Internet Explorer")!=-1 && navigator.platform.indexOf("Win")!=-1);
	if(!W || !H) {
			W = recup_reso('w');
			H = recup_reso('h');
			left='0'; top='0';
			scrollbars='no'; menubar='no'; full=true;
	}else if (W && H){ 
			left = (recup_reso('w')>W) ? (recup_reso('w')-W)/2 : 0;
			top = (recup_reso('h')>H) ? (recup_reso('h')-H)/2 : 0;
			scrollbars='yes'; menubar='yes';
	}				
	var attr='width='+W+',height='+H+',left='+left+'top='+top+',scrollbars='+scrollbars+',menubar='+menubar; 
	attr+='titlebar=no,toolbar=no,location=no,directories=no,statut=no,resizable=yes';
	var win = window.open(URL,title,attr);
	if (full && isIE){ win.moveTo(0,0); win.resizeTo(screen.width,screen.height); }
	win.focus();
}

function adobe_popup() {
	var URL='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash';
	var W='760'; var H='570';
	popup(URL,'',W,H);
}

function full_screen(URL,title) {
		var URL = URL +'?fv_full=1'; var title;
		popup(URL,title);
}

function changeBg(color) {
	var color;
	$('#doc').css('backgroundColor',color);
}

function h_browser() {
	var h;
	if (typeof(window.innerHeight) == 'number') h = window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight) h = document.documentElement.clientHeight;
	else if (document.body) h = document.body.clientHeight;
	h = (isNaN(h)) ? "580" : h;
	return h;
}

function vcenter(div_id) {
	var heightBrowser = h_browser();
//	var h_div = isNaN(parseFloat(heightDiv, 10)) ? h : (parseFloat(heightDiv, 10));
//	var unit = heightDiv.slice(-2);
	var heightDiv = $('#'+div_id).height();
	var h_div = isNaN(heightDiv) ? 570 : heightDiv;
	var marge = (heightBrowser >= h_div) ? (Math.round((heightBrowser-h_div) * 0.5)) : 20;
//	$('#'+div_id).css('marginTop', marge + 'px');
	$('#'+div_id).animate({ marginTop:marge+'px' }, "slow");
}

function favoris() {
  if ( navigator.appName != 'Microsoft Internet Explorer' ){
    window.sidebar.addPanel("No[mad]","http://www.no-mad-online.com","");
  }else{
    window.external.AddFavorite("http://www.no-mad-online.com", "No[mad]");
  }
}

