
var buttonsEnabledHover = [
	'header#global-header nav#sitemenu ul li a img',
	'nav#sidemenu-left ul li a img'
];

jQuery( document ).ready( function () {

	if ( $.browser.msie && parseInt( $.browser.version ) == 6 )
	{
		jQuery( '*:first-child' ).addClass( 'first-child' );
	}
	
	var buttonsHoveble = buttonsEnabledHover.join( ', ' );
	$( buttonsHoveble ).mouseenter( function () {
		if ( !$( this ).hasClass( 'selected' ) )
		{
			$( this ).attr( 'src', $( this ).attr( 'src' ).replace( '/\.(jp[e]?g|gif|png)$/', '-hover.$1' ) );
		}
	});
	$( buttonsHoveble ).mouseleave( function () {
		if ( !$( this ).hasClass( 'selected' ) )
		{
			$( this ).attr( 'src', $( this ).attr( 'src' ).replace( '/\-hover\.(jp[e]?g|gif|png)$/', '.$1' ) );
		}
	});
	
	$( 'img.hovable' ).mouseenter( function () {
		if ( !$( this ).hasClass( 'selected' ) )
		{
			$( this ).attr( 'src', $( this ).attr( 'src' ).replace( /\.(jp[e]?g|gif|png)$/i, '-hover.$1' ) );
		}
	});
	$( 'img.hovable' ).mouseleave( function () {
		if ( !$( this ).hasClass( 'selected' ) )
		{
			$( this ).attr( 'src', $( this ).attr( 'src' ).replace( /\-hover\.(jp[e]?g|gif|png)$/i, '.$1' ) );
		}
	});
	
	if ( $( 'img.recent-selector' ).length > 1 )
	{
		$( 'img#recent-selector-notice' ).click( function () {
		 	$( 'div#recent-notice' ).css( 'display', 'block' );
		 	$( 'div#recent-event' ).css( 'display', 'none' );
		 	
			$( 'img#recent-selector-notice' ).addClass( 'selected' );
			$( 'img#recent-selector-event' ).removeClass( 'selected' );
		 	$( 'img#recent-selector-event' ).attr( 'src', $( 'img#recent-selector-event' ).attr( 'src' ).replace( /\-hover\.(jp[e]?g|gif|png)$/i, '.$1' ) );
		});
		$( 'img#recent-selector-event' ).click( function () {
		 	$( 'div#recent-notice' ).css( 'display', 'none' );
		 	$( 'div#recent-event' ).css( 'display', 'block' );
		 	
			$( 'img#recent-selector-notice' ).removeClass( 'selected' );
		 	$( 'img#recent-selector-notice' ).attr( 'src', $( 'img#recent-selector-notice' ).attr( 'src' ).replace( /\-hover\.(jp[e]?g|gif|png)$/i, '.$1' ) );
			$( 'img#recent-selector-event' ).addClass( 'selected' );
		});
	}
	
	if ( $( 'ul.banners' ).length > 0 )
	{
	    $( 'ul.banners' ).parent().jCarouselLite({
	    	auto: true,
	    	speed: 1500,
	    	scroll: 1,
	    	visible: 7,
	    	btnNext: '.banner-next',
	    	btnPrev: '.banner-prev'
	    });
	}
	
});

function findAccount ()
{
	window.open( '/member/find.php', 'findAccount','width=420,height=420,left=50,top=50');
}

// flash(파일주소, 가로, 세로, 배경색, 윈도우모드, 변수, 경로)
function flash(url,w,h,bg,win,vars,base){
	var s=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='base' value='"+base+"' />"+
	"<embed src='"+url+'?'+vars+"' base='"+base+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(s);
}

// flash(title)
function flash2(url,w,h,bg,win,vars,base){
	var s=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='base' value='"+base+"' />"+
	"<embed src='"+url+"' base='"+base+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(s);
}

function sub2_6 ()
{
	window.open( '/contents/pages/menu2/pop.php', 'findAccount','width=746,height=774,left=50,top=50');
}


function hideLayer ()
{
	$( 'nav#sitemenu' ).css( 'z-index', 10000 );
}
function showLayer ()
{
	$( 'nav#sitemenu' ).css( 'z-index', 0 );
}
function go_m1() {
	window.open('/pop/timetable.php','time','width=1165,height=800,left=50,top=50,scrollbars=yes');
}
//function go_m1() { location.href="/contents/Class-Timetable/; }
function go_m2() { location.href="/contents/Toeic/"; }
function go_m3() { location.href="/tools/enrollments/"; }
/* function go_m3() { location.href="/tools/enrollments/"; } */
function go_m4() { location.href="/board/?board=calendar"; }
function go_m5() { location.href="/board/?board=study"; }
function go_m6() { location.href="/board/?board=class_advice"; }
function go_m7() { location.href="/contents/Teacher-Introduce/"; }
function go_m8() { location.href="/board/?board=class_impression"; }
function go_m9() { location.href="/contents/Worker-Support/"; }
function go_m10() { location.href="/board/?board=gallery"; }
function go_m11() { location.href="/board/?board=movie"; }
function go_m12() { location.href="/contents/Certificate/"; }

function go_c1() { location.href="/contents/Toeic/"; }
function go_c2() { location.href="/contents/Toefl/"; }
function go_c3() { location.href="/contents/Teps/"; }
function go_c4() { location.href="/contents/DNA/"; }
function go_c5() { location.href="/contents/Toeic-Speaking/"; }
function go_c6() { location.href="/contents/English-Conversation/"; }
function go_c7() { location.href="/contents/English-Grammar/"; }
function go_c8() { location.href="/contents/Voca/"; }
function go_c9() { location.href="/contents/Neat/"; }
