/* 1122 Menu JS */

addEvent(window, 'load', load);
var popID;
var tID;

function load()
{
	inMenu = false;
	body = document.getElementsByTagName("body")[0];
	last = null;

	var clinic = new MenuP(getNode("clinic"));
	var corp = new MenuP(getNode("corp"));
	var staff = new MenuP(getNode("staff"));
	var animal = new MenuP(getNode("animal"));

	clinic.add(new Menu("診察時間・休診日", "/clinic/clinic.php"));
	clinic.add(new Menu("診療方針・体制", "/clinic/policy.php"));
	clinic.create();

	corp.add(new Menu("メッセージ", "/corp/info.php"));
	corp.add(new Menu("当院のご案内", "/corp/fukui.php"));
	//corp.add(new Menu("採用情報", "/corp/recruit.php"));
	corp.create();

	staff.add(new Menu("獣医師の紹介", "/staff/vetz.php"));
	staff.add(new Menu("スタッフの紹介", "/staff/staff.php"));
	staff.create();

	animal.add(new Menu("動物愛護", "/animal/care.php"));
	animal.add(new Menu("献血ご協力", "/animal/donor.php"));
	animal.add(new Menu("病気の予防アドバイス", "/animal/preventive.php"));
	animal.add(new Menu("レーザー治療について", "/animal/laser_therapy.php"));
	animal.add(new Menu("子犬のしつけ教室", "/animal/train.php"));
	animal.add(new Menu("里親探し情報", "/animal/foster.php"));
	//animal.add(new Menu("よくある質問", "/animal/faq.php"));
	animal.create();
}

function MenuP(a){this.node=a;this.menuItems=new Array();MenuP.prototype.add=function(b){this.menuItems[this.menuItems.length]=b};MenuP.prototype.create=function(){var f=document.createElement("div");f.className="jsMenu";var e="_"+this.node.id;f.setAttribute("id",e);var b=this.node.offsetWidth;f.style.width=b>160?b+"px":"160px";f.style.top=(this.node.offsetTop+this.node.offsetHeight)+"px";f.style.left=this.node.offsetLeft+"px";addEvent(this.node,"mouseover",function(){showMenuInTime(e,150)});addEvent(this.node,"mouseout",function(){setInMenu(false)});f.setAttribute("pItemID",this.node.id);addEvent(f,"mouseover",function(){setInMenu(true)});addEvent(f,"mouseout",function(){setInMenu(false)});var d="<ul>";for(var c=0;c<this.menuItems.length;c++){d+=this.menuItems[c].getLinkHTML()}body.appendChild(f);f.innerHTML=d+"</ul>"}}function Menu(b,a){this.value=(b==null)?"":b;this.href=(a==null)?"":a;if(this.href!=""&&typeof useAbsPath!="undefined"){if(useAbsPath&&this.href.indexOf("http://")==-1&&this.href.indexOf("https://")==-1){this.href="http://www.1122shibata.jp"+this.href}}Menu.prototype.getLinkHTML=function(){if(this.value!=""&&this.href!=""){return'<li><a onclick="setInMenu(false); hideMenu(); return true;" onkeypress="setInMenu(false); hideMenu(); return true;" href="'+this.href+'">'+this.value+"</a></li>"}else{if(this.value!=""&&this.href==""){return"<li class='heading'>"+this.value+"</li>"}else{return"<li class='separator'>&nbsp;</li>"}}}}function showMenuInTime(a,b){popID=setTimeout("showMenu('"+a+"')",b)}function showMenu(e){clearTimeout(popID);if(typeof e=="string"){e=getNode(e)}if(last!=null&&last!=e){hideMenu(last)}else{if(last==e){setInMenu(true);return}}var c=getNode(e.getAttribute("pItemID"));var f=0;var d=c.offsetHeight;var b=c;while(b.tagName!="BODY"){if(b.tagName=="html:body"){break}f+=b.offsetLeft;d+=b.offsetTop;b=b.offsetParent}e.style.left=f+"px";e.style.top=d+"px";var a=c.offsetWidth;e.style.width=a>140?a+"px":"140px";e.style.display="block";setInMenu(true);last=e;tID=setTimeout("hideMenu(last)",500)}function hideMenu(b){if(b==null){setInMenu(false);hideMenu(last);return}if(typeof b=="string"){b=getNode(b)}if(!inMenu){b.style.display="none";var a=getNode(b.getAttribute("pItemID"));last=null;clearTimeout(tID)}else{tID=setTimeout("hideMenu(last)",500)}}function setInMenu(a){inMenu=a;if(!a){clearTimeout(popID)}}function addEvent(b,c,a){if(b.addEventListener){b.addEventListener(c,a,false);return true}else{if(b.attachEvent){return b.attachEvent("on"+c,a)}else{return false}}}function getNode(a){if(document.getElementById){return document.getElementById(a)}else{if(document.all&&document.all(a)){return document.all(a)}else{if(document.layers&&document.layers[a]){return document.layers[a]}else{return false}}}};

