onerror = report;   
function report(message,url,line) {
$("ErreurMsg").set("html",message + " à la ligne " + line + " --> " + url);
return false;
}
var isMobile = navigator.userAgent.match(/(pre\/|palm os|Android|iPad|iPod|iPhone|Opera mini|blackberry|palm|hiptop|avantgo|plucker|xiino|blazer|elaine|iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)/i) != null; 
window.onscroll = GSl;
window.onresize = GSl;
window.onload = GSl;

/*utilisation en top document seulement*/
if(parent.frames.length > 0){window.top.location.href = location.href;} // interdit l'affichage en frame
function goto(UrlStr){top.location.href=UrlStr;}
/*Homogénise les 3 colonnes*/
ChienChiot_Ajuste_3_Colonnes={'Lance':function Ajuste_3_Colonnes(){
if($$('.lv_content')){
				P7_equalCols2(0,'col_GAUCHE','div','col_DROITE','div','col_CENTRE','div');
}}};

/*Sélectionne le lien en cours*/
ChienChiot_SelectCourant={'Lance':function SelectCourant(LinkName,ENCRE){
if($$('.letters')){
				$$('.letters').each(function(item){
					
					item.getElements('a').each(function(item2){
						if(item2.get('href')==LinkName+'#'+ENCRE || item2.get('href')==LinkName+'/#'+ENCRE){item2.set('class', 'SelectLink');}
						})
					})
}}};


   function isValidDate(el) {
        if (!el.value.test(/(?:(0[1-9])|([1-3][0-9]))\/(?:(0[1-9])|(1[0-2]))\/(?:19|20\d{2})/)) {
        	el.errors.push("Le format DATE doit être de type : 01/09/2011"); 
					return false;
				} else {
					return true;
				}
			}



/*SousMenu*/
ChienChiot_SousMenu={'Lance':function SousMenu(){
	var IDcatOnglet;
	if(catOnglet.length==0){catOnglet=0}
	IDcatOnglet=catOnglet.toInt();
if($$('.Ong_SousMenu')){
				var ObjMnx 
				if($('ong'+IDcatOnglet+'_sm')){
				ObjMnx = $('ong'+IDcatOnglet+'_sm');
				ObjMnx.setStyle('display', 'block');
				ObjMnx.setStyle('visibility', 'visible');
				}
				if($('ong0')){
				ObjMnx = $('ong0');ObjMnx.set('html', '<div><a href="/"><span class="OngGau" ><span>Accueil</span></span></a></div>');
				}
				if($('ong'+IDcatOnglet)){
				ObjMnx = $('ong'+IDcatOnglet);
				ObjMnx.getElement('.OngGau').setStyle('backgroundImage',"url('/images/Onglets/Droi_OV.gif')");
				ObjMnx.getElement('.OngGau').getElement('span').setStyle('color',"#fff");
				ObjMnx.getElement('a').setStyle('backgroundImage',"url('/images/Onglets/Gau_OV.gif')");
			}
				if($('ongMember')){
				ObjMnx = $('ongMember');
				ObjMnx.getElement('.OngGau').setStyle('backgroundImage',"url('/images/Onglets/DroiV.gif')");
				ObjMnx.getElement('.OngGau').getElement('span').setStyle('color',"#296617");
				ObjMnx.getElement('a').setStyle('backgroundImage',"url('/images/Onglets/GauV.gif')");
			}
}}};


/*notes*/
Chien_Race_Notes={'Lance':function PlaceNotes(){
	for(i=1;i<4;i++){
			if($$('.notation'+i)){
				$$('.notation'+i).each(function(item){
					var IdDiv = item.get('id');
					var NoteSur10 = eval('note_'+IdDiv);
					$(IdDiv).set('tween', {duration:1000});/*transition largeur*/
					$(IdDiv).tween('width',largeurnote*NoteSur10/10);
					$(IdDiv).get('tween').removeEvents();/*necessaire certains browsers ?*/
					})
				}
	}
	if($$('.notation0')){$$('.notation0').each(function(item){item.getParent('.note').getParent('.Titre_note').setStyle('display', 'none').setStyle('visibility', 'hidden')})}
	}}
		
