$(document).ready(function() {
	jQuery.each(jQuery.browser, function(i, val) {
  		if(i=="msie" && val) {
     		$("#all_window").css("height",$("body").height());
		}
	});
	
	
	jQuery.each(jQuery.browser, function(i, val) {
  		if(i=="msie" && val) {
     		$("#all_window2").css("height",$("body").height());
		}
	});
	
	$("#options .option:last").css("border-bottom", "none");
	$(".option").hover(
		function() {
			$(this).css('background-color', '#316AC5');
			$(this).css('color', 'white');
		},
		function() {
			$(this).css('background-color', '#FFF');
			$(this).css('color', 'black');
		}
	);
	$(".select").click(function() {
		$("#options").toggle();
		$("#all_window").toggle();
	});
	$(".option").click(function() {
		$(".text").html($(this).html());
		var div_champ_select = $(this).parent().parent().attr("class");
		var type = $(this).attr("id").substring(0, 5);
		
		if(type == 'value')
			$("." + div_champ_select + " #champ_cache_select").attr("value", $(this).attr("id").substring(6));
		else if(type == 'strin')
			$("." + div_champ_select + " #champ_cache_select").attr("value", $(this).html());
		$("#options").toggle();
		$("#all_window").toggle();
		//alert($("." + div_champ_select + " #champ_cache_select").attr("value"));
	});
	$("*").click(function() {
		if($(this).attr("id") == "all_window") {
			$("#options").hide();
			$("#all_window").hide();
			$.facebox.close();
		};
	});
});
