Cufon.replace('h2')('.naviLink > a', {hover: true})('.navi > a', {hover: true})('.pic a');

jQuery.noConflict();

var timer;
var timer2;

jQuery(document).ready(function(){
	checkHeight();
	
	//subnavi
	jQuery('.naviLink').live('mouseenter',function(){
		clearTimeout(timer);
		jQuery('.subNavi').hide();
		jQuery('.subNavi2').hide();
		jQuery(this).children('.subNavi').show();
	});
	jQuery('.naviLink').live('mouseleave',function(){
		timer = setTimeout("jQuery('.subNavi').hide();jQuery('.subNavi2').hide();", 700);
	});
	
	//subsubnavi
	jQuery('.subNavi > li, .subNavi2 > li').live('mouseenter',function(e){
		e.stopPropagation();
		clearTimeout(timer);
		if (jQuery(this).children('.subNavi2').length > 0){
			jQuery('.subNavi > li, .subNavi2 > li').children('.subNavi2').hide();
			jQuery(this).parents('.subNavi2').show();
			jQuery(this).children('.subNavi2').show();
		}
	});
	
	//right box
	rightBoxTop();
	setTimeout(rightBoxTop, 500);
});

jQuery(window).resize(checkHeight);

function checkHeight(){
	if (jQuery(document).height() > jQuery('.b2').height()) jQuery('.b2').css('height', jQuery(document).height()+'px');
	else jQuery('.b2').css('height', '100%');
}

function rightBoxTop(){
	var top = jQuery('.col1').height() + parseInt(jQuery('.col1').css('marginTop')) - jQuery('.col2').height();
	if (top<0) top = 0;
	jQuery('.col2').css('top', top+'px');
}

jQuery.fn.identify = function(prefix) {
    var i = 0;
    return this.each(function() {
        if(jQuery(this).attr('id')) return;
        do { 
            i++;
            var id = prefix + '_' + i;
        } while(jQuery('#' + id).length > 0);            
        jQuery(this).attr('id', id);            
    });
};

