/* AUTEUR:Atmosphere.fr */
/* Modification=25-03-2006 */
/* version=2.4 */

// Favoris ctrld
nav=navigator.appName.substring(0,3);ver=navigator.appVersion.substring(0,1)
function addFav()
{if(nav=="Mic"&&ver>=4)
{url_site="http://www.tourisme-paysdieulefit.com";titre_site="Office de Tourisme du Pays de Dieulefit";document.write('<A HREF="#"onClick="window.external.AddFavorite(url_site,titre_site);return(false);">Ajoutez cette page aux favoris</a>')
}else
{document.write('Faites CTRL+D pour ajouter cette page &agrave; vos favoris!')
}}
//dans doc -> <SCRIPT language="JavaScript">addFav();</SCRIPT>


// Ouvir fenetre général
function openWing(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=no,width=" + w + ",height=" + h)
  newWin.focus()
}

function openWingy(url, windowname, w, h) {
  newWin=window.open(url, windowname, "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + w + ",height=" + h)
  newWin.focus()
}
// dans page  <a href="javascript:openWing('../divers/faites-conaitre-pme.htm','newWindow','260','300')">img ou txt</a>


function openWin(URL) {
aWindow=window.open(URL,"Stort_bilde","toolbar=no,width=400,status=no,scrollbars=yes,resize=yes,menubars=no");
}

// Ouvir fenetre général
function openWings(url, windowname, w, h) {
  newWin=window.open(url, windowname, "scrollbars=yes,width=" + w + ",height=" + h)
  newWin.focus()
}
// dans page  <a href="javascript:openWing('../divers/faites-conaitre-pme.htm','newWindow','260','300')">img ou txt</a>


// Fenetre
function closeWindow() {
	window.close();
}
// dans page  <a href="javascript:closeWindow()">   </a>

//image rollover

function objet() {
this.length = objet.arguments.length
for (var i = 0; i < this.length; i++) this[i+1] = objet.arguments[i]
}
var nom = new objet ("img1.jpg", "img2.jpg", "img3.jpg", "img4.jpg");
var numero = 1;

function changer() {
document.image.src = "images/"+nom[numero];
numero += 1;
if (numero == nom.length + 1) numero = 1;
setTimeout("changer()", 5000);
}

// preloadimages
var myimages=new Array()
function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}
//preloadimages("./images/img1.jpg","./images/img2.jpg","./images/img3.jpg","./images/img4.jpg");
preloadimages("images/img1.jpg","images/img2.jpg","images/img3.jpg","images/img4.jpg");

// <body onload="preloadimages()">  onLoad="changer();preloadimages()">


function sp_open_window(name, url, width, height, scrollbar, resizable, left, top, toolbar, menubar, statusbar)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  
  window.open(url,name,'width='+width+',height='+height+',scrollbars='+scrollbar_str+',resizable='+resizable_str+',left='+left+',top='+top+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str);
}

function na_open_window(name, url, width, height, scrollbar, resizable, left, top, toolbar, menubar, statusbar)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  //window.open(url,name,'width='+width+',height='+height+',left='+left+',top='+top+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
  window.open(url,name,'width='+width+',height='+height+',scrollbars='+scrollbar_str+',resizable='+resizable_str+',left='+left+',top='+top+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str);
}

var fois=0
function AfficheImage(petiteImage,grandeImage,texteImage)
{
document.write('<A HREF="javascript:Affichegrande(\''+grandeImage+'\',\''+texteImage+'\')"><IMG SRC="'+petiteImage+'" HSPACE=0 VSPACE=0 BORDER=0 align=middle ALT="cliquez ici pour afficher en grand"></A>');
} 
function Affichegrande(cheminImage,texte)
{
newImage = new Image;
newImage.src = cheminImage;
html = '<a href="#" onClick="window.close()"><IMG SRC="'+cheminImage+'" BORDER=0 NAME=monImage alt="'+texte+'"border="0" onLoad="window.resizeTo(document.monImage.width+40,document.monImage.height+80); window.moveTo((screen.width-document.monImage.width)/4,5)"> </a>';
if (fois == 1 ) ouvrirImage.close();
ouvrirImage = window.open('','_blank','toolbar=0,location=0,menuBar=0,scrollbars=0,resizable=0');
ouvrirImage.document.write(html);
fois=1;
}