﻿/* ---------------------------------------------------------------
	
	MAIN.JS
		
--------------------------------------------------------------- */

jQuery(document).ready(function(){
/* config - commentOut to Off */
	initRollOvers();
	smoothScroll();

/* geturl */
	var str = location.href;
	var re2 = new RegExp("article/list", "i");
	var re3 = new RegExp("emission", "i");
	var re4_1 = new RegExp("type/category/id/1", "i");
	var re4_2 = new RegExp("type/category/search_id/1", "i");
	var re4_3 = new RegExp("type/category/id/2", "i");
	var re4_4 = new RegExp("type/category/search_id/2", "i");
	var re4_5 = new RegExp("type/category/id/3", "i");
	var re4_6 = new RegExp("type/category/search_id/3", "i");
	var re5_1 = new RegExp("type/category/id/4", "i");
	var re5_2 = new RegExp("type/category/search_id/4", "i");
	var re5_3 = new RegExp("type/category/id/5", "i");
	var re5_4 = new RegExp("type/category/search_id/5", "i");
	var re6_1 = new RegExp("type/category/id/6", "i");
	var re6_2 = new RegExp("type/category/search_id/6", "i");
	var re5 = new RegExp("edition", "i");
	var re6 = new RegExp("musique", "i");
	var re7 = new RegExp("telechargement", "i");
	var re8 = new RegExp("liens", "i");
	var re9 = new RegExp("menu", "i");
	var re10 = new RegExp("article/add", "i");
	var re11 = new RegExp("article/confirm", "i");
	var re12 = new RegExp("article/do", "i");
	var re13 = new RegExp("entry", "i");
	var re14 = new RegExp("login", "i");
	var re15 = new RegExp("user/show", "i");
	var re16 = new RegExp("user/message", "i");
	var re17 = new RegExp("article/show", "i");
	var re18 = new RegExp("article/list/type/pv", "i");
	var re19 = new RegExp("article/list/type/member", "i");

	if (str.search(re3) != -1) {
		$('#gnavi-03').addClass("gnavi_active");
		$('#snavi3').addClass("snavi_active");
    }
	else if ((str.search(re4_1) != -1) || (str.search(re4_2) != -1) || (str.search(re4_3) != -1) || (str.search(re4_4) != -1) || (str.search(re4_5) != -1) || (str.search(re4_6) != -1)) {
		$('#gnavi-04').addClass("gnavi_active");
		$('#snavi4').addClass("snavi_active");
    }
	else if ((str.search(re5_1) != -1) || (str.search(re5_2) != -1) || (str.search(re5_3) != -1) || (str.search(re5_4) != -1)) {
		$('#gnavi-05').addClass("gnavi_active");
		$('#snavi5').addClass("snavi_active");
    }
	else if ((str.search(re6_1) != -1) || (str.search(re6_2) != -1)) {
		$('#gnavi-06').addClass("gnavi_active");
		$('#snavi6').addClass("snavi_active");
    }
    else if (str.search(re7) != -1) {
		$('#gnavi-07').addClass("gnavi_active");
		$('#snavi7').addClass("snavi_active");
    }
    else if (str.search(re8) != -1) {
		$('#gnavi-08').addClass("gnavi_active");
		$('#snavi8').addClass("snavi_active");
    }
    else if ((str.search(re9) != -1) || (str.search(re10) != -1) || (str.search(re11) != -1) || (str.search(re12) != -1) || (str.search(re13) != -1) || (str.search(re14) != -1) || (str.search(re15) != -1) || (str.search(re16) != -1)  || (str.search(re17) != -1) || (str.search(re18) != -1) || (str.search(re19) != -1)) {
    }
	else if (str.search(re2) != -1) {
		$('#gnavi-02').addClass("gnavi_active");
		$('#snavi2').addClass("snavi_active");
    }
    else {
    	$('#gnavi-01').addClass("gnavi_active");
		$('#snavi1').addClass("snavi_active");
    }
	
/* navifade */
	var In = $('#gnavi>li').length;
	for(var i=0;i<In;i++){
		$('#gnavi>li').eq(i).bind("mouseenter",i,
		function(event){
			$('#gnavi li img.fadeover').eq(event.data).stop().animate({"opacity":"0"},250);
			$('#gnavi li ul').eq(event.data).show();
		});
		$('#gnavi>li').eq(i).bind("mouseleave",i,
		function(event){
			$('#gnavi li img.fadeover').eq(event.data).stop().animate({"opacity":"1"},250);
			$('#gnavi li ul').eq(event.data).hide();
			$('#gnavi li ul.snavi_active').show();
		});
	}
/* flatHeights */
	$('.sumbnail_top').flatHeights();
	$('.blog_top').flatHeights();
	$('#content_top_l, #content_top_r').flatHeights();
	$('.membrelist_top').flatHeights();
/* biggerlink */
	$('.sumbnail_top, .blog_top dl ,.membrelist_top dl, #content_top_r dl, #sidebar-sambnail dl, .listbox, .detail-text1').biggerlink();
	$('#articles_top li a span').css('cursor',"pointer");
	$('.sumbnail_top').hover(
		function(){
			$(this).css("background-color","#ffffff");
		},
		function(){
			$(this).css("background-color","#fafaf9");
		}
	);
	$('.blog_top dl').hover(
		function(){
			$(this).css("background-color","#ffffff");
		},
		function(){
			$(this).css("background-color","#f6f6f5");
		}
	);
	$('.membrelist_top dl').hover(
		function(){
			$(this).css("background-color","#ffffff");
		},
		function(){
			$(this).css("background-color","#f6f6f5");
		}
	);
	$('#content_top_r dl').hover(
		function(){
			$(this).css("color","#58a9c7");
		},
		function(){
			$(this).css("color","#686868");
		}
	);
	$('#sidebar-sambnail dl').hover(
		function(){
			$(this).css("color","#58a9c7");
		},
		function(){
			$(this).css("color","#686868");
		}
	);
	$('.listbox').hover(
		function(){
			$(this).addClass("listbox_over");
		},
		function(){
			$(this).removeClass("listbox_over");
		}
	);
	$('.detail-text1').hover(
		function(){
			$(this).css("color","#ff0000");
		},
		function(){
			$(this).css("color","#686868");
		}
	);
	$('#comment-postform-content').hover(
		function(){
			$(this).css("border-color","#8ed3eb");
			$('#bg-comment-postform_b').css("background-position","left bottom");
			$('#bg-comment-postform_t').css("background-position","left top");
		},
		function(){
			$(this).css("border-color","#e7e3ed");
			$('#bg-comment-postform_b').css("background-position","right bottom");
			$('#bg-comment-postform_t').css("background-position","right top");
		}
	);
/* flash */
	$('h2#top-img').html('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="958" height="178"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/flash_top.swf" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="scale" value="noscale" /><!--[if lte IE 7 ]><img src="/images/imgs/top-img.gif" width="958" height="178" alt="KIRA KIRA JAPON" /><![endif]--><embed src="/flash/flash_top.swf" quality="high" menu="false" scale="noscale" allowscriptaccess="sameDomain" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="958" height="178" id="emb_public" name="emb_public"></embed><noembed><img src="imgs/top-img.gif" width="958" height="178" alt="KIRA KIRA JAPON" /></noembed></object>');
});