
posi_x = 0;

var ResizeIframe = {   
  wrapperId : "tinc_content",
                             
  resize : function ( oDoc, sId ) 
  {
    try
    {
      if ( typeof oDoc == "undefined" ) return;
  
      if ( typeof sId != "undefined" ) 
      {
        var iframe = oDoc.getElementById( sId );
        var iframeDoc = iframe.contentWindow.document;
      } else {
        var iframeDoc = oDoc;
        var iframeWindow = iframeDoc.parentWindow || iframeDoc.defaultView;
        var iframe = iframeWindow.frameElement;
      }
      var wrapper = iframeDoc.getElementById( this.wrapperId );

      if ( iframeDoc.isIntegrated == true ) { return; }
      
      iframeDoc.body.style.backgroundColor = "transparent";
      iframe.allowTransparency = "true";
            
      iframeDoc.body.style.padding = "0px";
      iframeDoc.body.style.border = "none";
      
      var tabs = iframeDoc.getElementsByTagName( "table" )
      if ( tabs[0] && tabs[0].className == "dborder" )
     	{		
      	wrapper.setAttribute( "wfx:overridewidth", "true" );
      } else if ( iframeDoc.forms[0] && iframeDoc.forms[0].elements["formname"] ) 
      {
      	wrapper.setAttribute( "wfx:overridewidth", "true" );
      } 
      
      if ( window.addEventListener )
      {   
      	var gcs = iframeDoc.defaultView.getComputedStyle( iframeDoc.body, null);
        var v_margin = parseInt( gcs.getPropertyValue( "margin-top" ) ) + parseInt( gcs.getPropertyValue( "margin-bottom" ) );
        var h_margin = parseInt( gcs.getPropertyValue( "margin-left" ) ) + parseInt( gcs.getPropertyValue( "margin-right" ) );
        var wrapper_width = wrapper.offsetWidth;
        
        var flex = wrapper.getAttribute( "wfx:overridewidth" );
        if ( flex == "true" )
        {
        	wrapper.style.width = "100%";
        } else {
        	iframe.style.width = wrapper_width + h_margin + "px";
        }
        
        wrapper.style.paddingTop = "1px";
        
        height = wrapper.offsetHeight + v_margin ;
      } 
      else if ( window.attachEvent ) 
      {        
        iframeDoc.body.style.margin = "0px";
        var wrapper_width = wrapper.offsetWidth;
        
        var flex = wrapper.getAttribute( "wfx:overridewidth" );
        if ( flex == "true" )
        {
        	wrapper.style.width = "100%";
        } else {
        	iframe.style.width = wrapper_width + "px";
        }
        
        height = wrapper.offsetHeight;
      }

      if ( iframe.scrolling != "yes" ) { height += 20; }
      
      iframe.style.height = height + "px";
      iframeDoc.isIntegrated = true; 
    } catch ( ex )
    {
      return; 
    }
    
    WfxExtrasProcessor.process( oDoc, sId );
  }
}

var WfxExtrasProcessor = {
  process : function ( oDoc, sId)
  {    
    if ( typeof oDoc == "undefined" ) return;
  
    if ( typeof sId != "undefined" ) 
    {
      var iframe = oDoc.getElementById( sId );
      var iframeDoc = iframe.contentWindow.document;
    } else {
      var iframeDoc = oDoc;
      var iframeWindow = iframeDoc.parentWindow || iframeDoc.defaultView;
      var iframe = iframeWindow.frameElement;
    }
    
    var links = iframeDoc.getElementsByTagName( "a" );
    for ( var i = 0; i < links.length; i++ )
    {
      if ( links[i].href.indexOf( "/tinc" ) == -1 ) links[i].target = "_parent";
    }
    
    var inputs = iframeDoc.getElementsByTagName( "input" );
    for ( var i = 0; i < inputs.length; i++ )
    {
      var input = inputs[i];
      if ( input.getAttribute("redirection") != null && input.getAttribute("redirection") != '' ) 
        input.form.target = "_parent";
    }
  }
}
    

function entravaux()
{ 
 mafenetre =window.open("en_travaux.htm", "Travaux", "width=400,height=250,resizable=1, scrollbars=1, menubar=0, status=0, location=0, toolbar=0");
 mafenetre.focus();
}