/*SELECT*/
ChienChiot_SelList={'Lance':function SelList(){
if($$('.SelList')){
				/*Au document lu*/
				/*Scan les select dans la page class=SelList*/
				var myElements = $(document.body).getElements('.SelList');
				for(NbElement=0;NbElement<myElements.length;NbElement++){
					AllItms = myElements[NbElement].getElement('ul').getElements('li');
					NbItms = AllItms.length;
					var priseHtml='';
					/*Si sélection*/
					for(i=0;i<AllItms.length;i++){
					if(AllItms[i].get('class')=='cl_selected'){
						if(AllItms[i].get('class')=='cl_selected'){priseHtml=AllItms[i].getElement('a').get('html')}}
					}
					if(NbItms>0){	
						
						/*Remplissage de chaque label de select avec l'item No1 si pas de sélection*/
						if(priseHtml==''){if(AllItms[0].getElement('a')){priseHtml=AllItms[0].getElement('a').get('html')}else{priseHtml=AllItms[0].get('html')}}

						var Textlist = myElements[NbElement].get('html');	myElements[NbElement].getElement('.It_text').set('html', priseHtml )
						/*Créé une variable hidden pour les formulaires*/
						IDhidden = myElements[NbElement].getElement('.All_Items').get('id')/*ID de All_Items*/
						new Element('input',{type:'hidden',id:''+IDhidden,name:''+IDhidden,value:''}).inject(myElements[NbElement]);
						}
					}
					
				/*au click d'un select*/
				function closeIt(Objx){Objx.setStyle('height','0px');Objx.setStyle('display', 'none');Objx.setStyle('visibility', 'hidden');Objx.scrollTo(0,0);}
				function OpenIt(Objx){Objx.setStyle('height','0px');Objx.setStyle('display', 'block');Objx.setStyle('visibility', 'visible');Objx.scrollTo(0,0);}
				$$('.SelList').addEvent('click',
				 function(e){
				 	/*masque les selects en suspend - fermeture immédiate sans tween*/
				 	closeIt( $$('.All_Items'))
					/*ouvre le select en cours*/
					Allitms = this.getElement('ul').getElements('li');	
					Countitms = Allitms.length;if(Countitms>18){Countitms=18;} /*liste maxi 18 lignes hors scroll*/
					heightCombo = (Countitms) * this.getElement('ul').getStyle('line-height').toInt();/*hauteur de liste définit en line-height sur la class <ul... */
					OpenIt(this.getElement('.All_Items'))/*affiche*/
					this.getElement('.All_Items').set('tween', {duration:250});/*transition hauteur*/
					this.getElement('.All_Items').tween('height',heightCombo);
					this.getElement('.All_Items').get('tween').removeEvents();/*necessaire certains browsers ?*/
					/*fermeture en sortie de survol */
					this.getElement('.All_Items').addEvent('mouseleave',function(e){
																				 closeIt( this)
																					 }.bind(this.getElement('.All_Items')));

					});
					/*Affiche contenu balise <a au click  ... 100 sous de +*/
				 	$$('.All_Items').getElement('ul').getElements('li').each(function(item){
					item.addEvent('click', function(e){
						if(!this.getElement('a')){e.stop();return;}/*pas de lien, on quitte*/
						statt=this.getElement('a').get('html');
						hreft=this.getElement('a').get('href');
						closeIt($$('.All_Items'))
						/*et place la valeur de l'attribut name (si existe) du lien en valeur dans l'hidden créé*/
						if(this.getElement('a').get('name')){
															IDhidden = this.getParent('.SelList').getElement('.All_Items').get('id');/*ID de All_Items*/
															valeurSelect = this.getElement('a').get('name');/*valeur name de <a*/
															this.getParent('.SelList').getElement('input').set('value',valeurSelect)
						}
						this.getParent('.SelList').getElement('.It_text').set('html',statt)
						window.location=hreft;
						e.stop();
					});
					});						
}/*fin if($$('.SelList'))*/		
}};

