
$(document).ready(function() {
	
	$("#_menu a").click(function() {
		$("dd a").removeClass("selected");
		$(this).addClass("selected");
	});
	
	var section = $('#section').val();
	clickMenu(section);	
	$('#' + section + '_a').attr("href", "#");
	$('#' + section + '_a').click(function() {
		$('#' + section + '_sub').toggle(200);
	});
		
});

function clickMenu(section) {
	if(!$('#' + section).hasClass('bold')) {
		$('#' + section + '_sub').show();	
		$('#' + section).addClass('bold');
	} 
}

function scrollWin(anchor, last) {	
	self.location.href = anchor;
	if(undefined == last) {
		self.scroll(0, pageYOffset - 110);
	}

}
function rotateImage(path, file, imgCount) {
	var imageHolder = $('#visibleImage_'+ file);
	_currImage = imageHolder.attr('imageCtr');
	_currImage = (++_currImage > imgCount) ? 1 : _currImage;
	var fileName = file + _currImage + ".jpg";
	$('#visibleImage_'+ file).attr('src', path + fileName);
	$('#imgCounter_' + file).text(_currImage + "/" + imgCount);
	imageHolder.attr('imageCtr', _currImage);
}

