

function twAjusteIFrame(sObjet) 
{
var nHauteur = document.getElementById(sObjet).contentWindow.document.body.scrollHeight;
//alert(nHauteur);


document.getElementById(sObjet).style.height = nHauteur+10;
document.getElementById('maintab').style.height = 190+nHauteur+10;
//alert(nHauteur+"-- "+document.style.height);

}

function twAjusteIFrame_mac(sObjet) 
{
var nHauteur = parent.frames[sObjet].document.body.scrollHeight;
//alert('in fonction');
//alert(nHauteur);
document.getElementById(sObjet).style.height = nHauteur+10;
document.getElementById('maintab').style.height = 190+nHauteur+10;
}


function twAjusteIFrame_mac2(sObjet) 
{
var nHauteur = parent.frames[sObjet].document.body.scrollHeight;
//alert('in fonction');
//alert(nHauteur);
document.getElementById(sObjet).style.height = nHauteur+10;
//document.getElementById('maintab').style.height = 190+nHauteur+10;
}

function twAjusteIFrame_iemac(sObjet) 
{
// Code gratuit des Trucsweb.com

//var nHauteur=document.getElementById(sObjet).style;
//document.getElementById(sObjet).window.document.body.scrollHeight;
//alert('in fonction');
alert(parent.frames[sObjet].window.location);
//document.frames(sObjet).document.style.height = nHauteur+10;
}

function popup_mdp_perdu()
{
	window.open("popup_mdp_perdu.php","attente","scrollbars=0, resizable=0, menubar=no,toolbar=no, location=no,width=500,height=300");
}

function popup_liste_invitation(id)
{
	window.open("popup_liste_invitation.php?id="+id,"attente","scrollbars=1, resizable=1, menubar=no,toolbar=no, location=no,width=600,height=800");
}

function popup_invitation(id)
{
	window.open("popup_invitation.php?id="+id,"attente","scrollbars=1, resizable=1, menubar=no,toolbar=no, location=no,width=600,height=800");
}

function popup_article(id)
{
	window.open("popup_revue.php?id="+id,"attente","scrollbars=1, resizable=1, menubar=no,toolbar=no, location=no,width=600,height=800");
}

function popup_infos_leg()
{
	window.open("popup_infos_leg.php","attente","scrollbars=1, resizable=1, menubar=no,toolbar=no, location=no,width=600,height=800");
}


function popunder_rencontre()
{
	pop=window.open("http://rencontres.pinktv.fr/","popunder");
	pop.blur();
	window.focus(); 
}

function popup_telechargement_pub(image)
{
	window.open("popup_telechargement_pub.php?pub="+image+"&res=800x600","attente","scrollbars=1, resizable=1, menubar=no,toolbar=no, location=no,width=850,height=650");
}


function popup_attente()
{
	window.open("popup_attente.php","attente","scrollbars=0, resizable=0, menubar=no,toolbar=no, location=no,width=500,height=250");
}

function popup_attente_en()
{
	window.open("popup_attente_en.php","attente","scrollbars=0, resizable=0, menubar=no,toolbar=no, location=no,width=500,height=250");
}

function popup_newsletter()
{
	window.open("popup_newsletter.php","newsletter","scrollbars=0, resizable=0, menubar=no,toolbar=no, location=no,width=500,height=250");
}

function popup_newsletter2(email)
{
	window.open("popup_newsletter.php?email="+email,"newsletter","scrollbars=0, resizable=0, menubar=no,toolbar=no, location=no,width=500,height=250");
}

function popup_ins_fond()
{
	window.open("pop_ins_fond.php","inscription","scrollbars=1, resizable=0, menubar=no,toolbar=no, location=no,width=798,height=650");
}

function popup_ins_nip(abo)
{
	window.open("pop_ins2.php?abonnement="+abo,"inscription","scrollbars=1, resizable=0, menubar=no,toolbar=no, location=no,width=798,height=650");
}

function popup_ins_ni(abo)
{
	window.open("pop_ins1.php?abonnement="+abo,"inscription","scrollbars=1, resizable=0, menubar=no,toolbar=no, location=no,width=798,height=650");
}

function popup_ins(abo)
{
	window.open("pop_ins.php?abonnement="+abo,"inscription","scrollbars=1, resizable=0, menubar=no,toolbar=no, location=no,width=798,height=650");
}

function popup_fiche_test(id)
{
 return window.open("../fiche_prog.php?id="+id,"","toolbar=no,menubar=no,toolbar=no,location=yes,resizable=no,width=540,height=500,scrollbars=yes");

}

function popup_fiche(id)
{
 return window.open("fiche_prog.php?id="+id,"","toolbar=no,menubar=no,toolbar=no,location=yes,resizable=no,width=545,height=550,scrollbars=yes");

}

