Realguide={};if(!console){var console=Class.create();Object.extend(console,{log:function(a){},info:function(a){},warn:function(a){},error:function(a){},dir:function(a){}})}Realguide.realPlayerDetector=Class.create();Object.extend(Realguide.realPlayerDetector,{detectIE:function(a){if(window.ActiveXObject){var c=["rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer"];var f=null;for(var b=0;b<c.length;b++){try{f=new ActiveXObject(c[b])}catch(d){continue}if(f){break}}return(f)?a:""}},detectNS:function(a,c){var b="audio/x-pn-realaudio-plugin";var d="";if(c.indexOf(b)!=-1){if(navigator.mimeTypes[b].enabledPlugin!=null){d=a+","}}return d},isInstalled:function(){var f=navigator.userAgent.toLowerCase();var e=(f.indexOf("msie")!=-1);var b=(navigator.appName.indexOf("Netscape")!=-1);var d=((f.indexOf("win")!=-1)||(f.indexOf("32bit")!=-1));var g=(f.indexOf("mac")!=-1);if(e&&d){pluginlist=Realguide.realPlayerDetector.detectIE("RealPlayer")}if(b||!d){var c="";for(var a=0;a<navigator.mimeTypes.length;a++){c+=navigator.mimeTypes[a].type.toLowerCase()}pluginlist=Realguide.realPlayerDetector.detectNS("RealPlayer",c)}pluginlist+=navigator.javaEnabled()?"Java,":"";if(pluginlist.length>0){pluginlist=pluginlist.substring(0,pluginlist.length-1)}if(pluginlist.indexOf("RealPlayer")==-1){return false}return true}});Realguide.helper={};Realguide.helper.Array=Class.create();Object.extend(Realguide.helper.Array,{shuffule:function(a){var d=a.length;while(d){var b=Math.floor(Math.random()*d);var c=a[--d];a[d]=a[b];a[b]=c}return a}});Realguide.topPageModule=Class.create({initialize:function(c){if(self.location.pathname=="/"||self.location.pathname.startsWith("/index.")){this._leftTrCode="tr=left_supertop";var b=new Date();var d="d="+b.getFullYear()+(b.getMonth()+1)+b.getDate()+b.getHours();var a="http://"+self.location.host+c+"?"+d;var e=new JKL.ParseXML(a);e.async(this._updateModule.bind(this));e.parse()}else{if(self.location.pathname=="/welcome/"||self.location.pathname.startsWith("/welcome/index.")){this._leftTrCode="tr=left_welcome";var b=new Date();var d="d="+b.getFullYear()+(b.getMonth()+1)+b.getDate()+b.getHours();var a="http://"+self.location.host+c+"?"+d;var e=new JKL.ParseXML(a);e.async(this._updateModule.bind(this));e.parse()}}},_updateModule:function(a){a.pickup.partner.each(function(b){switch(b.id){case"showbiz":case"timewarp":idx=2;break;case"moviecollection":idx=1;break;case"music":idx=0;break;case"gravure":idx=3;break}this._updatePart(idx,b.content)}.bind(this))},_updatePart:function(a,d){var c=$$("div#leftContent ul.list01")[a];var b=0;d.each(function(f,e){if(b>2){throw $break}var g=c.down("li",b);glue=(f.link.include("?"))?"&":"?";g.down("a",0).href=f.link+glue+this._leftTrCode;g.down("a",1).href=f.link+glue+this._leftTrCode;g.down("a",1).update(f.short_title.sub(/[^\.]\.\.$/,"..."));g.down("img.thum").src=f.thumbnail;g.down("img.thum").alt=f.title;g.down("img.icon").width=18;g.down("img.icon").height=16;switch(f.type){case"photo":g.down("img.icon").src="/image/pages/icon_picture.gif";g.down("img.icon").alt="写真";break;case"video":g.down("img.icon").src="/image/pages/icon_movie.gif";g.down("img.icon").alt="動画";break;case"photo|video":case"video|photo":g.down("img.icon").src="/image/pages/icon_both.gif";g.down("img.icon").alt="動画・写真";g.down("img.icon").width=38}b++}.bind(this))}});Realguide.categoryPageModule=Class.create({initialize:function(c){var b=new Date();var d="d="+b.getFullYear()+(b.getMonth()+1)+b.getDate()+b.getHours();var a=c+"?"+d;var e=new JKL.ParseXML(a);e.async(this._updateModule.bind(this));e.parse()},_updateModule:function(b){var a;if(self.location.pathname.startsWith("/movie")){this._mainTrCode="tr=main_movietop";a=$A();b.summary.genre.each(function(e,d){if(e.genre_id==1){a[0]=e.released.content[0];a[1]=e.upcoming.content[0];a[2]=e.upcoming.content[1]}else{if(e.genre_id==5){a[3]=e["new"].content[0];a[4]=e["new"].content[1]}}})}else{if(self.location.pathname.startsWith("/showbiz")){this._mainTrCode="tr=main_showbiztop";a=b.summary.featured.content;a[0].copyright="(C) "+a[0].copyright}else{if(self.location.pathname.startsWith("/selection")){this._mainTrCode="tr=main_selectiontop";a=b.summary.featured.content;var c=Math.ceil(Math.random()*6);c=(!c)?c+1:c;a=a.slice(c-1,c);a[1]=b.summary.featured.content[6];a[2]=b.summary.featured.content[7];a[3]=b.summary.featured.content[8];a[4]=b.summary.featured.content[9]}else{if(self.location.pathname.startsWith("/gravure")){this._mainTrCode="tr=main_gravuretop";a=b.summary.featured.content}}}}this._updateTopPart(a);if(self.location.pathname.startsWith("/movie")){this._leftTrCode="tr=left_movietop";b.summary.genre.each(function(e,d){switch(e.genre_id){case"1":this._updateListPart(0,e.released.content.slice(1,4));this._updateListPart(1,e.upcoming.content.slice(2,5));break;case"4":this._updateListPart(3,e.upcoming.content.slice(0,3));break;case"5":this._updateListPart(2,e["new"].content.slice(2,5));break}}.bind(this))}else{if(self.location.pathname.startsWith("/showbiz")){this._leftTrCode="tr=left_showbiztop";b.summary.genre.each(function(e,d){switch(e.genre_id){case"3":this._updateListPart(0,e["new"].content.slice(0,3));this._updateListPart(1,e["new"].content.slice(3,6));break;case"9":this._updateListPart(2,e["new"].content.slice(0,3));this._updateListPart(3,e["new"].content.slice(3,6));break}}.bind(this))}else{if(self.location.pathname.startsWith("/selection")){this._leftTrCode="tr=left_selectiontop";b.summary.genre.each(function(e,d){switch(e.genre_id){case"6":var f=Realguide.helper.Array.shuffule(e["new"].content);this._updateListPart(0,f.slice(0,3));this._updateListPart(1,f.slice(3,6));break;case"4":this._updateListPart(2,e["new"].content.slice(0,3));break}}.bind(this))}else{if(self.location.pathname.startsWith("/gravure")){this._leftTrCode="tr=left_gravuretop";this._updateListPart(0,b.summary.genre["new"].content.slice(0,3));this._updateListPart(1,b.summary.genre["new"].content.slice(3,6));this._updateListPart(2,b.summary.genre["new"].content.slice(6,9));this._updateListPart(3,b.summary.genre["new"].content.slice(9,12));this._updateListPart(4,b.summary.genre["new"].content.slice(12,15))}}}}},_updateTopPart:function(d){var b=$("mainPicture");var c=$("subPicture");mainInfo=d.shift();glue=(mainInfo.link.include("?"))?"&":"?";b.down("a",0).href=mainInfo.link+glue+this._mainTrCode;b.down("a",1).href=mainInfo.link+glue+this._mainTrCode;b.down("img").src=mainInfo.category_big_image;b.down("p.title a").update(mainInfo.short_title.sub(/[^\.]\.\.$/,"..."));b.down("p.detail").update(mainInfo.copyright);b.down("img.icon").width=18;b.down("img.icon").height=16;switch(mainInfo.type){case"photo":b.down("img.icon").src="/image/pages/icon_picture.gif";b.down("img.icon").alt="写真";break;case"video":b.down("img.icon").src="/image/pages/icon_movie.gif";b.down("img.icon").alt="動画";break;case"photo|video":case"video|photo":b.down("img.icon").src="/image/pages/icon_both.gif";b.down("img.icon").alt="動画・写真";b.down("img.icon").width=38}var a=0;d.each(function(f,e){if(a>4){throw $break}eachList=c.down("li",a);glue=(f.link.include("?"))?"&":"?";eachList.down("a",0).href=f.link+glue+this._mainTrCode;eachList.down("a",1).href=f.link+glue+this._mainTrCode;eachList.down("a",1).update(f.short_title.sub(/[^\.]\.\.$/,"..."));eachList.down("img.thum").src=f.category_small_image;eachList.down("img.thum").alt=f.title;eachList.down("img.icon").width=18;eachList.down("img.icon").height=16;switch(f.type){case"photo":eachList.down("img.icon").src="/image/pages/icon_picture.gif";eachList.down("img.icon").alt="写真";break;case"video":eachList.down("img.icon").src="/image/pages/icon_movie.gif";eachList.down("img.icon").alt="動画";break;case"photo|video":case"video|photo":eachList.down("img.icon").src="/image/pages/icon_both.gif";eachList.down("img.icon").alt="動画・写真";eachList.down("img.icon").width=38}a++}.bind(this))},_updateListPart:function(a,d){var c=$$("div#leftContent ul.list01")[a];var b=0;d.each(function(f,e){if(b>2){throw $break}var g=c.down("li",b);glue=(f.link.include("?"))?"&":"?";g.down("a",0).href=f.link+glue+this._leftTrCode;g.down("a",1).href=f.link+glue+this._leftTrCode;g.down("a",1).update(f.short_title.sub(/[^\.]\.\.$/,"..."));g.down("img.thum").src=f.thumbnail;g.down("img.thum").alt=f.title;g.down("img.thum").width=f.thumbnail_width;g.down("img.thum").height=f.thumbnail_height;g.down("img.thum").setStyle("margin-top:"+(108-f.thumbnail_height)/2+"px;");g.down("img.icon").width=18;g.down("img.icon").height=16;switch(f.type){case"photo":g.down("img.icon").src="/image/pages/icon_picture.gif";g.down("img.icon").alt="写真";break;case"video":g.down("img.icon").src="/image/pages/icon_movie.gif";g.down("img.icon").alt="動画";break;case"photo|video":case"video|photo":g.down("img.icon").src="/image/pages/icon_both.gif";g.down("img.icon").alt="動画・写真";g.down("img.icon").width=38}b++}.bind(this))}});Realguide.synopsisPageModule=Class.create({initialize:function(){if(self.location.pathname.include("synopsis")){if(!Realguide.realPlayerDetector.isInstalled()){$("mainEmbeded").update('<p>動画をお楽しみいただくにはRealPlayerが必要です。</p><a href="http://jp.real.com/downloadRP/download1.html?src=jp_rg_inst_rp11" target="_blank"><img class="rollover" height="72" width="323" alt="インストールはこちら" src="/image/pages/btn_007.gif"/></a>')}}}});Realguide.headerModule=Class.create({initialize:function(){var a=new Date();var b="d="+a.getFullYear()+(a.getMonth()+1)+a.getDate()+a.getHours();var c=new JKL.ParseXML("/xml/header.xml?"+b);c.async(function(d){var f=(d.header.pr.image)?'<img src="'+d.header.pr.image+'">':d.header.pr.name;var e=$$("div#commonHeader p#logo a.info")[0].writeAttribute("href",d.header.pr.url).update(f).show();if(d.header.pr.target){e.writeAttribute("target",d.header.pr.target)}d.header.channels.channel.each(function(h){var g='<li><a href="'+h.url+"?tr="+this._getTrackingCode()+'" class="naviChannel"';g+=(h.target)?' target="'+h.target+'">':">";g+=h.name+"</a></li>";$("channelNavi").insert({bottom:g})}.bind(this))}.bind(this));c.parse()},_getTrackingCode:function(){var a="headtab";if(location.pathname.startsWith("/index")){}else{if(location.pathname.startsWith("/movie")){a+="_movietop"}else{if(location.pathname.startsWith("/showbiz")){a+="_showbiztop"}else{if(location.pathname.startsWith("/gravure")){a+="_gravuretop"}else{if(location.pathname.startsWith("/selection")){a+="_selectiontop"}else{if(location.pathname.startsWith("/music")){if(location.pathname.include("genre_2_")||location.search.include("gid=2")){a+="_worldtop"}else{if(location.pathname.include("genre_3_")||location.search.include("gid=3")){a+="_realmusictop"}else{a+="_domestictop"}}}}}}}}return a}});document.observe("dom:loaded",function(){new Realguide.headerModule()});
