function verifNewsletter(f){
	if (!isEmail(f.email.value)){
		alert("Vous devez saisir une adresse email valide !");
		f.email.focus();
		return false;
	}
	if (!f.data[0].checked && !f.data[1].checked && !f.data[2].checked && !f.data[3].checked){
		alert("Vous devez choisir votre spécialité !");
		return false;
	}
	return true;
}

function chemin_fer_rub(elt){
	var rubName=escape(elt.innerHTML);
	self.location.href="index.php?rubname="+rubName;
}

function envoiAmi(article_id){
	popup("envoi_ami.php?article_id="+article_id,400,350,0);
}

function popup(loc,larg,haut,scro){
	nouvelle_fenetre = window.open(loc,"","menubar=0,resizable=1,scrollbars="+scro+",width="+larg+",height="+haut+",top=100,left=100");
	if (parseInt(navigator.appVersion) > 2) { nouvelle_fenetre.focus();}	
}

function viewArticle(id,rub_id,num){
	self.location.href="index.php?display=article&rubId="+rub_id+"&num="+num+"&articleId="+id;
}


function stopDew(){
	/* stop dewplayer : */
	var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1; 
	var dews = document.getElementsByTagName("object");
	for(i=0;i<dews.length;i++){
		if (dews[i].className=="dewplayer") {
			tmp = InternetExplorer ? eval("window."+dews[i].id) : eval("window.document."+dews[i].id);
			try{
				tmp.GotoFrame(4);
			}catch(e){
				//alert(e);	
			}
		}
		
		if (dews[i].id.substr(0,9)=="swfVideo_") {
			tmp = InternetExplorer ? eval("window."+dews[i].id) : eval("window.document."+dews[i].id);
			try{
				tmp.SetVariable("setPause","oui");
			}catch(e){
				//alert(e);	
			}		
		}
	}
}


function ajoutCaddie(articleId,verId){
	ajaxGet("_caddieContent.php?actionCaddie=add&articleId="+articleId+"&verId="+verId,"caddieContent");
}

function suppCaddie(articleId,verId){
	ajaxGet("_caddieContent.php?actionCaddie=supp&articleId="+articleId+"&verId="+verId,"caddieContent");
}
