$(function() {
	// $("dd:first").hide();
	$("#optionmenu dt").click(function() {
	$("#optionmenu dd:visible").slideUp("slow");
	$("#optionmenu dd:not(:visible)").slideDown("slow");
	return false;
	});
	

	$("img.onbanner").mouseover(function(){
	        $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_r$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_r(\.[a-z]+)$/, "$1$2"));
    }).each(function(){
        $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_r$2"))
	});
	//scroll animation
	$('a[href^=#]').click(function() {
		var speed = 400;
		var href= $(this).attr("href");
		var target = $(href == "#" || href == "" ? 'html' : href);
		var position = target.offset().top;
		$($.browser.safari ? 'body' : 'html').animate({scrollTop:position}, speed, 'swing');
		return false;
	});
})


	
function getPath(val){
	var res = "";
	if (val.indexOf("../../../") > -1){
		res = "../../../";
	}else if(val.indexOf("../../") > -1){
		res = "../../";
	}else if(val.indexOf("../") > -1){
		res = "../";
	}else{
		res = "";	
	}
	return res;
}

