/* ===========================================
 * NIKKOR
 * -------------------------------------------
 * UTF-8N
=========================================== */


/* WallPaper
=========================================== */

var wallpaper = {
	setInit : function(){
		wallpaper.thumb_i = "calendar_s";
		wallpaper.thumb_o = $("#"+wallpaper.thumb_i);
		$(">img",wallpaper.thumb_o).css("border-color", "#FFE600");

		wallpaper.panel_i = wallpaper.thumb_i.slice(0, -2);
		wallpaper.panel_o = $("#"+wallpaper.panel_i);

		$("#side>ul>li:has(img)").each(function(){

			$(this).hover(function(){
				$(">img",this).css("border-color", "#FFE600");
			}, function(){
				if($(this).attr("id") != wallpaper.thumb_i){
					$(">img",this).css("border-color", "transparent");
				}
			});

			$(this).click(function(){
				if($(this).attr("id") != wallpaper.thumb_i){
					$(">img",wallpaper.thumb_o).css("border-color", "transparent");
					$(wallpaper.panel_o).hide();

					wallpaper.thumb_i = $(this).attr("id");
					wallpaper.thumb_o = $(this);
					$(">img",wallpaper.thumb_o).css("border-color", "#FFE600");

					wallpaper.panel_i = wallpaper.thumb_i.slice(0, -2);
					wallpaper.panel_o = $("#"+wallpaper.panel_i);
					$(wallpaper.panel_o).fadeIn("normal");
				}
			});

			if($(this).hasClass("new")){
				$(this).append('<img src="img/ic_new.png" alt="NEW" width="20" height="11" class="icon" />');
			}

		});

		$("#screensaver ul.new>li.preview").each(function(){
			$(this).append('<img src="img/ic_new.png" alt="NEW" width="20" height="11" class="icon" />');
		});

	}
}


/* ===========================================
 * START
=========================================== */

$(document).ready(function(){

	// WallPaper
	wallpaper.setInit();

	// RollOver Images
	sc_bt = new Image();
	sc_bt.src = "img/sc_bt_o.png";
	wa_bt = new Image();
	wa_bt.src = "img/wa_bt_o.png";

});


