function spopup(id){
	cat='cat_'+id;
	popup(cat,cat,correct_coord('y'),correct_coord('x'));
}
function gpopup(url){
	window.open(url,'_blank');
	return false;
}

function doc(a){
	return document.getElementById(a);
}


/**
Corrige le menu sous Netscape
**/
function correct_coord(type) {
	var x_correct;
	var y_correct;

	if(navigator.appName == "Netscape" ) {
		x_correct = -1;
		y_correct = -7;
	}else{
		x_correct = -1;
		y_correct = -7;
	}
	if(type == "x") {
		return x_correct;
	} else return y_correct;
}

/**
Ouvre un popup
**/
var popup_list = new Array();

function open_popup(p_name){
	var hauteur = popup_list[p_name][1];
	var largeur = popup_list[p_name][2];
	var page = popup_list[p_name][0];
	var options = "toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, copyhistory=no";
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"self","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

popup_list['cg'] = new Array('/Site/cg',550,776);
popup_list['cgp'] = new Array('/Site/cgp',550,776);
popup_list['login'] = new Array('/Connect/login',690,950);
popup_list['site'] = new Array('/Site/accueil',690,950);
popup_list['mdp'] = new Array('/Site/motdepasse',690,950);
popup_list['oubli_mdp'] = new Array('/Connect/oubli_mdp',360,400);

/**
Popup partenaires :
**/

function open_partpop(num){
	params = "width=870,height=570,menubar=no,left=" + ((screen.width - 900)/2) + ",top=" + ((screen.height - 550)/2);
	window.open('../nexity_partenaires/?programme='+num,'_blank',params);
}

function open_guide(){
	window.open('http://guide.nexity-logement.com','_blank');
}
	
/**
Affichage dynamique de l'heure :
**/

function heure() {
	var Maintenant = new Date();
	var fuseau = Maintenant.getTimezoneOffset();
	var heures = Maintenant.getHours();
	var minutes = Maintenant.getMinutes();
	var secondes = Maintenant.getSeconds();
	heures = heures + (fuseau/60)+1;
	//heure été
	var annee = Maintenant.getFullYear();
	for (i=31; i >24; i--) {
		dimanche = new Date(annee, 2, i);
		if (dimanche.getDay()==0) break;
	}
	for (i=31; i >24; i--) {
		dimanche2 = new Date(annee, 9, i);
		if (dimanche2.getDay()==0) break;
	}
	if (Maintenant >= dimanche && Maintenant < dimanche2) heures = heures + 1;
	//heure été
	heures = ((heures < 10) ? " 0" : " ") + heures;
	minutes = ((minutes < 10) ? ":0" : ":") + minutes;
	secondes = ((secondes < 10) ? ":0" : ":") + secondes;
	//document.formhorloge.horloge.value = heures + minutes + secondes;
	document.getElementById('heure').innerHTML = heures + minutes;
	setTimeout("heure()",60000);
}