//set_rollovers
(function(A){jQuery.fn.set_rollovers=function(C){var D={extension:"_o",active_hover:true,hover_extension:"_h",active_extension:false,fade:false,menu:{},menu_type:"files"};if(C){jQuery.extend(D,C)}if(!D.active_extension){D.active_extension=D.hover_extension}var F=String(document.location);var E=false;var B=0;A.each(D.menu,function(G){if(D.menu_type=="files"){if(G.match(/|/)){menu_path_arr=G.split("|");for(k=0;k<menu_path_arr.length;k++){if(F.match(menu_path_arr[k])&&menu_path_arr[k].length>B){E=D.menu[menu_path_arr[k]];B=menu_path_arr[k].length}}}else{if(F.match(G)&&G.length>B){E=D.menu[G];B=G.length}}}else{if(D.menu_type=="nodes"){if(A(G).length){E=D.menu[G]}}}});return this.filter("[src*="+D.extension+".]").each(function(){var H=new Image;H.src=this.src.replace(D.extension+".",D.hover_extension+".");if(this.src.match(/[^\/]+$/)[0]==E){this.src=this.src.replace(new RegExp(D.extension+"(.[a-z]+)$"),D.active_extension+"$1");if(D.active_hover){A(this).hover(function(){this.src=this.src.replace(new RegExp(D.active_extension+"(.[a-z]+)$"),D.hover_extension+"$1")},function(){this.src=this.src.replace(new RegExp(D.hover_extension+"(.[a-z]+)$"),D.active_extension+"$1")})}}else{if(!D.fade){A(this).hover(function(){this.src=this.src.replace(new RegExp(D.extension+"(.[a-z]+)$"),D.hover_extension+"$1")},function(){this.src=this.src.replace(new RegExp(D.hover_extension+"(.[a-z]+)$"),D.extension+"$1")})}else{var G=A(this).wrap('<span style="position:relative; display:block;"></span>').parent();G.append('<img src="'+H.src+'" style="position:absolute; top:0; left:0;" />');G.find("> :last-child").hide();G.hover(function(){A("> img:last-child",this).fadeIn(D.fade)},function(){A("> img:last-child",this).fadeOut(D.fade)})}if(this.parentNode.nodeName.match(/^a$/i)){A(this).parent().focus(function(){A(">img",this).trigger("mouseover")}).blur(function(){A(">img",this).trigger("mouseout")})}else{if(this.parentNode.nodeName.match(/span/i)&&this.parentNode.parentNode.nodeName.match(/a/i)){A(this).parents("a").focus(function(){A("> span > img:last-child",this).fadeIn(D.fade)}).blur(function(){A("> span > :last-child",this).fadeOut(D.fade)})}}}})}})(jQuery);
//set_height
(function(A){A.fn.set_height=function(P){var G={items_per_row:false,one_height:false,delay:1000,group_by_parent:false};if(P){jQuery.extend(G,P)}if(A("#js_etalon").length){var N=A("#js_etalon").get(0)}else{var N=A("body").append('<span style="position:absolute;left:-9999px;top:0;" id="js_etalon">&nbsp;</span>').find("#js_etalon").get(0)}var E=function(S,R){for(var Q=0;Q<S.length;Q++){if(S[Q]==R){return }}S.push(R)};var B=this;var F=[];var L=[];var K=[];var J=function(){for(var S=0;S<F.length;S++){var R=0;var T=F[S][0].currentStyle?parseInt(F[S][0].currentStyle.paddingTop)+parseInt(F[S][0].currentStyle.paddingBottom):parseInt(document.defaultView.getComputedStyle(F[S][0],null).getPropertyValue("padding-top"))+parseInt(document.defaultView.getComputedStyle(F[S][0],null).getPropertyValue("padding-bottom"));for(var Q=0;Q<F[S].length;Q++){F[S][Q].style.height="auto";R=Math.max(F[S][Q].offsetHeight-T,R)}for(var Q=0;Q<F[S].length;Q++){F[S][Q].style.height=R+"px"}}};var M=function(){var Y=0;var W=0;var Q=null;var T=null;F[Y]=[];var Z=false;for(var U=0;U<B.length;U++){if(G.group_by_parent){Q=A(B[U]).parents(G.group_by_parent)[0];if(U>0&&Q!=T&&!Z){F[++Y]=[];W=0}T=Q}if(G.items_per_row){B[U].className+=" nb"+parseInt(W%G.items_per_row+1);if(!(W%G.items_per_row)&&W>0){F[++Y]=[];W=0;Z=true}}F[Y][W++]=B[U];Z=false}for(var U=0;U<F.length;U++){if(!F[U][0].offsetHeight){var X=F[U][0];while(X.style.display!="none"){X=X.parentNode}L.push(X)}for(var S=0;S<F[U].length;S++){var V=F[U][S].getElementsByTagName("img");for(var R=0;R<V.length;R++){E(K,V[R].src)}}}};if(B.length){M();var D=N.offsetHeight;var C=setInterval(function(){var S=N.offsetHeight;if(S!=D){D=S;J()}for(var R=0;R<L.length;R++){if(L[R].style.display!="none"){J();L=[];for(var Q=0;Q<F.length;Q++){if(!F[Q][0].offsetHeight){var T=F[Q][0];while(T.style.display!="none"){T=T.parentNode}L.push(T)}}}}},G.delay);J();if(K.length){var H=[];var O=0;for(var I=0;I<K.length;I++){H[I]=document.createElement("img");H[I].onload=function(){O++;if(O==K.length){J()}};H[I].src=K[I]}}}if(navigator.userAgent.match("MSIE 5.5")&&B.length){setTimeout(function(){main(B),0})}return this}})(jQuery);
//set_stripe
(function(a){a.fn.set_stripes=function(b){var c={};if(b){jQuery.extend(c,b)}return this.each(function(d){a(this).find("tbody>tr").each(function(e){a(this).removeClass("odd").removeClass("even").addClass((e%2?"even":"odd"))}).hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")})}).addClass("striped")}})(jQuery);
//set_tab
(function(a){a.fn.set_tab=function(m){var c={log:false,default_index:"index.html",jump_to_anchored_tab:true,toggles_wrapper:"",tabs_wrapper:"",speed:false,hide_first_title:false,double_click_hide:false,remember:true,active_image_ext:false};if(m){jQuery.extend(c,m)}var b=[];var e=[];var f=this.length;var l=String(window.location).match(c.default_index)?new RegExp("(.*)("+c.default_index+")$").exec(String(document.location.pathname))[1]:document.location.pathname;var d=String(window.location).match(/#\w+/)?/#([^???]*)/.exec(String(window.location))[1]:false;var g=0;function h(p,o){tabs=a(c.tabs_wrapper+" > div",b[p]);if(c.speed){tabs.filter(":eq("+e[p]+")").slideUp(c.speed,function(){tabs.filter(":eq("+o+")").show().css("visibility","hidden").slideDown(c.speed).css("visibility","visible");a(c.toggles_wrapper+" > ul a",b[p]).removeClass("active").filter(":eq("+o+")").addClass("active")})}else{a(c.toggles_wrapper+" > ul a:first-child",b[p]).removeClass("active").filter(":eq("+o+")").addClass("active");a(c.toggles_wrapper+" > ul a:first-child img",b[p]).each(function(q){if(q!=o){this.src=this.src.replace(new RegExp(c.active_image_ext[2]+"(.[a-z]+)$"),c.active_image_ext[0]+"$1")}else{this.src=this.src.replace(new RegExp("("+c.active_image_ext[0]+"|"+c.active_image_ext[1]+")(.[a-z]+)$"),c.active_image_ext[2]+"$2")}});if(e[p]==o&&c.double_click_hide&&tabs.filter(":eq("+o+")").css("display")!="none"){tabs.filter(":eq("+o+")").hide();a(c.toggles_wrapper+" > ul a",b[p]).filter(":eq("+o+")").removeClass("active")}else{tabs.filter(":eq("+e[p]+")").hide();tabs.filter(":eq("+o+")").show().addClass("active")}}if(c.log){var n=a(c.toggles_wrapper+" > ul a:eq("+o+")",b[p]).attr("href");a.ajax({type:"GET",url:n,dataType:"xml",processData:false})}}function j(){var n="";for(i=0;i<e.length;i++){n+=i+":"+e[i]+" "}a.cookie("tabs["+l+"]",n)}function k(){if(!c.remember){return false}tab_cookie=a.cookie("tabs["+l+"]");if(tab_cookie){tab_cookie_splited=tab_cookie.split(" ");for(i=0;i<tab_cookie_splited.length;i++){current_value=tab_cookie_splited[i].split(":");e[current_value[0]]=current_value[1]}}}k();return this.each(function(n){b[n]=this;a(c.tabs_wrapper+" > div",b[n]).hide();if(c.hide_first_title){a("> div",b[n]).each(function(){a("> *:eq(0)",this).filter("h1,h2,h3,h4,h5,h6").hide()})}a(c.toggles_wrapper+" > ul",this).addClass("toggles").find("li>a:first-child").each(function(p){if((a("> div:eq("+p+")",b[n]).attr("id")==d)&&d){default_tab=p}a("a[href$="+this.href.match(/#[^\?]*/)+"]").each(function(){this.tab_id=p;this.tabset_id=n});a("a[href$="+this.href.match(/#[^\?]+/)+"]").click(function(){h(this.tabset_id,this.tab_id);e[this.tabset_id]=this.tab_id;if(c.remember){j()}this.blur();if(!navigator.userAgent.match("MSIE 5.5")){if(a(".toggles a[href*="+this.href.match(/#[^\?]+/)[0]+"]").offset()["top"]>(a(window).scrollTop()+a(window).height())){window.scrollTo(0,a(".toggles a[href*="+this.href.match(/#[^\?]+/)[0]+"]").offset()["top"])}}return false})});if(a("div#"+d,this).length>0&&d!=""){e[n]=a(c.tabs_wrapper+" > div",this).index(a("div#"+d,this)[0]);var o=this;if(c.jump_to_anchored_tab){window.setTimeout(function(){window.scrollTo(0,a(o).offset()["top"])},0)}}else{e[n]=e[n]||0}if(this.className.match(/default\[(\d+)\]/)){e[n]=parseInt(RegExp.$1)-1}h(n,e[n]);if(n+1==f&&c.remember){j()}}).addClass("enabled").find(c.tabs_wrapper+" > div").addClass("tab-contents")}})(jQuery);

$(document).ready(function(){

//set_rollovers
$('img,input[type="image"]').set_rollovers({ menu: {
"/":"gnavi_home_o.gif",
"/guide/":"gnavi_guide_o.gif",
"/center/":"gnavi_center_o.gif",
"/room/":"gnavi_room_o.gif",
"/life/":"gnavi_life_o.gif",
"/information/":"",
"/students/":"",
"/business/":"",
"/contact/":"",
"/sitemap/":""
} });

//hover
$('input.btn01').hover(
function(){$(this).css({'background-position':'left -40px'});},
function(){$(this).css({'background-position':'left top'});}
);

//set_height
$('div.flow>ul>li>div.block>div.blockInner').set_height({items_per_row:3,group_by_parent:'ul'});
$('ul.uList05>li>div>div.inner').set_height({items_per_row:2,group_by_parent:'ul'});
$('ul.uList06>li').set_height({items_per_row:2,group_by_parent:'ul'});
$('div.topBlock01>.col').set_height();
$('dl.dList02>dt,dl.dList02>dd').set_height({items_per_row:2,group_by_parent:'dl'});

//set_stripe
$('table.table01').set_stripes();

//set_tab
$('.tab-holder').set_tab();

//local navigation active
$(function(){
   var _path = document.location.pathname;
   var _localNaviArea = $('#localNavi>.block01>ul>li');
   _localNaviArea.each(function(){
      $('ul', this).hide();
      $('ul a[href="'+_path+'"]', this).parent('li').addClass('current').parent('ul').show();
      $('>a[href="'+_path+'"]', this).parent('li').addClass('current category').children('ul').show();
      $('>ul>li>a[href="'+_path+'"]', this).parent('li').parent('ul').parent('li').addClass('current').children('ul').show();
   });
});

});

