// JavaScript Document



//***************************************************/

//**/

function prechargimg() { 

var doc=document; 

if(doc.images){ if(!doc.precharg) doc.precharg=new Array();

var i,j=doc.precharg.length,x=prechargimg.arguments; for(i=0; i<x.length; i++)

if (x[i].indexOf("#")!=0){ doc.precharg[j]=new Image; doc.precharg[j++].src=x[i];}}

}



//***************************************************/

//**/ Recupere la taille de la premiere image

function checksize() { 

if (document.images[0].complete)

	{ 

		w.document.write('document.images[0].width+10','document.images[0].height+49');

	}else { 

		setTimeout("checksize()",250) 

		} 

}

//***************************************************/

//**///w,h)

function resizeOuterTo(){

 if (parseInt(navigator.appVersion)>3)

 {

   if (navigator.appName=="Netscape") {

    //top.outerWidth=w;

    //top.outerHeight=h+80;

		return 80;

   	}

   else	return 30;//top.resizeTo(w,h+30);

 }

 return 30;



};







//***************************************************/

//**/

function Affichegrande(img,texte) { 



	var titre ="";

	titre = texte;

	titre+=" - Chiens Dress&eacute;s - Cani-formation.com";

	

	prechargimg(img);

	var _img = new Image();

	_img.src = img;

	

	

	

	

	

	var _width  = _img.width;

	var _height = _img.height;

	//alert("img w :: "+_width+" h :: "+_height);

	

	_width  = 600;

	_height = ((_img.height*600)/_img.width);

	_height +=0; 

	

	//alert("img w ::"+_width+"  :::  h :: "+_height);

	

	var add = resizeOuterTo();

	add=0;

	if (add==30) {

		_width  += 10;

		_height += 29;

	}

	if (add==80) {

		_width  += 9;

		_height += 80;

	}

		

	var posX=(screen.width-_width)/2;

	var posY=(screen.height-_height)/2;

	posX+=0;

	posY+=0;

	_heightW = _height +0;

	

	w=window.open('','image','width='+_width+',top='+posY+',left='+posX+',height='+_heightW+',scrollbars=no'); 

	

	var xx=50;

	

	w.document.write('<html><head><title>'+titre+'</title></head>'); 

	/**/

	//

	w.document.write('<body bgcolor="#E3E8EE" onclick="window.close();" onblur="window.close();"   leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>');

	

	w.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%"><tr>');

	w.document.write('<td valign="top" align="center"><img src="'+_img.src+'" height="'+_height+'" width="'+_width+'" border="0" alt="'+titre+'"  style="cursor:pointer" title="Cliquer pour fermer">'); 

	w.document.write('');

	w.document.write('</td></tr></table>');

	

	w.document.write('</body></html>'); 

	

	

	w.focus();

	w.document.close(); 





}; 





















//***************************************************/

//**/

/**/

function swapImage(nomChien,nomImage,nomChienTxt){

		if(nomImage=="images_vente/_noimage.jpg") return false;

	

	



	

	var name = nomChien;

	var photos = document.getElementById(name) ;

	// On r&eacute;cup&egrave;re l'&eacute;l&eacute;ment ayant pour id galerie_mini



	var liens = this.href ;

	// On r&eacute;cup&egrave;re dans une variable tous les liens contenu dans galerie_mini

	var big_photo = document.getElementById(name);

	var lien_big_photo = document.getElementById('lien'+name) ;

	if (name=='img') lien_big_photo = document.getElementById('lien') ;

	

	big_photo.src = nomImage;
	big_photo.alt = nomChienTxt;
	//*alert("nom du chien : "+ nomImage + 

	//	  "\n id name chien : "+ name +

	//	  "\n href : " + lien_big_photo.href  );

	

	
	
	lien_big_photo.href = 'javascript:Affichegrande("'+nomImage+'","'+nomChienTxt+'")';

	



}		/**/