var debug = true;
debug = false;


//----------------------------------------------------------------
//	cssBgColorRand
//----------------------------------------------------------------
//cssBgColorRand([$("#header"),$("#nav")]);
function cssBgColorRand (obj){
	for (var i=0; i<obj.length; i++){
		var randColor = "#"+randHexa();
		obj[i].css("background-color", randColor);
		t(randColor);
	}
}
function randHexa (){
	var randVal = "";
	var randChars = "1234567890ABCDEF";
//	t(randChars.length+" *  "+Math.random());
	for (var i=0; i<6; i++){
		randVal += randChars.substr(Math.floor(Math.random()*randChars.length),1);
	}
	return randVal;
}

//----------------------------------------------------------------
//	debug
//----------------------------------------------------------------
function t (s){
	//alert(typeof(console));
	//return;
	if(!debug) return;
	console.log(s);
	//if (typeof console == "undefined") var console = { log: function() {} };
	/*
	if (typeof console == 'undefined') {
		var console = {};
		console.log = function(s) {
			return s;
		};
	}
	*/
}

//----------------------------------------------------------------
//	debug
//----------------------------------------------------------------
function debug (s, c){
	var date = new Date();
	var hourString = date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
	if(c == null) c = 0;
	//couleurs : noir/rouge/orange/vert
	var colors = Array("#000000","#FF0000","#F60","#390")
	$("#debugDiv").append("<span class='debug_time'>"+hourString+"</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class='debug_entry' style='color:"+colors[c]+"'>"+s+"</span><br>");
}

