var mPath="/";var useCustum=0;Element.implement({hover:function(b,a){this.addEvents({mouseenter:b,mouseleave:a})}});var Site={start:function(){Site.appearText()},appearText:function(){var d=0;var b=$$(".container, .works");var c=[];var a=[];b.each(function(g,f){d+=250;var j=g.getStyles("margin-left","opacity");var h={opacity:0};c[f]=new Fx.Morph(g,{duration:500,transition:Fx.Transitions.backOut,wait:false}).set(h);c[f].start.delay(d,c[f],j)},this)}};window.addEvent("domready",function(){$$("h1:nth-child(first),h2:nth-child(first)").setStyle("margin-top","0");var b=new Fx.Scroll($(document.body));$$(".pageTop").addEvent("click",function(c){c.stop();b.toTop()});if($("comments-form")){commentAjax($("comments-form"),$("comment-greeting"))}if(window.ReMooz){$$(".thumb a, #slide li a, .entry-image a").each(function(c){new ReMooz(c,{centered:true})})}var a=new Tips(".tooltip",{className:"tooltips",text:"rel"});a.addEvents({show:function(d,c){d.fade("in")},hide:function(d,c){d.fade("out")}});blankLink();acc();readCookie();if(useCustum){$("page-setting").fade("hide");$$(".switch").addEvent("click",function(c){c.stop();var d=this.getPosition();if($("page-setting")){$("page-setting").fade("toggle")}})}});window.addEvent("load",function(){replaceMedia();if(Browser.Platform.ipod){iPhone()}if($("slideW")){var a=new SimpleSlide("slide",{childTag:"li",control:true,mode:"fade",autoPlay:false})}$$(".works-image img").each(function(b){var c=b.getSize();if(c.x.toInt()>430){b.setProperties({width:528})}});if($("loadcss")){$("loadcss").destroy(),$$(".content").setStyle("visibility","visible")}Site.start()});var commentAjax=function(c,a){var b=c;var d=a;b.addEvent("submit",function(f){f.stop();this.set("send",{evalScripts:true,onRequest:function(){d.set("html",'<img src="http://rocoz.net/css/img/spiner.gif" align="absmiddle" />&nbsp;sending...')},onComplete:function(){d.set("html","send complete!!")},onSuccess:function(h){var i=new Element("div",{html:h});var g=i.getElement("div[id=messege]");d.set("html",g.innerHTML);if(g.hasClass("ERROR")){b.destroy()}b.preview.value="";mtEntryOnUnload()}});this.send()})};function replaceMedia(){$$("a[href$=.mp3]").each(function(a){if(a.rel){return}if(Browser.Platform.ipod){iPhoneReplace(a,a.href)}else{replaceMediaFile(a,"100%",20)}});$$("a[href$=.flv]").each(function(b){if(b.rel){return}var a=b.getElement("img");if(!a){a=b.getParent().getElement("img")}replaceMediaFile(b,a.width,a.height,a.src,b);a.destroy()});$$("a[href$=.swf]").each(function(c){if(c.rel){return}var b=c.getElement("img");if(!b){b=c.getParent().getParent().getElement("img")}var a=new Swiff(c,{width:"100%",height:b.height,params:{wMode:"opaque",bgcolor:"#000",movie:c}}).replaces(c);b.destroy()});$$("a[href*=http://vimeo.com/]").each(function(f){if(f.rel){return}var a='100%';var d=400;if(f.getParent().hasClass("entry-image")){a=320;d=260}var b=f.href.split("vimeo.com/");var g="http://vimeo.com/moogaloop.swf?clip_id="+b[1]+"&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=c9ff23&amp;fullscreen=1";var c=new Swiff(g,{width:a,height:d,params:{movie:g}}).replaces(f)});$$("a[href*=http://www.youtube.com/watch]").each(function(f){if(f.rel){return}var a='100%';var d=400;if(f.getParent().hasClass("entry-image")){a=320;d=260}var b=f.href.split("v=");var g="http://www.youtube.com/v/"+b[1]+"&color1=0x3a3a3a&color2=0x999999&border=1";var c=new Swiff(g,{width:a,height:d,params:{wMode:"opaque",movie:g}}).replaces(f)})}function replaceMediaFile(g,a,d,b,c){var f=new Swiff("/js/NonverBlaster.swf",{id:"swf_player",width:a,height:d,params:{wmode:"opaque",bgcolor:"#000",movie:"/js/NonverBlaster.swf",allowfullscreen:"true",allowscriptaccess:"always"},vars:{mediaURL:g.href,teaserURL:b,controlColor:16777215}}).replaces((c)?c:g)}function iPhoneReplace(c,b){var a=new Element("embed",{src:b,width:"100%",height:32}).replaces(c)}var bLink;function blankLink(){var a=location.hostname;var b=$(document.body).getElements("a[href^=http://]");b.each(function(c){if(c.getProperty("href").contains(a)){return false}else{var d=new Element("span",{"class":"blank"});d.inject(c);c.addEvent("click",function(f){if(bLink=="_blank"){f.stop();window.open(this.getProperty("href"))}})}})}function iPhone(){$$("img").each(function(a){var b=a.getSize();if(b.x>300){a.setProperties({width:"100%",height:""})}});$$(".next").set({html:"NEXT &raquo;"});$$(".prev").set({html:"&laquo; PREV"})}function acc(){var a=new Fx.Accordion($$(".tog"),$$(".tog-elm"),{fps:100,transition:Fx.Transitions.Quart.easeInOut})}function lastCall(b){var d=new Element("div",{"class":"widget-lastfm"}).inject($("main"));var a=new Element("h3",{html:'<a href="http://www.lastfm.jp/user/c-love-r">My Last.fm</a>'}).inject(d);var c=new Element("ul",{id:"lastfm"}).inject(d);b.recenttracks.each(function(i){var f=new Element("li",{"class":"clearfix"}).addEvent("click",function(){open(i.url)}).inject(c).fade("hide");f.hover(function(){this.fade(0.5)},function(){this.fade(1)});var g=new Element("img",{src:(i.image_medium)?i.image_medium:"http://rocoz.net/css/img/no-img.gif",width:60,height:60,align:"absmiddle"}).inject(f);var j=new Element("dl",{"class":"last-data"}).inject(f);var h=(i.nowplaying)?'<dt class="nowplaying">NOW PLAYING</dt>':"";j.set({html:h+'<dt class="last-title">'+i.name+'</dt><dd class="last-artist">'+i.artist["name"]+"</dd>"}).inject(f);f.fade("in")})}function lastFm(){new Request.JSONP({url:"http://lastfm-api-ext.appspot.com/2.0/",noCache:true,data:{method:"user.getRecentTracks",limit:"5",user:"c-love-r",outtype:"js",api_key:"265bc5150aab9f6a6dc2b40384763e2f"},onComplete:lastCall.bind(this)}).send()}function readCookie(){var a=Cookie.read("color");var c=function(){if($("addCss")){$("addCss").destroy()}if(a){new Asset.css("http://rocoz.net/css/"+a+".css",{id:"addCss"})}else{a="default"}$$("#color a").each(function(g){if(g.title==a){g.getParent().addClass("active")}else{g.getParent().removeClass("active")}})};$$("#color a").addEvent("click",function(g){g.stop();$("page-setting").fade("toggle");a=this.getProperty("title");Cookie.write("color",a,{duration:7,path:mPath});c()});c();var d=Cookie.read("fontSize");var b=function(){var g;switch(d){case"S":g="65%";break;case"L":g="100%";break;default:d="M";g="85%";break}$("wrap").setStyle("font-size",g);$$("#font-size a").each(function(h){if(h.title==d){h.getParent().addClass("active")}else{h.getParent().removeClass("active")}})};$$("#font-size a").addEvent("click",function(g){g.stop();$("page-setting").fade("toggle");d=this.getProperty("title");Cookie.write("fontSize",d,{duration:7,path:mPath});b()});bLink=Cookie.read("linkOpen");if(!bLink){bLink="_blank"}var f=function(){$$("#link-open a").each(function(g){if(g.title==bLink){g.getParent().addClass("active")}else{g.getParent().removeClass("active")}})};$$("#link-open a").addEvent("click",function(g){g.stop();$("page-setting").fade("toggle");bLink=this.getProperty("title");Cookie.write("linkOpen",bLink,{duration:7,path:mPath});f()});f();b()}function createCmenu(){var a;context=new ContextMenu({targets:"*",menu:"page-setting",actions:{copy:function(b,c){alert(b.get("text"))},cut:function(b){b.destroy();a=b},paste:function(b){if(a){a.inject(b);a=null}}},offsets:{x:2,y:2}})}try{Window.disableImageCache()}catch(e){}try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};

