<!-- HOVER (IE) -->
if(!window.Event)
{
	document.onmouseover = function()
	{
		x=window.event.srcElement
		if(x.className == "submit" || x.className == "submit_IE") x.className = "submithover_IE";
		if(x.tagName == "INPUT" && (x.className == "textfield" || x.className == "textfield_IE")) x.className = "textfieldhover_IE";
	}
	
	document.onmouseout=function()
	{
		if(x.className == "submit" || x.className == "submithover_IE") x.className = "submit_IE";
		if(x.tagName == "INPUT" && (x.className == "textfield" || x.className == "textfieldhover_IE")) x.className = "textfield_IE";
	}
}
<!-- FIN HOVER (IE) -->

function openimg( data, width )
{
	window.open(data, "Visualisation", "left=50, top=50, scrollbars=no, resizable=no, width="+width+", height=700");
}

function check_value( data, data2, data3 )
{
	text = document.getElementById(data);
	control = document.getElementById(data+"_c");
	vtext = text.value;
	ltext = vtext.length;
	
	result = false;
	
	switch(data3)
	{
		case "text":
			if(ltext >= data2)
			{
				result = true;
			}
		break;
		
		case "mail":
			var place = vtext.indexOf("@",1);
			var point = vtext.indexOf(".",place+1);
			
			if((place > -1) && (ltext > 2) && (point > 1))
			{
				result = true;
			}
		break;
		
		case "select":
		
		break;
		
		case "password":
			vtext2 = document.getElementById(data2).value;
			if(vtext == vtext2)
			{
				result = true;
			}
		break;
	}
	
	if(result)
	{
		if(text.className !== "textfield")
		{
			text.className = ( text.className == 'textfield' ) ? '' : 'textfield';
		}
		
		control.innerHTML = "<img src=\"img/ok.png\" border=\"0\" width=\"16\" height=\"16\" alt=\"Control OK\">";
	}
	else
	{
		if(text.className !== "erreur_form")
		{
			text.className = ( text.className == 'erreur_form' ) ? '' : 'erreur_form';
		}
		
		control.innerHTML = "<img src=\"img/erreur.png\" border=\"0\" width=\"16\" height=\"16\" alt=\"Control Erreur\">";
	}
}

/// AJAX ///

var xhr = null; 

function getXhr()
{
	if(window.XMLHttpRequest)xhr = new XMLHttpRequest(); 
	
	else if(window.ActiveXObject)
  	{ 
 		try
		{
     		xhr = new ActiveXObject("Msxml2.XMLHTTP");
    	}
		
		catch (e) 
     	{
     		xhr = new ActiveXObject("Microsoft.XMLHTTP");
    	}
	}
	else 
	{
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		xhr = false; 
	}
}

function Show(div, id, thm)
{
	if(document.getElementById("detail" + div).style.visibility == "hidden")
	{
		document.getElementById("detail" + div).style.visibility = "visible";
		document.getElementById("detail" + div).style.display = "block";
		document.getElementById("img" + div).src = "img/puce2.png";
		
		getXhr()
		xhr.onreadystatechange = function()
		{
			if(xhr.readyState == 4 && xhr.status == 200)
			{
				document.getElementById("detail" + div).innerHTML = xhr.responseText;
			}
		}
		
		xhr.open("GET","./?act=dtheme&id="+id+"&idthm="+thm, true);
		xhr.send(null);
	}
	else
	{
		document.getElementById("detail" + div).style.visibility = "hidden";
		document.getElementById("detail" + div).style.display = "none";
		document.getElementById("img" + div).src = "img/puce.png";
	}
}

function show_conf(id)
{
	document.getElementById("show_conference_" + id).style.visibility = "visible";
	document.getElementById("show_conference_" + id).style.display = "block";
}

function hide_conf(id)
{
	document.getElementById("show_conference_" + id).style.visibility = "hidden";
	document.getElementById("show_conference_" + id).style.display = "none";
}

function verif_cgv()
{
	if(document.form.cgv.checked == true)
	{
		return true;
	}
	else
	{
		alert("Vous devez accepter les conditions générales de vente");
		return false;
	}
}
