/* Copyright (c) 2007, Yahoo! Inc. All rights reserved. */
var Cookies = {
	init: function () {
		var allCookies = document.cookie.split('; ');
		for (var i=0;i<allCookies.length;i++) {
			var cookiePair = allCookies[i].split('=');
			this[cookiePair[0]] = cookiePair[1];
		}
	},
	create: function (name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
		this[name] = value;
	}
};

$(document).ready(function(){
	
	//toogle the setting link
	$("#setting").toggle(
		function(){
		$("#settingpanel").slideDown("fast");
		return false;
		},
		function(){
		$("#settingpanel").hide();
		return false;
		}
	)
	
	//when cancel button click
	$("#dict-cancel").mousedown(function(){
		$("#settingpanel").hide();
	})
	
	//show tips
	$("#tips").slideDown();
	
	//close tips
	$("#close").click(function(){
	$(this).parent().slideUp();	
	Cookies.create("CN_DICT_TIPS",encodeURIComponent("1"),7);
	})
	
	$(".close2").click(function(){
	alert(2);
	$(this).parent().parent().slideUp();	   
	})
	
	//show select
	
	
	
	
})