function popup_modImg(id)
{
 return window.open("img_phototheque.php?id="+id,"","toolbar=no,menubar=no,toolbar=no,location=yes,resizable=no,width=545,height=550,scrollbars=yes");

}


function ChangeUrl_frame(page)
{
  //find the height of the internal page
	window.main.location.href ='accueil_chaine.php';

	//var url=document.getElementById(sObjet).location.href='accueil_chaine.php';

  //change the height of the iframe
//  document.getElementById('the_iframe').height=the_height;
}

function fenetre(url)
{
 return window.open(url,"","toolbar=no,menubar=yes,toolbar=yes,location=yes,resizable=no,width=515,height=550,scrollbars=yes");
}


function ouvrirPopunder(urlPopunder){
	popunder = popupcentree("popunder.php","popunder",290,290,"menubar=no,scrollbars=yes,statusbar=no")
	popunder.blur();
	window.focus();
}

function popupPassOubli(page,nom,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2 + 0;
var left=(screen.width-largeur)/2+ 0;
window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}


function popupcentree(page,nom,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2 + 0;
var left=(screen.width-largeur)/2+ 0;
window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}


function popupddeTelechargement(page,nom,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2 + 0;
var left=(screen.width-largeur)/2+ 0;
window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}


function popupInscription(page,nom,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2 + 0;
var left=(screen.width-largeur)/2 + 0;
window.open(page,nom,"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function Continuer(formulaire,ecran) 
{
 formulaire.action=ecran;
 formulaire.submit();
 return true;
}


function CompChamps(objet1,objet2) {
if (objet1.value != objet2.value)
{
  alert("Le mot de passe n a pas été confirmé correctement.Assurez vous que la confirmation du mot de passe corresponde exactement au mot de passe.");
  
  objet2.select();
  return false;
}
return true;
}





function taille(objet,size,champ)  {
		if (objet.value.length != size) {
			alert("Le champ \"" + champ + "\" doit comporter "+size+" caractères.")
			objet.focus()
			return false
		}
		  return true
}

function tailleMax(objet,size,champ)  {
		if (objet.value.length >= size) {
			alert("Le champ \"" + champ + "\" doit comporter au plus "+size+" caractères.")
			objet.focus()
			return false
		}
		  return true
}

function numMax(objet,size,champ)  {
		if (objet.value < size) {
			alert("Le champ \"" + champ + "\" doit être au moins égale à "+size+" .")
			objet.focus()
			return false
		}
		  return true
}

function numPassager(objet1,objet2,objet3,size)  {
		if (objet1.value < size && objet2.value < size && objet3.value < size) {
			alert("Il doit y avoir au moins un passager!")
			objet.focus()
			return false
		}
		  return true
}


function IsNumeric(objet,champ) {
	reg= /^\d+((\.|\,)\d+)?$/
	if (reg.test(objet.value) == false && objet.value.length != 0) {
		alert("Seul les caractères numériques sont autorisés dans la donnée \"" + champ + "\".")
		objet.focus()
		return false
	}
	else {
		  objet.value=objet.value.replace(',','.');
		  return true
		 }
}




function verifAbs(objet,champ) {
		if (objet.value.length != 0) {
			alert("Vous ne devez pas saisir la donnée \"" + champ + "\".")
			objet.focus()
			return false
		}
		return true
}

function verifEmail(objet,champ) {
		reg = /[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\.\-_]+\.[a-zA-Z0-9\.-_]/g
		if (reg.test(objet.value) == false ) {
			alert("Vous devez rentrer une adresse Email valide")
			objet.focus()
			return false
		}
		return true
}

function verifPres(objet,champ)
	{
	  if (objet.value.length == 0)
	  {
		alert("Vous devez saisir la donnée \"" + champ + "\".")
		objet.focus()
		return false
	  }
	  return true
}

function verifPresSel(objet,champ) {
		if (objet.options[objet.selectedIndex].value.length == 0) {
			alert("Vous devez saisir la donnée \"" + champ + "\".")
			objet.focus()
			return false
		}
		return true
}


function verifselection(objet,champ) {
		if (objet.options[objet.selectedIndex].value == 0) {
			alert("Vous devez saisir la donnée \"" + champ + "\".")
			objet.focus()
			return false
		}
		return true
}


function verifPass(objet,objet2)
	{
		if (objet.value!=objet2.value)
		{
			alert("Le nouveau mot de passe n'a pas été confirmé correctement.")
			return false
		}
	return true
	}




function verif_form_reponse(objet,msg) {
		if (objet.value.length == 0) {
			window.alert(msg)
			objet.focus()
			return false
		}
		return true
}


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];}}
}

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;
}

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;
}

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];}
}






