var addthis_config = {
     ui_language: "fr"
     }


function popup_map( url ) {
 window.open (url, '', config='height=550, width=830, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no,,directories=no, status=no');
}
function txtHideDefault(txt){
	if( txt.value==txt.defaultValue )
		txt.value = '';
}
function txtRestoreDefault(txt){
	if( txt.value=='' )
		txt.value = txt.defaultValue;
}
function addToFavorite(){
	window.external.addFavorite( window.location.href, window.document.title );
	return false;
}
function favLink(){
	try{
		if( window.external && document.all ){
			document.write( '<a href="' + window.location.href + '" onclick="return addToFavorite()">Ajouter &agrave; mes Favoris</a>' );
		}else if( window.opera )
			document.write( '<a href="' + window.location.href + '" rel="sidebar">Ajouter &agrave; mes Favoris</a>' );
	}catch( e ){
		;
	}
}
function openMap(){
	window.open( 'http://www.lacharente.com/layout/set/popupcarte', 'map', 'width=833,height=550,scrollbars=no,dependent=yes,resizable=no,alwaysRaised=yes,menubar=no,status=no' );
	return false;
}

function viewImage( href ){
	var win = window.open( href, 'imageref', 'width=850,height=652,resizable=no,menubar=no,dependent=yes,menubar=yes,left=100,top=100,scrollbars=yes,alwaysRaised=yes' );
	win.focus();
	return false;
}

function viewDiaporama( href ) {
	var win = window.open( href, 'imageref', 'width=650,height=452,resizable=no,menubar=no,dependent=yes,menubar=yes,left=100,top=100,scrollbars=yes,alwaysRaised=yes' );
	win.focus();
	return false;

}


var winhelp = false;
function openHelp(lnk){
	var href = lnk.href.replace( /^http:\/\/[^\/]+/, '' );
	winhelp = window.open( '/layout/set/popup' + href, 'help', 'width=375,height=425,scrollbars=auto,dependent=yes,resizable=true,alwaysRaised=yes' );
	winhelp.focus();
	return false;
}

var winpopup = false;
function openPopup(lnk,width,height){
	width = width ? width : 475;
	height = height ? height : 450;
	var href = lnk.href.replace( /^http:\/\/[^\/]+/, '' );
	winpopup = window.open( '/layout/set/popup' + href, 'popup', 'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=auto,dependent=yes,alwaysRaised=yes' );
	winpopup.focus();
	return false;
}

var winpop = false;
function openPop(lnk){
	var href = lnk.href;
	winpop = window.open(href, 'help', 'width=375,height=425,scrollbars=auto,dependent=yes,resizable=true,alwaysRaised=yes' );
	winpop.focus();
	return false;
}




function openAvis(){
	var win = window.open( 'about:blank', 'avis', 'width=525,height=450,resizable=yes,scrollbars=auto,dependent=yes,alwaysRaised=yes' );
	win.focus();
	return false;
}

// Macromedia
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

// Macromedia
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Macromedia
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

// Macromedia
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
