$(document).ready(function(){
	
	/*************************************
	*********   MSIE < 7 SUX   ***********
	*************************************/
	/*
	if ($.browser.msie && $.browser["version"]<7 && $.cookie('msieuser')==null)
	{
		$.cookie('msieuser', '1', { expires: 365, path: '/', domain: 'www.copidrogas.com.co' });
		var Alert = "Bonjour,\n\n";
		Alert += "vous utilisez une version d'internet explorer trop ancienne pour afficher correctement Guistalk.\n\n";
		Alert += "Utilisez la version 7 d'Internet Explorer. Mieux encore, utilisez Firefox ou safari :)\n\n";
		Alert += "Pour plus d'infos, rendez-vous ensuite sur la page Infos du site.\n\n";
		Alert += "Bon surf !";
		alert(Alert);
	}
	
	/*************************************
	*********     SCROLL UP   ***********
	*************************************/
	$('#scrollup').click(function(){
		$.scrollTo( 0, 800);
	});
	/*************************************
	/*PowerBy*****************************
	/************************************/
	$('#powerby').click(function(){
		$.scrollTo( 0, 800);
	});
	/*************************************
	*********    IMG PRELOAD   ***********
	*************************************/
	/*
	$.preload([ 'bt_valider_hover', 'list_arrow_hover', 'scrollup_arrow_hover', 'bg1', 'bg2', 'bg3', 'bg4', 'bg5', 'bg6' ], {
				base:'images/img/',
				ext:'.png'
	});
	
	$.preload( '.imghover', {
				find:/(.*)\.(gif|jpg|png)/,
				replace:'$1_hover.$2'
	});
	*/
	/*************************************
	******    IMG FADEIN FADEOUT   *******
	*************************************/
	if (!$.browser.msie) /* MSIE SUX ANOTHER TIME */
	{
		$(".fade, .themes img").mouseover(function(){
			$(this).fadeTo(200,0.5);
		}).mouseout(function(){
			$(this).fadeTo(200,1);
		});
	}
	
	/*************************************
	**********    IMG HOVER    ***********
	*************************************/
	var input_src;
	$(":image").hover(function(){
		input_src = $(this).attr("src");
		var part = input_src.split(".");
		var input_src_hover = part[0]+"_hover."+part[1];
		$(this).attr("src", input_src_hover);
	},function(){
		$(this).attr("src", input_src);
	});
	
	/*************************************
	*********    BG SWITCHER   ***********
	*************************************/
	/*
	if ($.cookie('theme') != null)
	{
		
		$('body').css({background: "url(images/img/"+$.cookie('theme')+".png) repeat fixed" });
	}*/
	$('.themes').click(function()
	{
		var bg = $(this).attr("id");
		$('body').css({background: "url(images/img/"+bg+".png) repeat fixed" });
		$.cookie('theme', bg, { expires: 365, path: '/', domain: 'guistalk.com' });
	});
	
	/*************************************
	***********      LABO    *************
	*************************************/
	/*
	$('#tree').dirLister(
	{
		directory: "dirlister/",
		webDirectoryPath: "http://localhost/SA",
		openEasing: "easeOutBounce",
		closeEasing: "easeOutBounce",
		scriptLocation: "/dirlister/dirlister.php",
		filesIgnored: ".htaccess, .htpasswd, screenshot"
	}, function(file)
	{
		
	});*/
});
