var ie = document.all ? true : false;
var ns = (document.getElementById && !document.all)? true : false;

var NET = (navigator.userAgent.indexOf("Netscape")>-1) ? 1 : 0;
var FF = (navigator.userAgent.indexOf("Firefox")>-1) ? 1 : 0;
var SF = (navigator.userAgent.indexOf("Safari")>-1) ? 1 : 0;
var IE6 = (navigator.userAgent.indexOf("MSIE 6")>-1) ? 1 : 0;
var IE7 = (navigator.userAgent.indexOf("MSIE 7")>-1) ? 1 : 0;

function GetE( elementId ){
	return document.getElementById( elementId )  ;
}
function onoff(nom){
	if(GetE(nom)){
		if(GetE(nom).style.display=='none'){
			GetE(nom).style.display='block';
		}
		else{
			GetE(nom).style.display='none';
		}
	}
}
function afficheTTP(code){
	for(i=0;i<tabTTP.length;i++){
		if(code==tabTTP[i]){
			GetE('divTTP'+tabTTP[i]).style.display='block'
		}
		else{
			GetE('divTTP'+tabTTP[i]).style.display='none'
		}
	}
}

var pagerefresh="";
function recharger(pag,tps) {
	pagerefresh=pag;
	setTimeout("recharge()", tps*1000);
}
function recharge() {
	document.location.href=pagerefresh;
}

function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
	try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	try {
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
	xmlhttp = false;
	}
	}
	@else
	xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}
var http = getHTTPObject();

function getHref(idRub,idCat,query){
	if (typeof http != undefined) {
		str = racine+'ajax/get_href.php?idR='+idRub;
		if(idCat != undefined){
			str +='&idC='+idCat;
		}
		if(query != undefined){
			str +='&query='+query;
		}
  		http.open("GET", str , true);
  		http.onreadystatechange = documentLocation;
  		http.send(null);
  	}
  	else return false;
}
function documentLocation(){
	if (http.readyState == 4) {
		var xml;	
		if (http.status == 200) {
			if(http.responseText!=undefined){
				document.location.href=http.responseText;
			}
		}
	}
}


