function ajax_send_data(data, page, method, id)
		{
		if (window.ActiveXObject)
		{
		//Internet Explorer
		var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		}
		else
		{
		var XhrObj = new XMLHttpRequest();
		}
		
		//définition de l'endroit d'affichage:
		var content = document.getElementById(id);
		
		//Ouverture du fichier en methode POST
		XhrObj.open(method, page);
		
		//Ok pour la page cible
		XhrObj.onreadystatechange = function()
		{
		if (XhrObj.readyState == 4 && XhrObj.status == 200)
		content.innerHTML = XhrObj.responseText;
		}
		
		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		XhrObj.send(data);
	}

function get_os(os){
var content = "";
	if(os=='pc'){
		content = "<br /><input type='radio' name='pb_op_system' value='windows2000' /> Windows 2000&nbsp;&nbsp;&nbsp;";
		content +="<input type='radio' name='pb_op_system' value='windowsxp' /> Windows XP&nbsp;&nbsp;&nbsp;";
		content +="<input type='radio' name='pb_op_system' value='vista' /> Windows Vista&nbsp;&nbsp;&nbsp;";
	}else{
		content = "<br /><input type='radio' name='pb_op_system' value='macos' /> Mac OS X";
		content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Version&nbsp;(10.x.x) &nbsp;";
		content += "<input type='text' id='pb_versionmacos' class='FormChamp3' name='pb_versionmacos' />";		
		content += "<br /><input type='radio' name='pb_op_system' value='dualboot_windows' /> BootCamp / Parallels + Windows";

	}
	document.getElementById('os_sys').innerHTML = content; 
}

function set_choice_lang(){
	//alert(document.form_lang.order_type.value);
	myurl = document.form_lang.nextUrl.value;
	radio = document.form_lang.order_type;
      for (var i=0; i<radio.length;i++) {
         if (radio[i].checked) {
         	langtxt = radio[i].value;
         }
      }	
	//alert(langtxt)
	//alert(document.form_lang.remember.checked);
	rem = document.form_lang.remember.checked;
		//alert(rem);
		//alert(lang);
	if(langtxt!=""){
		if(rem){	
		    var pathname=location.pathname;
		    var myDomain=pathname.substring(0,pathname.lastIndexOf('/')) +'/';
		    var date_exp = new Date();
		    date_exp.setTime(date_exp.getTime()+(365*24*3600*1000));	
				SetCookie('loc',langtxt,date_exp,myDomain); 	
			
		}else{
				SetCookie('loc',langtxt);
		}
		
		// Définition du type de renvoi (www, faq ou uniform)
		if ((window.location.search.split("?")[1]).split("=")[1] == "photo/help_header&referrer") {

			if (((window.location.search.split("&")[1]).split("=")[1]).split("/")[3] == "uniform") {
				if ((window.location.search.split("&")[1]).split("=")[1].search(/'?lang'.+/)) {
					location.replace((window.location.search.split("&")[1]).split("=")[1]+'='+langtxt);
				}else{
					location.replace((window.location.search.split("&")[1]).split("=")[1]+'?lang='+langtxt);
				}
				
				//alert("uniform");
			}else{
				if (window.location.search.split("photo/help_header&referrer")[1].slice(1).search(/'?lang'.+/)) {
					//location.replace(window.location.search.split("photo/help_header&referrer")[1].slice(1)+'='+langtxt);
					location.replace(window.location.search.split("photo/help_header&referrer")[1].slice(1)+'&lang='+langtxt);
				}else{
					location.replace(window.location.search.split("photo/help_header&referrer")[1].slice(1)+'?lang='+langtxt);
				}
				//alert("faq");
			}

		}else{
		
			if ((window.location.search.split("?")[1]).split("=")[1] == "photo/forum_header&referrer") {
			
				switch (langtxt) {
						
					case "ca":
						//location.replace(window.location.search.split("photo/help_header&referrer")[1].slice(1)+'&lang='+langtxt);
						location.replace("http://forum.dxo.com/?lang="+langtxt+"?langid=1");
						break;
						
					case "ch":
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=3");
						break;
						
					case "de":
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=3");
						break;
						
					case "en":
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=1");
						break;
						
					case "fr":
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=2");
						break;
						
					case "intl":
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=1");
						break;
						
					case "jp":
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=4");
						break;
						
					case "us":
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=1");
						break;
						
					default:
						// Redirection vers la page de choix de la langue si aucune langue n'est d?tect?e 
						//header("Location: http://www.dxo.com/intl?url=photo/forums");
						location.replace("http://forum.dxo.com/?lang="+langtxt+"&langid=1");
				}
				//alert("forum");
			}else{
				document.location.href= "/"+langtxt+"/"+myurl;
				//alert("www");
			}
		}
	}else{
		//alert("no lang");
	}
	
}

function load_lang(){
	lang = GetCookie ('loc');
	if(document.form_lang.query.value==""){
		window.location="/intl/photo";
	}
	if(lang!=""){
	
	radio = document.form_lang.order_type;
      for (var i=0; i<radio.length;i++) {
         if (radio[i].value==lang) {
         	radio[i].checked=true;
         }
      }
      
  }
        
}
function getCookieVal(offset) {
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1)
      		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen) {
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg)
                        return getCookieVal (j);
                i=document.cookie.indexOf(" ",i)+1;
                        if (i==0) break;}
	return null;
}
function SetCookie (name, value) {
	var argv=SetCookie.arguments;
	var argc=SetCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=name+"="+escape(value)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
}