// GOOGLE ADSENSE
var Entete;
var GGTop; 
  function google_ad_request_done(google_ads) {
    var GGAdCount;if (google_ads.length == 0) {return;}
    GGTop= '';
    Entete ='<div class="GGEntete"><a href="' + google_info.feedback_url + '">Annonces Google</a></div>';
if (google_ads[0].type == "image") {
		        GGTop +='<div class=GGAd_Div onclick="javascript:top.location.href=\'' + google_ads[0].url  + '\'"  style="padding:5px;" ';
		        GGTop +=' onmouseover="this.style.backgroundColor=\'#FEFC14\';" onmouseout="this.style.backgroundColor=\'#FFFFFF\';"';
		        GGTop +='>';
		        GGTop +='<img style="border:none;" src="' + google_ads[0].image_url + '" width="' + google_ads[0].image_width + '" height = "' + google_ads[0].image_height + '"/>';
		        GGTop +='</div>';
    } else {
     if (google_ads.length == 1) {
				GGAdCount=0;
		        GGTop +='<div class=GGAd_Div onclick="javascript:top.location.href=\'' + google_ads[GGAdCount].url  + '\'" ';
		        GGTop +=' onmouseover="this.style.backgroundColor=\'#FEFC14\';" onmouseout="this.style.backgroundColor=\'#FFFFFF\';"';
		        GGTop +='>';
		        GGTop +='<div class=GGAd1_L0>' + google_ads[GGAdCount].line1 + '</div>';
		        GGTop +='<div class=GGAd_L1> ' + google_ads[GGAdCount].line2 + ' </div>';
		        GGTop +='<div class=GGAd_L2> ' + google_ads[GGAdCount].line3 + ' </div>';
		        GGTop +='<div class=GGAd_L3> - ' + google_ads[GGAdCount].visible_url + '</div>';
		        GGTop +='</div>';
      } else if (google_ads.length > 1) {
        /*
         * Dans le cadre des annonces textuelles, ajoutez chaque annonce à la chaîne.
         */
        for(GGAdCount=0; GGAdCount < google_ads.length; ++GGAdCount) {
		        GGTop +='<div class=GGAd_Div onclick="javascript:top.location.href=\'' + google_ads[GGAdCount].url  + '\'" ';
		        GGTop +=' onmouseover="this.style.backgroundColor=\'#FEFC14\';" onmouseout="this.style.backgroundColor=\'#FFFFFF\';"';
		        GGTop +='>';
		        GGTop +='<div class=GGAd_L0>' + google_ads[GGAdCount].line1 + '</div>';
		        GGTop +='<div class=GGAd_L1> ' + google_ads[GGAdCount].line2 + ' </div>';
		        GGTop +='<div class=GGAd_L2> ' + google_ads[GGAdCount].line3 + ' </div>';
		        GGTop +='<div class=GGAd_L3> - ' + google_ads[GGAdCount].visible_url + '</div>';
		        GGTop +='</div>';
        }
      }
    }
    return;
  }
  
