﻿/* PNG transparency, fix for IE6
****************************************************************************************************/

function IE_CorrectAlpha_PNG(){
  for (i=0; i<document.images.length; i++){
    img = document.images[i];
	
	imgServer = img.src.substring(7, 26);
	if (imgServer == "www.marie-osteo.com") {
	
	  imgExt = img.src.substring(img.src.length-3, img.src.length);
	  imgExt = imgExt.toUpperCase();
	  if (imgExt == "PNG") {
	    imgId = (img.id) ? "id='" + img.id + "' " : "";
	    imgClass= (img.className) ? "class='" + img.className + "' " : "";
	    imgTitle= (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
	    imgStyle= "display:inline-block;" + img.style.cssText;
	    if (img.align == "left") { 
	      imgStyle = "float:left;"  + imgStyle; 
	    } else if (img.align == "right") {
	      imgStyle = "float:right;" + imgStyle;
	    }
	    if (img.parentElement.href) {
	      imgStyle = "cursor:hand;" + imgStyle;
	    }
	    strNewHTML = '<span '+imgId+imgClass+imgTitle+' style="width:'+img.width+'px; height:'+img.height+'px;'+imgStyle+';'+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+img.src+'\', sizingMethod=\'image\');"></span>';
	    img.outerHTML = strNewHTML;
	    i = i-1;
	  }
	}
  }
}

  var userAgent=navigator.userAgent;
  if (userAgent.indexOf('MSIE') != -1) {
    window.attachEvent("onload", IE_CorrectAlpha_PNG);
  }

/* Date and time
****************************************************************************************************/

function dateDisplay() {

  day = new Date;
  
  dayName = day.getDay(); // Number of the day in the week
  dayNumber = day.getDate(); // Number of the day in the month
  dayMonth = day.getMonth(); // Number of the month in the year
  dayYear = day.getFullYear(); // Number of the year

  dayNameArea = new Array('Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi');
  dayMonthArea = new Array('janvier','février','mars','avril','mai','juin','juillet','août','septembre','octobre','novembre','décembre');
  
  document.write(dayNameArea[dayName] + ' ' + dayNumber + ' ' + dayMonthArea[dayMonth] + ' ' + dayYear);
}

function timeDisplay() {

  day = new Date();

  dayHour = day.getHours(); // Number of the hour in the day
  if (dayHour < 10) {
	  dayHour = '0' + dayHour;
  }

  dayMinute = day.getMinutes(); // Number of the minute in the hour
  if (dayMinute < 10) {
	  dayMinute = '0' + dayMinute;
  } 

  daySecond = day.getSeconds(); // Number of the second in the minute
  if (daySecond < 10) {
	  daySecond = '0' + daySecond;
  }

  // Display of time in element time
  document.getElementById('time').innerHTML = dayHour + ':' + dayMinute + ':' + daySecond;

  // Refresh of the page for a dynamic display
  window.setTimeout('timeDisplay()', 1000);
}

/* Zebra table
****************************************************************************************************/

function stripe(tableId) {
  
  // Variable
    var even = false;
}

/* Google Maps
****************************************************************************************************/

//<![CDATA[
var map = null;
var geocoder = null;

function load() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
	map.enableDoubleClickZoom();
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
	//map.addControl(new GOverviewMapControl());
    geocoder = new GClientGeocoder();
  }
} //]]>
  
function showAddress(address) {
  if (geocoder) {
    geocoder.getLatLng(
      address,
      function(point) {
        if (!point) {
          alert("L'adresse " + address + " n'a pas été trouvée.");
        }
		else {
          map.setCenter(point, 16);
          var marker = new GMarker(point);
          map.addOverlay(marker);
          //marker.openInfoWindowHtml(address);
        }
      }
    );
  }
}

function showAddressPerso() {
  var point = new GLatLng(44.544555,6.063636);
  var marker = new GMarker(point);
  map.setCenter(point, 16);
  map.addOverlay(marker);
}