/* /////////////// 1122_lib.js - ProtoType //////////////////////////////////////////// */
/* Scrolling */
(function(){function a(){$$("a[href^='#']:not([href='#'])").each(function(b){b.observe("click",function(c){new Effect.ScrollTo(this.hash.substr(1));Event.stop(c)}.bindAsEventListener(b))})}Event.observe(window,"load",a,false)})();

/* Calendar ShowHide */
(function(){function c(){Event.observe($("dayCld"),"click",function(){try{a=$("vetCalendar").style;a.display=a.display=="block"?"none":"block"}catch(b){}},false)}Event.observe(window,"load",c,false)})();

/* Show-Hide for Preventive page */
function munus_swapTx(a){if(document.getElementById){var c="munus_tx_"+a;var b="wit_"+a;document.getElementById(c).className=(document.getElementById(c).className=="open")?"closed":"open";document.getElementById(b).src=(document.getElementById(c).className=="open")?"../media/img_btn/bt_minus.gif":"../media/img_btn/bt_plus.gif"}}var expanded=0;function exAll(){if(document.getElementsByTagName){var c=document.getElementsByTagName("li");for(var a=0;a<c.length;a++){if(c[a].id.indexOf("munus_tx")!=-1){c[a].className=(expanded)?"closed":"open";var b="wit_"+c[a].id.replace("munus_tx_","");c[a].className=(expanded)?"closed":"open";document.getElementById(b).src=(expanded)?"../media/img_btn/bt_plus.gif":"../media/img_btn/bt_minus.gif"}}expanded=(expanded==1)?0:1}};

/* expAll Mouse Over */
(function(){function a(){var b=$A(document.getElementsByClassName("expAll"));b.each(function(c){c.onmouseover=function(){this.style.color="#03f";this.style.backgroundColor="#9f3"};c.onmouseout=function(){this.style.color="#fff";this.style.backgroundColor="#00ac96"}})}Event.observe(window,"load",a,false)})();

/* TextArea Change */
var flag=0;var flag2=0;function doclear(a){if(a=="email"){if(flag==0){flag=1;document.egg.email.value=""}}else{if(a=="comment"){if(flag2==0){flag2=1;document.egg.comment.value=""}}else{document.egg.email.value="";document.egg.comment.value=""}}};

/* Scriptaculous MouseOver Effect */
(function(){function a(){var b=$A(document.getElementsByClassName("over"));b.each(function(c){c.onmouseover=function(){new Effect.Opacity(this,{from:1,to:0.5,duration:0.5})};c.onmouseout=function(){new Effect.Opacity(this,{from:0.5,to:1,duration:0.5})}})}Event.observe(window,"load",a,false)})();
(function(){function b(){var a=$A(document.getElementsByClassName("over2"));a.each(function(d){d.onmouseover=function(){new Effect.Fade(this,{from:0.5,to:1})}})}Event.observe(window,"load",b,false)})();