/* 
  ------------------------------------------------
  PVII Equal CSS Columns scripts -Version 2
  Copyright (c) 2005 Project Seven Development
  www.projectseven.com
  Version: 2.1.0
  ------------------------------------------------
*/
function P7_colH2(){ //v2.1.0 by PVII-www.projectseven.com
 var i,oh,h=0,tg,el,np,dA=document.p7eqc,an=document.p7eqa;if(dA&&dA.length){
 for(i=1;i<dA.length;i+=2){dA[i+1].style.paddingBottom='';}for(i=1;i<dA.length;i+=2){
 oh=dA[i].offsetHeight;h=(oh>h)?oh:h;}for(i=1;i<dA.length;i+=2){oh=dA[i].offsetHeight;
 if(oh<h){np=h-oh;if(!an&&dA[0]==1){P7_eqA2(dA[i+1].id,0,np);}else{
 dA[i+1].style.paddingBottom=np+"px";}}}document.p7eqa=1;
 document.p7eqth=document.body.offsetHeight;
 document.p7eqtw=document.body.offsetWidth;}
}
function P7_eqT2(){ //v2.1.0 by PVII-www.projectseven.com
 if(document.p7eqth!=document.body.offsetHeight||document.p7eqtw!=document.body.offsetWidth){P7_colH2();}
}
function P7_equalCols2(){ //v2.1.0 by PVII-www.projectseven.com
 var c,e,el;if(document.getElementById){document.p7eqc=new Array();
 document.p7eqc[0]=arguments[0];for(i=1;i<arguments.length;i+=2){el=null;
 c=document.getElementById(arguments[i]);if(c){e=c.getElementsByTagName(arguments[i+1]);
 if(e){el=e[e.length-1];if(!el.id){el.id="p7eq"+i;}}}if(c&&el){
 document.p7eqc[document.p7eqc.length]=c;document.p7eqc[document.p7eqc.length]=el}}
 setInterval("P7_eqT2()",10);}
}
function P7_eqA2(el,p,pt){ //v2.1.0 by PVII-www.projectseven.com
 var sp=10,inc=20,g=document.getElementById(el);np=(p>=pt)?pt:p;
 g.style.paddingBottom=np+"px";if(np<pt){np+=inc;
 setTimeout("P7_eqA2('"+el+"',"+np+","+pt+")",sp);}
}



/*SCROLL
Ce script a été réalisé en interne et on ne souhaite pas le voir partout.
Vous aussi inventez votre affichage.
*/
function  parseint_(ch){var i;i=parseInt(ch);if(isNaN(i))	return 0;else		return i;}
function getScrollXY(){return [ window.getScroll().x, window.getScroll().y ];}
function  GSl(){
var GSl_hw=window.getScrollSize().y; // hauteur zone totale
var GSl_he=window.getSize().y; // hauteur zone visible
var GSl_le=window.getSize().x; // largeur zone visible

whatType=typeof document.body.style.maxHeight
var HautBase=220;var i; var NewTop=0;
for(i=1;i<=2;i++){
	$tmp=getScrollXY();sL=$tmp[0];sT=$tmp[1];
	if(  elem=$("pub"+i)  ){
	t=parseint_(elem.getStyle("top"));
	h=parseint_(elem.getSize().y);
	if (whatType != "undefined" && t!=0 &&sT>HautBase) {elem.setStyle("position","fixed");} //Corrige top de la pub si scroll onload sous ie
			if(elem.get("class")=="pubTop"){
											if (whatType != "undefined") {// IE 7, mozilla, safari, opera 9
												if(isMobile ){
																			elem.setStyles({position: "absolute",bottom: "auto"});
																			if (sT>HautBase){elem.setStyle("top",(sT - HautBase) + "px");}
																											else{elem.setStyle("top",(0) + "px");}
													}else{
											   				if(sL>0){elem.setStyle("margin-left","-"+sL);}else{elem.setStyle("margin-left","0");}
											  					if(sT<=HautBase){
																	NewTop=HautBase-sT;
																	elem.setStyle("top",NewTop);
																	}
																	if(sT>=HautBase){
																		sT=sT-HautBase;
																		ratioScroll = sT/(GSl_hw-GSl_he-HautBase);
																		sTP = ((h-GSl_he) * ratioScroll ) ;
																		if(sTP>0)NewTop=0-sTP;
																		elem.setStyle("top",NewTop);
																	}
												}

											} else {// IE6, et versions antérieures

											  
											  					elem.setStyle("position","absolute");
											  					
											  					if(sT>=HautBase){
																	NewTop=sT-HautBase;
																	elem.setStyle("top",NewTop);
																	}


											}

						
					}
			}
			
			
			}
			
			}