function entravaux_DE()
{ 
 mafenetre =window.open("en_travaux_DE.htm", "Travaux", "width=400,height=350,resizable=1, scrollbars=1, menubar=0, status=0, location=0, toolbar=0");
 mafenetre.focus();
}   


function mentions()
{ 
 mafenetre =window.open("mentions.htm", "Mentions", "width=520,height=450,resizable=1, scrollbars=1, menubar=0, status=0, location=0, toolbar=0");
 mafenetre.focus();
}


function manif()
{

if (document.getElementById("manifestations").style.height > "550")
{
document.getElementById("ifr_manif").height="0"
document.getElementById("manifestations").style.height="0"
posi_x = 0;
}
else
{
posi_x = 0;
document.getElementById("ifr_manif").src="manifestations.asp";
deplace();
}
}


 function deplace()
 	{
	if(posi_x < 550)
 		{
 		posi_x += 5;
 		bouge();
 		setTimeout("deplace()", 10);
 		}	
 	}
 	
  function bouge()
 	{
 	if(document.getElementById)
 		{
 		document.getElementById("manifestations").style.height=posi_x+'px';
 		document.getElementById("ifr_manif").height=posi_x+'px';
 		}
 	}

function fermer()
{
parent.document.getElementById("ifr_manif").height="0"
parent.document.getElementById("manifestations").style.height="0"
posi_x = 0;
}
	
function vol_mouche()
{
position_x= Math.floor(Math.random() * 500)+1;
position_y= Math.floor(Math.random() * 750)+1;
document.getElementById("mouche").style.top=position_y+'px';
document.getElementById("mouche").style.left=position_x+'px';
}


function MM_swapImgRestore() 
{
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() 
{
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];}}
}

function MM_findObj(n, d) 
{
  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;
}

function MM_swapImage() 
{
  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];}
} 


function imprimer_carte_peche()
{
 mafenetre =window.open("cartepecheVI.asp", "pagemembre", "width=600, height=350, resizable=1, scrollbars=1, menubar=0, status=0, location=0, toolbar=0");
}

function imprimer_carte_pecheDE() {
    mafenetre = window.open("cartepecheVI_DE.asp", "pagemembre", "width=600, height=350, resizable=1, scrollbars=1, menubar=0, status=0, location=0, toolbar=0");
}


function print_cartepeche() {
//var url=escape('<%=request.servervariables("SCRIPT_NAME")%>');
var url= "cartepeche.asp"
var title=escape(document.title);
window.open("print.asp?art="+url+"&titre="+title,'','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,height=350,width=550');
}


function membre()
{ 
 mafenetre =window.open("gestion/membre4.asp", "Gestion", "width=370px, height=480px, resizable=1, scrollbars=1, menubar=0, status=0, location=0, toolbar=0");
 mafenetre.focus();
}


function deplacement_article()
{
document.getElementById("photo5").value=document.getElementById("photo4").value;
document.getElementById("photo4").value=document.getElementById("photo3").value;
document.getElementById("photo3").value=document.getElementById("photo2").value;
document.getElementById("photo2").value=document.getElementById("photo1").value;
document.getElementById("photo1").value="";
document.getElementById("article5a").value=document.getElementById("article4a").value;
document.getElementById("article5b").value=document.getElementById("article4b").value;
document.getElementById("article5c").value=document.getElementById("article4c").value;
document.getElementById("article4a").value=document.getElementById("article3a").value;
document.getElementById("article4b").value=document.getElementById("article3b").value;
document.getElementById("article4c").value=document.getElementById("article3c").value;
document.getElementById("article3a").value=document.getElementById("article2a").value;
document.getElementById("article3b").value=document.getElementById("article2b").value;
document.getElementById("article3c").value=document.getElementById("article2c").value;
document.getElementById("article2a").value=document.getElementById("article1a").value;
document.getElementById("article2b").value=document.getElementById("article1b").value;
document.getElementById("article2c").value=document.getElementById("article1c").value;
document.getElementById("article1a").value="";
document.getElementById("article1b").value="";
document.getElementById("article1c").value="";
}