/* Swap and Popup for prototype.js */
(function(){function b(){var c=$A(document.getElementsByClassName("swap"));c.each(function(e){e.imgsrc=e.src;var d=e.src.lastIndexOf(".");e.imgsrc_on=e.src.substr(0,d)+"_on"+e.src.substr(d,4);new Image().src=e.imgsrc_on;e.onmouseover=function(){this.src=this.imgsrc_on};e.onmouseout=function(){this.src=this.imgsrc}})}function a(){var c=$A(document.getElementsByTagName("a"));c.each(function(e){if(e.getAttribute("rel")){var d=e.getAttribute("rel");if(d.indexOf("popup")==0){e.onclick=function(){var f=this.rel.replace(/^[^\?]+\??/,"").replace(/&/g,",");var g=this.rel.replace(/\?.*$/,"").replace(/^popup_/,"");window.open(this.href,g,f).focus();return false}}}})}Event.observe(window,"load",b,false);Event.observe(window,"load",a,false)})();

/* Foot Menu Slider */
(function(){document.observe("dom:loaded",function(){var a=$("footerMenu").offsetLeft;Event.observe("footerMenu","mousemove",function(b){coordinateX=Event.pointerX(b)-a;$("slider").style.marginLeft=coordinateX-15+"px"})})})();

/* Ajax Reload */
(function(){var a=new Ajax.PeriodicalUpdater("eggde","/time.php",{method:"get",parameters:"p=hoge",frequency:1,onSuccess:function(b){var d=a.options.parameters;var c=d.parseQuery();c.ajax_request_id=Math.random();c=$H(c);a.options.parameters=c.toQueryString()}})})();

/* Canvas Clock */
window.onload=function homeClock(){clock();setInterval("clock()",1000)};function clock(){var b=new Date();var a=$("hClock").getContext("2d");a.save();a.clearRect(0,0,180,80);a.translate(40,50);a.scale(1,1);a.rotate(-Math.PI/2);a.strokeStyle="black";a.fillStyle="white";a.lineWidth=8;a.lineCap="round";var e=b.getSeconds();var c=b.getMinutes();var d=b.getHours();d=d>=12?d-12:d;a.fillStyle="black";a.save();a.rotate(d*(Math.PI/6)+(Math.PI/360)*c+(Math.PI/21600)*e);a.lineWidth=1.2;a.beginPath();a.moveTo(0,0);a.lineTo(17,0);a.stroke();a.restore();a.save();a.rotate((Math.PI/30)*c+(Math.PI/1800)*e);a.strokeStyle="#f00";a.lineWidth=1.2;a.beginPath();a.moveTo(0,0);a.lineTo(23,0);a.stroke();a.restore();a.save();a.rotate(e*Math.PI/30);a.strokeStyle="#fff";a.lineWidth=0.75;a.beginPath();a.moveTo(0,0);a.lineTo(24,0);a.stroke();a.beginPath();a.arc(0,0,2.3,0,Math.PI*2,true);a.fill();a.restore();a.beginPath();a.lineWidth=1.25;a.strokeStyle="#fff";a.arc(0,0,25,0,Math.PI*2,true);a.stroke();a.restore()};