function Shw(Obj){
	Obj.setStyle('display','block');Obj.setStyle('visibility','visible');
	}
function Hide(Obj){
	Obj.setStyle('display','none');Obj.setStyle('visibility','hidden');
	}




function QueDigit(field){var regex = /^[0-9]*$/; if (!regex.test(field.value)){field.value = field.value.replace(/[^0-9]/g,""); }}
function QueDouble(field){var regex = /^[0-9]*$/; if (!regex.test(field.value)){field.value = field.value.replace(/[\,\.]+/g,".").replace(/[^0-9\.]/g,""); }}

function QueDigitStr(Str){return Str.replace(/[^0-9\(\)\+]/g,"");}
function QueDigitTel(field){var regex = /^[0-9\(\)\+]*$/; if (!regex.test(field.value)){field.value = field.value.replace(/[^0-9\(\)\+]/g,""); }}

function StartUpload(){$('fileInput').addEvent('change',function(e){$('x_legende').focus();})}
function FocusLegende(){$('x_legende').focus();}
function soumettreimage(){
	
	
	$('attente').set('html','&nbsp;<img src=\'/images/att.gif\' align=\'middle\' />&nbsp;Patientez...');$('UploadImage').submit();
}

var vartTOPup=String.fromCharCode(60)+'a hr'+'ef="#" on'+'click="javas'+'cript:setTimeout(scrollTo, 0, 0, 36) ;" '+String.fromCharCode(62)+String.fromCharCode(60)+'img src="/images/top.gif" alt="top" /'+String.fromCharCode(62)+' Haut de page'+String.fromCharCode(60)+'/a'+String.fromCharCode(62);
var varhomeimg=String.fromCharCode(60)+'im'+'g src="/images/petit-chien.gif" alt="top" /'+String.fromCharCode(62);


function CompteCaractere(){
	if($("fx_contenu")){
				var longueur = $("fx_contenu").get('value').length+1;
				var maxChar = 1000;
				if(longueur>maxChar){var majText=$("fx_contenu").get('value').substring(0, maxChar);$("fx_contenu").set('value',majText);
				longueur = $("fx_contenu").get('value').length;
				}
				$('indicateurcontenu').set('html',maxChar-longueur);
	}
}
	
	function ShowRendulinks(){
		
if($$('.textareCopy')){
				$$('.textareCopy').each(function(item){
					
					var IDTextArea = item.get('title');
					$('td'+IDTextArea).set('html',$('textarea'+IDTextArea).get('value'));
					})
}
		
		}
		



function testFCK(){

   $$(".BtnFaceBook").each(function(el) {
  // var urlToLike = el.getFirst().get("href");
    var urlToLike=window.top.location.href;
    el.empty()
    facebookLike(el,urlToLike);
});

}





function facebookLike(obj,url, options) {
	
    var options = $merge({
        show_faces: "false",
        layout: "standard",
        width: 450,
        action: "like",
        font: "lucida grande",
        colorscheme: "light",
        height: 30,
        href: url
    }, options);

    var src= "http://www.facebook.com/plugins/like.php?href={href}&layout={layout}&show_faces={show_faces}&width={width}&action={action}&font={font}&colorscheme={colorscheme}&height={height}".substitute(options);
    return new Element("iframe", {
        styles: {
            border: "none",
            overflow: "hidden",
            width: options.width,
            height: options.height
        },
        id: "FBFrame",
        frameborder: 0,
        allowTransparency: "true",
        scrolling: "no",
        src: src
    }).inject(obj);
};



function imageHeightCentral(){
	
	if ($$('.photo')){
		$$('.photo').each(function(item){
			var HeightConteneur=item.getParent('.img_0').getSize().y;
			var HeightPhoto=item.getSize().y;
			if (HeightPhoto>HeightConteneur){
				var DifferTop = parseInt((HeightPhoto-HeightConteneur)/2)
				item.setStyle('margin-top',-DifferTop+'px');
				}
			
			})
		
		}
	
	}
