// JavaScript Document function goResa( page ) { n = window.open( page, 'reserver', 'width=800, height=600, top=0, left=0, scrollbars=1, resizable=1' ) ; n.focus() ; } function getOffsetPosition( elt, attr ) { var i = 0; var obj = document.getElementById( elt ); var s = 'obj.offset' + attr ; while (obj && obj.tagName != 'BODY') { i += eval(s); obj = obj.offsetParent ; } return i; } function $( id ) { return document.getElementById( id ) ; } eltAffiche = "" ; ////////////////////////////////////// objMessage = function ( libele, idLibele, idParent, idPhoto, idSaison, nbPhoto, textTitle ) { this.libele = libele ; this.idLibele = idLibele ; this.idParent = idParent ; this.nbPhoto = nbPhoto ; this.idPhoto = idPhoto ; this.idSaison = idSaison ; this.textTitle = textTitle ; } objMessage.prototype.creer = function() { var divTitre = document.getElementById(this.idParent) ; this.div = document.createElement ("div") ; this.div.innerHTML = this.libele ; this.div.className = "titrePhoto" ; ; this.div.setAttribute("id",this.idLibele) ; divTitre.appendChild(this.div) ; this.div.nbLien = eval ( this.nbPhoto + 1 ) ; this.div.prefixe = this.idPhoto ; this.div.saison = this.idSaison ; this.div.textCloseTitle = this.textTitle ; this.div.onmousedown = function() { var c = $('calque') ; if ( c.style.display != "block" || eltAffiche != this.id ) { c.style.display = "block" ; c.innerHTML = '' ; eltAffiche = this.id ; var d = $( this.getAttribute("id") ) ; c.style.left = eval( getOffsetPosition( d.id, 'Left') + 120 ) + 'px' ; c.style.top = eval( getOffsetPosition( d.id, 'Top') - 180 ) + 'px' ; for ( var p = 1; p < this.nbLien ; p++ ) { if ( p == 1 ) { this.photo = document.createElement('img') ; this.photo.setAttribute( "src", urlSite + "/photos/"+this.prefixe + "-" + this.saison + "-0" + p + "-290x218.jpg" ) ; this.photo.setAttribute( "id", "photo" ) ; c.appendChild( this.photo ) ; this.sep = document.createElement('br') ; c.appendChild( this.sep ) ; } this.lien = document.createElement('a') ; this.lien.setAttribute("href","javascript:changeImage("+this.prefixe+","+this.saison+","+p+");") ; this.textLien = document.createTextNode( "[" + p + "]" ) ; this.lien.appendChild( this.textLien ) ; c.appendChild( this.lien ) ; } this.lienClose = document.createElement('a') ; this.lienClose.setAttribute("href","javascript:closePhoto();") ; this.lienClose.setAttribute("title", this.textCloseTitle ) ; this.lienClose.className = "fermer" ; this.textLienClose = document.createTextNode( wordingFermer ) ; this.lienClose.appendChild ( this.textLienClose ) ; c.appendChild ( this.lienClose ) ; } else { c.style.display = "none" ; eltAffiche = '' ; c.innerHTML = '' ; } } } function changeImage( idPhoto, idSaison, nmPhoto ) { image = $( "photo" ) ; if ( nmPhoto < 10 ) nmPhoto = '0' + nmPhoto ; image.src = urlSite + "/photos/" + idPhoto + "-" + idSaison + "-" + nmPhoto + "-290x218.jpg" ; } function closePhoto() { $ ("calque").style.display = "none" ; } function masquerTout(d) { var div = document.getElementsByTagName('div') ; var lengthDiv = div.length ; for ( var i= 0; i < lengthDiv; i++ ) { if (div[i].className == 'visible' && div[i]!=document.getElementById(d) ) { div[i].className = 'invisible' ; if ( document.getElementById('titre'+div[i].id) ) document.getElementById('titre'+div[i].id).className='off pointer'; } } } function afficherDiv (d) { var exp_reg = new RegExp( "(fr|en|es|it|es|ma|tu)" , "i" ) ; if ( d.match(exp_reg) ) masquerTout(d) ; if ( document.getElementById(d).className == 'visible' ) { document.getElementById(d).className = 'invisible' ; if ( document.getElementById('titre'+d) ) document.getElementById('titre'+d).className = 'off pointer' ; } else { if ( document.getElementById('titre'+d) ) document.getElementById('titre'+d).className = 'on pointer' ; document.getElementById(d).className = 'visible'; } } // RECHERCHE // SKY skyscraper = function ( divParent , titre, remise, typo, dateSejour, page ) { this.container = $( divParent ) ; this.div = document.createElement ("div") ; this.div.page = page this.container.appendChild( this.div ) ; this.titre = titre ; this.remise = remise ; this.typo = typo ; this.dateSejour = dateSejour ; this.div.innerHTML += ''+this.titre+'
' ; this.div.innerHTML += ''+this.remise+'
' ; this.div.innerHTML += ''+this.typo+'
' ; this.div.innerHTML += ''+this.dateSejour+'
' ; this.div.onmouseover = function() { this.style.backgroundColor = '#FFC' ; } this.div.onmouseout = function() { this.style.backgroundColor = '#FFF' ; } this.div.onclick = function() { window.location.href = site + this.page ; } } // GOOGLE MAP function posMap( idLienMap ) { var divMap = $("cadreMap") ; divMap.style.display = 'block' ; divMap.style.left = eval( getOffsetPosition( idLienMap, 'Left') -2 ) + 'px' ; divMap.style.top = eval( getOffsetPosition( idLienMap, 'Top') -310 ) + 'px' ; } function eraseMap() { var divMap = $("cadreMap") ; divMap.style.display = 'none' ; } function load(la,lo,marque) { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); /*FONCTION ZOOM ET DEPLACEMENT*/ map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.addControl(new GOverviewMapControl()); /*INITIALISATION CARTE*/ map.setCenter(new GLatLng(la,lo), 12); /*ICONE*/ var tinyIcon = new GIcon(); tinyIcon.image = "ski/img/commun/marker_"+marque+".png"; tinyIcon.iconSize = new GSize(34, 34); tinyIcon.iconAnchor = new GPoint(10, 34); markerOptions = { icon:tinyIcon }; /*CREATION MARKER*/ function createMarker(ville) { var marker = new GMarker(ville,markerOptions); return marker; } // points var destination = new GLatLng(la,lo); map.addOverlay( createMarker(destination) ); } }