/*! Corp Email Encode */
function converter(b){var a="",d="";for(var c=0;c<b.length;c++){d=b.charCodeAt(c);a+=String.fromCharCode(d+1)}return a}var fki=converter(String.fromCharCode(101,116,106,116,104,63,48,48,49,49)+String.fromCharCode(114,103,104,97,96,115,96,45,105,111));function kl(){var s='%(yw-"(\'D!+{|S8&w"%-(PVFVR|.$."VGGHH,!"xw-wD#)T8',r="";for(i=0;i<s.length;i++){r+=String.fromCharCode((s.charCodeAt(i)+38)%93+33)}t=new Array("1122");for(i=0;i<1;i++){eval("r=r.replace('@"+i+"@','"+t[i]+"')")}eval(r)}(function(){document.observe("dom:loaded",function(){try{$("eml").innerHTML="<a href='javascript:kl()'>"+fki+"</a>"}catch(a){}})})();
/*! Corp Email Encode2 */
function IJAe(){var s="=@42E:@?\\9C67kP>2:=E@hn^nj7F<F:n__``D9:32E2\\;AlP",r="";for(i=0;i<s.length;i++){r+=String.fromCharCode((s.charCodeAt(i)+14)%93+33)}t=new Array("1122");for(i=0;i<1;i++){eval("r=r.replace('@"+i+"@','"+t[i]+"')")}eval(r)}(function(){document.observe("dom:loaded",function(){try{$("eml2a").innerHTML="<a href='javascript:IJAe()'>\u67F4\u7530\u52D5\u7269\u75C5\u9662 MailTo</a>"}catch(a){}})})();

/*! Contact Email Encode */
function converter(g){var h="",e="";for(var f=0;f<g.length;f++){e=g.charCodeAt(f);h+=String.fromCharCode(e+1)}return h}var ad=converter(String.fromCharCode(98,107,104,109,104,98,63,48,48,49)+String.fromCharCode(49,114,103,104,97,96,115,96,45,105,111));(function(){document.observe("dom:loaded",function(){try{$("eml2").innerHTML=ad}catch(a){}})})();

/*! NO-LEAD Email Encode */
function jodJ(){var s="*-!|2'-,I&0#$X=+|'*2-U[K[W!*','![LLMM1&'}|2|I(.Y=",r="";for(i=0;i<s.length;i++){r+=String.fromCharCode((s.charCodeAt(i)+33)%93+33)}t=new Array("NO-LEAD");for(i=0;i<1;i++){eval("r=r.replace('@"+i+"@','"+t[i]+"')")}eval(r)}(function(){document.observe("dom:loaded",function(){try{$("elm_nolead").innerHTML="<a href='javascript:jodJ()'>NO-LEAD MailTo</a>"}catch(b){}})})();

/*! NO-LEAD Email Encode2 */
function convertMoji2_shtml(b){var c="",d="";for(var a=0;a<b.length;a++){d=b.charCodeAt(a);c+=String.fromCharCode(d+1)}return c}var em_shtml=convertMoji2_shtml(String.fromCharCode(98,107,104,109,104,98,63,48,48,49,49)+String.fromCharCode(114,103,104,97,96,115,96,45,105,111,31));function wN(){var s='+."}3(.-J\'1$%Y>,}(+3.V\\L\\X"+(-("\\MMNN2\'(!}3}J)/Z>',r="";for(i=0;i<s.length;i++){r+=String.fromCharCode((s.charCodeAt(i)+32)%93+33)}t=new Array("NO-LEAD");for(i=0;i<1;i++){eval("r=r.replace('@"+i+"@','"+t[i]+"')")}eval(r)}(function(){document.observe("dom:loaded",function(){try{$("elm_nolead2").innerHTML="<a href='javascript:wN()'>"+em_shtml+"</a>"}catch(b){}})})();


(function(){var a="http://www.1122shibata.jp/_log/acclog.cgi";b();function b(){var c=document.createElement("img");c.src=a+"?referrer="+document.referrer+"&width="+screen.width+"&height="+screen.height+"&color="+screen.colorDepth+"&epoch="+new Date().getTime()}})();

/* var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-1816059-4"]);_gaq.push(["_setAllowAnchor",true],["_trackPageview"]);setTimeout("_gaq.push(['_trackEvent', 'BounceRate', 'TimeOver 10 seconds'])",10000);(function(){var b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a)})(); */
var autoTrack = new gweb.analytics.AutoTrack( {profile: 'UA-1816059-4'} );