///////////////////////////////////////////
//onglets
///////////////////////////////////////////
var show_tab_function = null;
var hide_tab_function = null;
var onglets=2;
function show_tab(i)
{
	hide_tabs();
	if (show_tab_function) {
		show_tab_function(i);
		return;
	}
	var tab = document.getElementById('tab_' + i);
	tab.style.display = 'block';
	tab = document.getElementById('toptab_' + i);
	tab.className = 'tabon_'+i;
	
	tab = document.getElementById('tabonglets_' + i);
	tab.className = 'titreonglets_on';
	
	tab = document.getElementById('spantab_' + i);
	tab.className = 'span_on';
	
}

function hide_tabs()
{
	if (hide_tab_function) {
		hide_tab_function();
		return;
	}
	for(i = 0; i < onglets; i++){
		//document.getElementById('tab_' + i).style.display = 'none';
		
		var tab = document.getElementById('tab_' + i);
		tab.style.display = 'none';		
		
		var tab = document.getElementById('tabonglets_' + i);
		tab.className = 'titreonglets_off';
		
		var tab = document.getElementById('toptab_' + i);
		tab.className = 'taboff_'+i;
		
		var tab = document.getElementById('spantab_' + i);
	  tab.className = 'span_off';
				
	}
	
} 

//////////////////////////////////////////////
//Liste objectifs
old='../../../images/fleche_droite.gif';
function view_resume(d){


        if (document.getElementById(d).style.height =='') {
                document.getElementById(d).style.height = '20px';
                document.getElementById("i"+d).src=old;
        } else {
                document.getElementById(d).style.height = '';
                old=document.getElementById("i"+d).src;
                document.getElementById("i"+d).src='/scripts/resources/images/fleche_bas.gif';
        }
}
	function get_demo(myurl, id, id_lens){
		//new_url = myurl +'(t)/'+ id ;
		new_url = '../free_demo/(t)/'+ id ;
		if(id_lens!=undefined) new_url += '/(l)/' + id_lens;
		//alert(new_url);
		parent.document.location.href = new_url;
		//parent.document.location.href = '../free_demo';    //http://ns6276.ovh.net/intl/photo/free_demo
		//document.location.href = 'http://www.meteo.fr';
	}
	
	
	
	
	
	
	
	
///////////////////////////////////////////////////////////
///FREE DEMO
///////////////////////////////////////////////////////////

var statut = 0;
var bridge = 0;
var lens = new Array;
       

function get_value_iframe(vbridge,vlens){
	bridge = vbridge;
	lens = vlens;
}


function check_submit(msg){

	
	if ((verifiermail(document.getElementById('mail').value)) && (statut==5)) {
			return true;
		}else{
			alert(msg);
			return false;
	}
	/**/
	
}



function verifiermail(mail)
{
	var x = mail;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else return false;
}
////////////////////////////////////////////////////////////////////////


























function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


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];}
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}


// Functions PopUp
function PopUp(the_url,Largeur,Hauteur)
	{
	var vjNeedToOpenNewWindow = 1;
	if(window.Limage) {
		if(Limage.closed){vjNeedToOpenNewWindow = 1;}
		else{vjNeedToOpenNewWindow = 0;}
	} else {
		vjNeedToOpenNewWindow = 1;
		}

	if(vjNeedToOpenNewWindow == 0) {
		Limage.window.close();
		vjNeedToOpenNewWindow = 1;
		}

	CoefCorrecteur = 0.5;
	Gauche = (screen.availWidth-Largeur)*CoefCorrecteur;
	Droite = (screen.availHeight-Hauteur)*CoefCorrecteur;

	Limage = window.open(the_url,'popup','width='+Largeur+',height='+Hauteur+',left='+Gauche+',top='+Droite+',status=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes');
	}

// Functions PopUp
function PopUp2(the_url,Largeur,Hauteur)
	{
	var vjNeedToOpenNewWindow = 1;
	if(window.Limage2) {
		if(Limage2.closed){vjNeedToOpenNewWindow = 1;}
		else{vjNeedToOpenNewWindow = 0;}
	} else {
		vjNeedToOpenNewWindow = 1;
		}

	if(vjNeedToOpenNewWindow == 0) {
		Limage2.window.close();
		vjNeedToOpenNewWindow = 1;
		}

	CoefCorrecteur = 0.5;
	Gauche = (screen.availWidth-Largeur)*CoefCorrecteur;
	Droite = (screen.availHeight-Hauteur)*CoefCorrecteur;

	Limage2 = window.open(the_url,'popup2','width='+Largeur+',height='+Hauteur+',left='+Gauche+',top='+Droite+',status=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,scrollbars=yes');
	}


function openCamera (lekel) {
	PopUp('./Cameras_Lenses/' + lekel + '.htm',763,540);
}

// Functions openWindowOpener + Close -> Cameras & Lenses
function openWindowOpener(the_url) {
	window.opener.location = the_url;
	window.close();
}

function openWindowOpenerSample(lekel) {
	openWindowOpener('../Image_Gallery.htm#'+lekel);
}

function openWindowOpenerDemo() {
	openWindowOpener('../Demo.htm');
}

// rollOver sur tr
function changeCouleur(ligne, color)
	{
	ligne.bgColor = color;
	}



