$(function(){
	//htmlFileName
//	var locArray = window.location.href.split('/');
//	var loc = window.location.href;
	var locPath = window.location.href;
//	loc.match(/^[http|https]+:\/\/+[^/]+(.*)$/);
//	locPath = RegExp.$1;

//	var htmlFileName = locArray[locArray.length-1];
	var htmlFileName = locPath;

	htmlFileName = htmlFileName.replace(window.location.hash,'');

	//scMenuCurrent
	$('#scMenu a').each(function(i){
		if($(this).parent('li').attr('class') != "escCrnt"){
			if($(this).attr('href') == htmlFileName){
				$(this).addClass('current');
				$('.current + ul').addClass('currentChild');
			}
		}
	});
	
	//ctmCurrent(parentCategory)
	$('.current').parents('ul').addClass('currentRoot');
	$('.current').parents('li').children('a').addClass('parentCurrent');
	if($('.current + ul').attr('class') != 'currentChild'){
		$('.current').removeClass('parentCurrent')
	}
	
	
	//scMenuExtPdfDoc
	$('#scMenu a').each(function(i){
		//Ext
		if($(this).attr('target') == '_blank'){
			$(this).addClass('extLink');
		}
		//Pdf & Doc
		var tgtAttr = $(this).attr('href');
		var attrLength = tgtAttr.length;
		if(tgtAttr.slice(attrLength-3,attrLength) == 'pdf'){
			$(this).addClass('pdfLink');
		}
		if(tgtAttr.slice(attrLength-3,attrLength) == 'doc'){
			$(this).addClass('docLink');
		}
	});
	
});

function smtCurrent(tgt){
	//scMenuCurrent
	$('#scMenu a').each(function(i){
		if($(this).attr('href') == tgt){
			$(this).addClass('current');
			$('.current + ul').addClass('currentChild');
		}
	});
	
	//ctmCurrent(parentCategory)
	$('.current').parents('ul').addClass('currentRoot');
	$('.current').parents('li').children('a').addClass('parentCurrent');
	if($('.current + ul').attr('class') != 'currentChild'){
		$('.current').removeClass('parentCurrent')
	}
}
