function menu(id){
	for(i=1;i<6;i++){
		modif = document.getElementById('calc'+i);
		if(id == i){
			modif.style.visibility = 'visible';
		}else{
			modif.style.visibility = 'hidden';
		}
	}
}

function contact(id){
	if(document.formmail.message.value == ''){
		alert('Merci de remplir le champ message.');
		return false;
	}else if(document.formmail.email.value == ''){
		alert('Merci de laisser votre adresse email.');
		return false;
	}
	document.getElementById('formmail').submit();
	return true;
}

function opinion(id){
	if(document.formavis.note.value == 99){
		alert('Merci de mettre une note entre 0 et 10 pour ce téléphone.');
		return false;
	}else if(document.formavis.commentaire.value == ''){
		alert('Merci de laisser un avis pour ce téléphone.');
		return false;
	}else if(document.formavis.email.value == ''){
		alert('Merci de saisir votre email pour valider votre avis.');
		return false;
	}
	document.getElementById(id).target = 'oppinion';
	window.open('', "oppinion", "width=349,height=505,top=120,left=360");
	document.getElementById('formavis').submit();
	return true;
}

function mailling(email){		
p="height=230,width=300,toolbar=no,directories=no,status=no,scrollbars=auto,resizable=no,menubar=no";hWnd=window.open("http://www.mobiles-actus.com/pages/newsletter.php?site=graphmobile&email="+email,"Hwnd",p);hWnd.focus();}

function ajouter_opinion(id){ window.open("http://www.mobiles-actus.com/pages/test_opinion.php?source=graphmobile&id="+id, "conttact", "width=349,height=505,top=120,left=360"); }

function imagec(url){ if(navigator.appName=="Netscape" && document.getElementById) { document.getElementById("imgch").src="/photos/mobiles/205x268/"+url; } else document.images.imgch.src="/photos/mobiles/205x268/"+url; }

function gourl(from,modele){
	page = from.url.options.selectedIndex;
	valeur = from.url.options[page].value;
	if(valeur != 'avis' && valeur != 'fiche' && valeur != 'prix'){
		if(valeur == 1){ location.href = '/test/'+modele+'.htm'; }
		else{ location.href = '/test/'+modele+'-'+valeur+'.htm'; }
	}else{
		if(valeur == 'fiche'){
			location.href = '/fiche/'+modele+'.htm';
		}
		if(valeur == 'avis'){
			location.href = '/avis/'+modele+'.htm';
		}
		if(valeur == 'prix'){
			location.href = '/prix/'+modele+'.htm';
		}
	}
}
function gourl1(from){
	page = from.url.options.selectedIndex;
	valeur = from.url.options[page].value;
	location.href = '/dossier/'+valeur+'.htm';
}
function openphoto(id,modele){
	window.open("http://www.topmobile.org/pages/view_photo.php?modele="+modele+"&id="+id, "photo", "width=830,height=685,top=0,left=0,scrollbars=1");
}

function submitConstructeur(){
	valeur = document.getElementById("constructeur").value;
	if(valeur != ''){
		location.href = '/mobiles-'+valeur+'.htm';
	}
}



/*** ROTATE INTEGRATION ***/

// functions
function rotate_create_cookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function rotate_read_cookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function rotate_erase_cookie(name) {
	rotate_create_cookie(name,"",-1);
}

var rotate_days = 1;
var rotate_cookie = rotate_read_cookie('rotate_integration');

if(rotate_cookie) {
	rotate_create_cookie('rotate_integration', parseInt(rotate_cookie) + 1, rotate_days);
} else {
	rotate_create_cookie('rotate_integration', 1, rotate_days);
}

