function preview_index() {
	var nodes_c = new Array();
	var nodes_v = new Array();
	$('#preview').find('li:hidden').each(function(){nodes_c.push(this.id);});
	$('#preview').find('li:visible').each(function(){nodes_v.push(this.id);});
	
	nodes_c = shuffle(nodes_c);
	nodes_v = shuffle(nodes_v);
	
	$('#'+nodes_c[0]).show(1000);
	$('#'+nodes_v[0]).hide(1000);
}

shuffle = function(o){ //v1.0
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};


function faq() {$('.responsefaq').hide();}
function openFaq(o) {
	faq();
	$('#response_'+$(o).attr('id')).show(10);
}

function remplicontact(){
	$('#jsnavigateur').attr('value',$.browser.name);
    $('#jsversion').attr('value',$.browser.versionNumber);
}

function checkversion(navigateur)
{
	var AllowVersion = new Array();
	AllowVersion['firefox'] = 3;
	AllowVersion['chrome'] = 4;
	AllowVersion['safari'] = 5;
	if (parseFloat($.browser.versionNumber)>=AllowVersion[navigateur]) return true; else return false;
}

function browserNameOk(navigateur) {if (navigateur=='firefox' || navigateur=='chrome' || navigateur=='safari') return true; else return false;}
function activeBrowser(navigateur,statut) {$('.'+navigateur+'.'+statut).css('display','block');}
function configDownload()
{
	$('.encours').hide();
	browserName = $.browser.name;
	if (browserNameOk(browserName))	{
		if (checkversion(browserName)) activeBrowser(browserName,'ok');
		else activeBrowser(browserName,'notok');
	} else $('.defaut').show();
}

function showButton() {
	if (browserNameOk($.browser.name)) {
	$('.buttonDownload').hide();
	activeBrowser($.browser.name,'buttonDownload');
	}
}

function click_download()
{
	if($('#VerifCGU_0:checked').length==0){alert($('#message_javascript').text()); return false;}
}

function other_click_download(navigateur)
{
	if (navigateur == 'google chrome') navigateur = 'chrome';
	if (!browserNameOk(navigateur) || !checkversion(navigateur)) alert($('#message_javascript_2').text());
}

function showVarTrad()
{
	var idtrad = new Array();
	$('span[tdstate=true]').each(function(){idtrad.push(''+$(this).attr('tdname')+'');});
	$('#tdif78nl45').html(idtrad.join(','));
	$('#tdif78nl45').show();
}

function add_fb(id)
{
	$('#'+id).html('<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fsocialplusofficial&amp;width=260&amp;colorscheme=light&amp;show_faces=true&amp;stream=false&amp;header=false&connection=8&amp;height=220" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:260px; height:220px;" allowTransparency="true"></iframe>');
}