function rechsiteweb()
{ 
 mafenetre =window.open("rechercher.htm", "Rechercher", "width=350, height=170, resizable=0, scrollbars=0, menubar=0, status=0, location=0, toolbar=0");
 mafenetre.focus();
}

function RunFlash(swf, hauteur, largeur, couleur, nom, position) {
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+largeur+"px\" height=\""+hauteur+"px\" id=\""+nom+"\" align=\""+position+"\">\n");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
	document.write("<param name=\"movie\" value=\""+swf+"\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\""+couleur+"\" /><embed src=\""+swf+"\" quality=\"high\" bgcolor=\""+couleur+"\" width=\""+largeur+"px\" height=\""+hauteur+"px\" name=\""+nom+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n");
	document.write("<param name=\"wmode\" value=\"transparent\" />\n");
	document.write("</object>\n");
}

function petitesannonces()
{ 
 mafenetre =window.open("petites_annonces.htm", "Petites_Annonces", "width=250,height="+screen.height +",resizable=1, scrollbars=0, menubar=0, status=0, location=0, toolbar=0");
 mafenetre.moveTo(0,0); 
 mafenetre.focus();
} 


function panorama_epple(I)
{ 
 mafenetre =window.open("panorama.asp?id="+I, "Panorama", "width=510,height=260,resizable=0, scrollbars=0, menubar=0, status=0, location=0, toolbar=0");
 mafenetre.focus();
}

var force=1;

function quitter_sondage()
{
document.getElementById("popupmob").style.visibility="hidden";
}


function ScanCookie(variable)
	{
	cook = document.cookie;
	variable += "=";
	place = cook.indexOf(variable,0);
	if (place <= -1)
		return("0");
	else
		{
		end = cook.indexOf(";",place)
		if (end <= -1)
			return(unescape(cook.substring(place+variable.length,cook.length)));
		else
			return(unescape(cook.substring(place+variable.length,end)));
		}
	}

function CreationCookie(nom,valeur,permanent)
	{
	if(permanent)
		{
		dateExp = new Date(2020,11,11);
		dateExp = dateExp.toGMTString();
		ifpermanent = '; expires=' + dateExp + ';';
		}
	else
		ifpermanent = '';
	document.cookie = nom + '=' + escape(valeur) + ifpermanent;
	}
	

function validation() {
    if (document.addform.Select1.value.length < 1) {
	    window.alert("Sélectionnez une catégorie !");
		return false;
	}
    if (document.addform.Text1.value.length < 1) {
	    window.alert("Veuillez saisir une ville !");
		return false;
	}
   	if (document.addform.Text2.value.length <10 ) {
	    window.alert("Veuillez saisir votre adresse E-mail !");
		return false;
	}
   	if (document.addform.Text3.value.length <10 ) {
	    window.alert("Veuillez saisir un numéro de téléphone !");
		return false;
	}
   	if (document.addform.Text4.value.length <10 ) {
	    window.alert("Veuillez saisir votre annonce (10 caractères minimum) !");
		return false;
	}
   	if (document.addform.Text6.value.length <7 ) {
	    window.alert("Veuillez saisir le code de la page !");
		return false;
	}
   	if (document.addform.Text7.value.length <1 ) {
	    window.alert("Veuillez saisir un prix de vente !");
		return false;
	}
	if (document.addform.Select2.value.length < 1) {
	    window.alert("Sélectionnez photo : oui ou non !");
		return false;
	}
	return true;
}

function retour_ligne1() 
{
document.getElementById("Text4").value = document.getElementById("Text4").value + "<br/>";
document.getElementById("Text4").focus();
}

function retour_ligne2() 
{
document.getElementById("Text5").value = document.getElementById("Text5").value + "<br/>";
document.getElementById("Text5").focus();
}

function blason() {
    document.getElementById("blason").style.visibility = "hidden";
    document.getElementById("blason1").style.visibility = "visible";
}

function fermer_pub_chron() {
    document.getElementById("pub_frame").style.visibility = "hidden";
    document.getElementById("pub_chron").style.visibility = "hidden";
    document.getElementById("fil_peche").style.visibility = "hidden";
}
