(function (window, undefined) {
	window.suqqu = window.$suqqu = {
		filename: '',
		hideall: function () { $('ul.submenu').hide(); }
	};
})(window);


/**
 *
 * Rollover
 *
 */
$(function () {
    $('img.hover').mouseover(function(){
        $(this).attr('src',$(this).attr('src').replace(/^(.+)(\.[a-z]+)$/, '$1-o$2'))
    }).mouseout(function(){
        $(this).attr('src',$(this).attr('src').replace(/^(.+)-o(\.[a-z]+)$/, '$1$2'));
    }).each(function(){
        $('<img>').attr('src',$(this).attr('src').replace(/^(.+)(\.[a-z]+)$/, '$1-o$2'))
    });
})


/**
 *
 * Popup Window
 *
 */
$(function () {
    $('a.popup').click(function(){
        window.open($(this).attr('pref'), '_blank', 'width=' + ($(this).attr('width') || 860) + ',toolbar=no, scrollbars=yes');
    }).each(function(){
        $(this).attr('pref', $(this).attr('href'));
		$(this).attr('href', 'javascript:void(0)');
		$(this).attr('target', '_self');
    });
})



/**
 *
 * Submenu
 *
*/
$(function () {
	$('#identity').mouseover($suqqu.hideall);
	$('#contents').mouseover($suqqu.hideall);
	$('.concept_visual').mouseover($suqqu.hideall);
	$('ul.submenu').mouseleave($suqqu.hideall);
    $('#navi li a').mouseover(function(){
		$suqqu.hideall();
		$('#' + ($(this).attr('id')).replace(/^.+(\_[a-z]+)$/, 'submenu$1')).show();
    });
})

